aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/general_controller.rb5
-rw-r--r--app/views/body/list.rhtml1
-rw-r--r--app/views/general/new_frontpage.rhtml20
3 files changed, 19 insertions, 7 deletions
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
diff --git a/app/views/body/list.rhtml b/app/views/body/list.rhtml
index ac713ede4..000ea6011 100644
--- a/app/views/body/list.rhtml
+++ b/app/views/body/list.rhtml
@@ -27,6 +27,7 @@
<h1><%=@title%></h1>
<p class="subtitle">
<%= @public_bodies.size %> in total
+ (<a href="/help/about#missing_body">can't find the one you want?</a>)
</p>
<%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %>
diff --git a/app/views/general/new_frontpage.rhtml b/app/views/general/new_frontpage.rhtml
index 5cb4b0629..e69346dd0 100644
--- a/app/views/general/new_frontpage.rhtml
+++ b/app/views/general/new_frontpage.rhtml
@@ -15,12 +15,22 @@
</div>
<div id="frontpage_examples">
- <% for i in [0, 1] %>
- <ul id="examples_<%=i%>">
- <% for popular_body in @popular_bodies[i] %>
- <li><%=public_body_link(popular_body)%></li>
+ <div id="examples_0">
+ <ul>
+ <% for popular_body in @popular_bodies %>
+ <li><%=public_body_link(popular_body)%> </li>
<% end%>
</ul>
- <% end %>
+ <p><strong><a href="/body/list/other">More authorities...</a></strong></p>
+ </div>
+
+ <div id="examples_1">
+ <ul
+ <% for request in @random_requests %>
+ <li><%=link_to h(excerpt(request.title, "", 35)), request_url(request)%> </li>
+ <% end%>
+ </ul
+ <p><strong><a href="/list/successful">More successful requests...</a></strong></p>
+ </div>
</div>