follow tag from sidebar

This commit is contained in:
danielgrippi 2011-10-27 18:41:59 -07:00
parent 29a0706123
commit e8169ee581
6 changed files with 29 additions and 6 deletions

View file

@ -6,14 +6,15 @@
%ul.left_nav
%li
%b=link_to t('streams.followed_tag.title'), tag_followings_path, :class => 'home_selector'
%ul.sub_nav
- if tags.size > 0
- for tg in tags
%li.unfollow{:id => tg.name}
.unfollow_icon.hidden
= link_to image_tag("icons/monotone_close_exit_delete.png", :height => 16, :title => t('aspects.index.unfollow_tag', :tag => tg.name)), tag_tag_followings_path(:name => tg.name, :remote => true), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :id => "unfollow_" + tg.name
=link_to "##{tg.name}", tag_path(:name => tg.name), :class => "tag_selector"
- else
%li
= link_to t('aspects.index.no_tags'), tags_path, :class => "new_aspect"
= link_to "##{tg.name}", tag_path(:name => tg.name), :class => "tag_selector"
%li
= form_for TagFollowing.new do |tg|
= text_field_tag :name, "", :class => "tag_input", :placeholder => t('streams.followed_tag.add_a_tag')
= tg.submit t('streams.followed_tag.follow'), :class => "button hidden"

View file

@ -860,6 +860,8 @@ en:
followed_tag:
title: "#Followed Tags"
contacts_title: "People who dig these tags"
add_a_tag: "Add a tag"
follow: "Follow"
tags:
title: "Posts tagged: %{tags}"

View file

@ -57,6 +57,7 @@ Diaspora::Application.routes.draw do
get "tag_followings" => "tag_followings#index", :as => 'tag_followings'
resources :mentions, :only => [:index]
resources "tag_followings", :only => [:create]
get 'tags/:name' => 'tags#show', :as => 'tag'

View file

@ -6,4 +6,4 @@ Diaspora.Pages.AspectsIndex = function() {
self.stream = self.instantiate("Stream", document.find("#aspect_stream_container"));
self.infiniteScroll = self.instantiate("InfiniteScroll");
});
};
};

View file

@ -46,6 +46,12 @@ var View = {
$(this).focusout();
});
/* tag following */
$("#new_tag_following .tag_input").bind('focus', function(evt){
$(this).siblings("#tag_following_submit").removeClass('hidden');
}).bind('blur', function(evt){
$(this).siblings("#tag_following_submit").addClass('hidden');
});
/* Autoexpand textareas */
var startAutoResize = function() {

View file

@ -3437,3 +3437,16 @@ a.toggle_selector
:position absolute
:top 24px
:right -33px
.left_nav
#new_tag_following
:margin
:left 24px
input[type='text']
:font
:size 13px
#tag_following_submit
&.hidden
:display none