diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 0c8fa32ec..df448d52b 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -60,6 +60,7 @@ class TagsController < ApplicationController @posts = StatusMessage.all_public end + params[:prefill] = "##{params[:name]} " @posts = @posts.tagged_with(params[:name]) max_time = params[:max_time] ? Time.at(params[:max_time].to_i) : Time.now diff --git a/app/helpers/publisher_helper.rb b/app/helpers/publisher_helper.rb new file mode 100644 index 000000000..516a20b28 --- /dev/null +++ b/app/helpers/publisher_helper.rb @@ -0,0 +1,17 @@ +# Copyright (c) 2010-2011, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + +module PublisherHelper + def public_value + params[:controller] == "tags" + end + + def remote? + params[:controller] != "tags" + end + + def public_helper_text + (public_value)? t('javascripts.publisher.public'): t('javascripts.publisher.limited') + end +end diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index 65d201a53..f5b8742b5 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -11,7 +11,7 @@ #publisher.closed{:class => ((aspect == :profile)? 'mention_popup' : nil )} .content_creation - = form_for(StatusMessage.new, :remote => true, :html => {"data-type" => "json"}) do |status| + = form_for(StatusMessage.new, :remote => remote?, :html => {"data-type" => "json"}) do |status| = status.error_messages %p %params @@ -33,8 +33,8 @@ %span#publisher_service_icons = t("shared.publisher.click_to_share_with") - if((defined?(for_all_aspects) && for_all_aspects) || aspect == :profile) - = status.hidden_field(:public) - = image_tag "icons/globe.png", :title => t('javascripts.publisher.limited'), :class => 'public_icon dim', :width => 16, :height => 16 + = status.hidden_field(:public, :value => public_value ) + = image_tag "icons/globe.png", :title => public_helper_text, :class => "public_icon #{'dim' if !public_value}", :width => 16, :height => 16 - if current_user.services - for service in current_user.services = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" diff --git a/app/views/tags/show.haml b/app/views/tags/show.haml index b827be247..60e185085 100644 --- a/app/views/tags/show.haml +++ b/app/views/tags/show.haml @@ -58,6 +58,8 @@ %h2 = "##{params[:name]}" + = render 'shared/publisher', :selected_aspects => all_aspects.map(&:id), :aspect_ids => all_aspects.map(&:id), :for_all_aspects => true, :aspect => all_aspects.first + %hr #main_stream.stream diff --git a/features/follows_tags.feature b/features/follows_tags.feature index 3b165deca..ebf4186c5 100644 --- a/features/follows_tags.feature +++ b/features/follows_tags.feature @@ -19,6 +19,12 @@ Feature: posting And I press "Follow #boss" And I wait for the ajax to finish + Scenario: can post a message from the tag page + Then I should see "#boss" within "#publisher" + And I post a status with the text "#boss from the tag page" + And I search for "#boss" + Then I should see "#boss from the tag page" + Scenario: see a tag that I am following When I go to the home page And I follow "#boss"