aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-11-12 15:06:46 +0000
committerLouise Crow <louise.crow@gmail.com>2012-11-12 15:06:46 +0000
commita1ca0f9123a3aea843ba35508a97d5a4fd5cb0db (patch)
treeb9d3c1390f6b9c8b201e47507f26829b239f2773 /app/controllers/general_controller.rb
parent8271b2c664f04d1b68a8b4d4fdb801f5c6b00b8c (diff)
parentc96b27c301023a6a1f50c12f0c387205b0255836 (diff)
Merge remote-tracking branch 'origin/release/0.6.8'0.6.8
Conflicts: locale/cs/app.po locale/sl/app.po locale/sq/app.po locale/tr/app.po locale/uk/app.po
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r--app/controllers/general_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 150b433ec..0cde238cd 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,
@@ -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
@@ -71,7 +73,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)