From 8d04d8a492a7d0a78802bd89998006352b910581 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 11 Oct 2012 18:02:25 +0100 Subject: Handle the case where the blog feed already has querystring parameters. --- app/controllers/general_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 150b433ec..21a318938 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -71,7 +71,9 @@ class GeneralController < ApplicationController def blog medium_cache @feed_autodetect = [] - @feed_url = "#{Configuration::blog_feed}?lang=#{self.locale_from_params()}" + @feed_url = Configuration::blog_feed + separator = @feed_url.include?('?') ? '&' : '?' + @feed_url = "#{@feed_url}#{separator}lang=#{self.locale_from_params()}" @blog_items = [] if not @feed_url.empty? content = quietly_try_to_open(@feed_url) -- cgit v1.2.3 From 871e2fda4fea4ada327031aaa30d2bbb5774956a Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Wed, 17 Oct 2012 14:51:32 +1100 Subject: Don't show internal admin authority on auto generated list on home page --- app/controllers/general_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 21a318938..3fdfb4b0b 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -29,7 +29,7 @@ class GeneralController < ApplicationController PublicBody.with_locale(@locale) do if body_short_names.empty? # This is too slow - @popular_bodies = PublicBody.find(:all, + @popular_bodies = PublicBody.visible.find(:all, :order => "info_requests_count desc", :limit => 32, :conditions => conditions, -- cgit v1.2.3 From f06fd4702af107efcce1f164f534d57fa79b7653 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Fri, 26 Oct 2012 08:59:22 +1100 Subject: Always have the newest events at the top of the list --- app/controllers/general_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 3fdfb4b0b..0cde238cd 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -58,6 +58,8 @@ class GeneralController < ApplicationController xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count-@request_events.count) more_events = xapian_object.results.map { |r| r[:model] } @request_events += more_events + # Overall we still want the list sorted with the newest first + @request_events.sort!{|e1,e2| e2.created_at <=> e1.created_at} else @request_events_all_successful = true end -- cgit v1.2.3