diff --git a/app/views/tags/_followed_tags_listings.haml b/app/views/tags/_followed_tags_listings.haml index 380cb25d8..f3a51c08b 100644 --- a/app/views/tags/_followed_tags_listings.haml +++ b/app/views/tags/_followed_tags_listings.haml @@ -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" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 15997453a..24f995316 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -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}" diff --git a/config/routes.rb b/config/routes.rb index 7e55b665f..2b37f97bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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' diff --git a/public/javascripts/pages/aspects-index.js b/public/javascripts/pages/aspects-index.js index 071f6e4d5..5b4b605fd 100644 --- a/public/javascripts/pages/aspects-index.js +++ b/public/javascripts/pages/aspects-index.js @@ -6,4 +6,4 @@ Diaspora.Pages.AspectsIndex = function() { self.stream = self.instantiate("Stream", document.find("#aspect_stream_container")); self.infiniteScroll = self.instantiate("InfiniteScroll"); }); -}; \ No newline at end of file +}; diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 2fcb15a36..c778d25db 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -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() { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index a0aa3965e..b9436c724 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -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