diff options
author | francis <francis> | 2008-09-04 17:59:08 +0000 |
---|---|---|
committer | francis <francis> | 2008-09-04 17:59:08 +0000 |
commit | a3fa7134a03068f078a3d8a69d7de94f4fd8f0bc (patch) | |
tree | 6838d4b11f0b90c657890c1b3e679a543db7857e | |
parent | 8bfd0ab3bcb077ba0ead0fa7b0e921cbc511691a (diff) |
Show better list of sample stuff on new front page.
-rw-r--r-- | app/controllers/general_controller.rb | 5 | ||||
-rw-r--r-- | app/views/body/list.rhtml | 1 | ||||
-rw-r--r-- | app/views/general/new_frontpage.rhtml | 20 | ||||
-rw-r--r-- | public/stylesheets/main.css | 26 | ||||
-rw-r--r-- | todo.txt | 2 |
5 files changed, 38 insertions, 16 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> diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 7954d42c5..2bea5af11 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -277,22 +277,30 @@ dd { margin: 0.6em 0 2em 4em; width: 33em; } padding: 1em; background-color: #e0e0e0; } +#frontpage_examples div#examples_0 { + float: left; + margin-left: 0%; + width: 49%; +} +#frontpage_examples div#examples_1 { + float: right; + margin-right: 0%; + width: 49%; +} +#frontpage_examples p +{ + text-align: center; + clear: both; +} #frontpage_examples li { } #frontpage_examples ul { - width: 34%; margin: 0 0 0 0; padding: 1em 0em 1em 0em; -} -#frontpage_examples ul#examples_0 { - float: left; - margin-left: 20%; -} -#frontpage_examples ul#examples_1 { - float: right; - margin-right: 10%; + text-align: center; + list-style: none; } #find_information @@ -89,6 +89,8 @@ frontpage things: - browse public authorities gone - telling us public authority not found gone - doesn't have successful requests +turning it off + - Remove javascript from default :) Add count of comments to admin summary page Flag bad comments, delete comments from admin interface |