From a3fa7134a03068f078a3d8a69d7de94f4fd8f0bc Mon Sep 17 00:00:00 2001 From: francis Date: Thu, 4 Sep 2008 17:59:08 +0000 Subject: Show better list of sample stuff on new front page. --- app/controllers/general_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 6bd2ed2fb..9e197d8e8 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -5,7 +5,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: general_controller.rb,v 1.35 2008-09-03 09:03:57 francis Exp $ +# $Id: general_controller.rb,v 1.36 2008-09-04 17:59:08 francis Exp $ class GeneralController < ApplicationController @@ -40,7 +40,8 @@ class GeneralController < ApplicationController # New, improved front page! def new_frontpage - @popular_bodies = PublicBody.find(:all, :select => "*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", :order => "c desc", :limit => 16).in_groups_of(8) + @popular_bodies = PublicBody.find(:all, :select => "*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", :order => "c desc", :limit => 8) + @random_requests = InfoRequest.find(:all, :order => "random()", :limit => 8, :conditions => ["described_state = ? and prominence = ?", 'successful', 'normal'] ) end # Just does a redirect from ?query= search to /query -- cgit v1.2.3