From 43f17b3ed8b55662f7d2b60ea4c122fbff786896 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 18 Feb 2011 16:37:46 -0800 Subject: [PATCH] made toggle for post time on aspects#index --- app/helpers/aspects_helper.rb | 3 ++- app/views/aspects/_aspect_stream.haml | 6 +++++- config/locales/diaspora/en.yml | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 850404f91..e3b93b663 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -5,7 +5,8 @@ module AspectsHelper def link_for_aspect(aspect, opts={}) opts[:params] ||= {} - opts[:params] = opts[:params].merge("a_ids[]" => aspect.id) + params ||= {} + opts[:params] = opts[:params].merge("a_ids[]" => aspect.id, :created_at => params[:created_at]) link_to aspect.name, aspects_path( opts[:params] ), opts end diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index 432112f0f..aaf946e56 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -4,8 +4,12 @@ = render 'shared/publisher', :aspect => aspect, :aspect_ids => aspect_ids +.prepend-11 + sort by: + = link_to_if(params[:created_at], t('.activity'), aspects_path(:a_ids => params[:a_ids])) + | + = link_to_unless(params[:created_at], t('.post_time'), aspects_path(:a_ids => params[:a_ids], :created_at => true )) #main_stream.stream{:data => {:guids => aspect_ids.join(',')}} - =request.url = render 'shared/stream', :posts => fakes %a.paginate = t("more") diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 7a9e6afe1..e68287276 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -169,6 +169,9 @@ en: make_aspect_list_visible: "make aspect list visible to others in aspect" aspect_contacts: done_editing: "done editing" + aspect_stream: + activity: 'activity' + post_time: 'post time' show: edit_aspect: "edit aspect" no_contacts_message: