diff options
-rw-r--r-- | app/controllers/body_controller.rb | 8 | ||||
-rw-r--r-- | app/views/body/_body_listing.rhtml | 14 | ||||
-rw-r--r-- | app/views/body/list.rhtml | 11 | ||||
-rw-r--r-- | app/views/help/about.rhtml | 8 | ||||
-rw-r--r-- | app/views/request/frontpage.rhtml | 5 | ||||
-rw-r--r-- | config/routes.rb | 9 | ||||
-rw-r--r-- | public/stylesheets/main.css | 19 |
7 files changed, 67 insertions, 7 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb index ba90f317f..7f2d1fe05 100644 --- a/app/controllers/body_controller.rb +++ b/app/controllers/body_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: body_controller.rb,v 1.3 2007-10-31 12:39:58 francis Exp $ +# $Id: body_controller.rb,v 1.4 2008-02-22 13:49:37 francis Exp $ class BodyController < ApplicationController # XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL @@ -29,4 +29,8 @@ class BodyController < ApplicationController @public_body = @public_bodies[0] end -end + def list + @public_bodies = PublicBody.paginate :order => "name", :page => params[:page], :per_page => 25 + end + + end diff --git a/app/views/body/_body_listing.rhtml b/app/views/body/_body_listing.rhtml new file mode 100644 index 000000000..35ec18fb0 --- /dev/null +++ b/app/views/body/_body_listing.rhtml @@ -0,0 +1,14 @@ +<% for public_body in public_bodies %> + <p class="body_listing"> + <%= public_body_link(public_body) %> + + <br> + Also called <%=h public_body.short_name %>. + <br> + + <span class="request_listing_bottomline"> + <%= pluralize(public_body.info_requests.size, "request") %> made. + Added on <%= simple_date(public_body.created_at) %>. + </span> + </p> +<% end %> diff --git a/app/views/body/list.rhtml b/app/views/body/list.rhtml new file mode 100644 index 000000000..bef1d8611 --- /dev/null +++ b/app/views/body/list.rhtml @@ -0,0 +1,11 @@ +<% @title = "All UK public bodies" %> + +<h1><%=@title%></h1> + +<p> +<a href="/help/about#missing_body">Are we missing a public body?</a> +</p> + +<%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %> + +<%= will_paginate(@public_bodies) %> diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml index 4730a2e39..0e598b0b1 100644 --- a/app/views/help/about.rhtml +++ b/app/views/help/about.rhtml @@ -48,6 +48,14 @@ If you like what we're doing, then you can <h1>Making requests</h1> <dl> +<dt id="missing_body">You're missing the public body that I want to request from!</dt> + +<dd>If it is a local council, please find the relevant email address and +<a href="http://tinyurl.com/2cep8a">add it to this shared spreadsheet</a> (Google account required). +Otherwise, please <a href="/help/contact">contact us</a> with the name of the public body, and +if you can find it the email address for FOI requests. +</dd> + <dt id="quickly_response">How quickly will I get a response?</dt> <dd>By law public bodies must respond within 20 days, excluding weekends and diff --git a/app/views/request/frontpage.rhtml b/app/views/request/frontpage.rhtml index e7fe32c61..456c4bbd5 100644 --- a/app/views/request/frontpage.rhtml +++ b/app/views/request/frontpage.rhtml @@ -6,7 +6,8 @@ <% if @public_bodies.size == 0 and @query_made %> <div id="error"> Sorry! We couldn't find any public bodies with that in their names. - Please <a href="/help/contact">ask us to add the one you want</a>. + Either <a href="/body">browse them all</a> or + <a href="/help/contact">ask us to add the one you want</a>. </div> <% end %> @@ -48,7 +49,7 @@ <% end %> <p> - Can't find the one you want? <a href="/help/contact">Ask us to add it</a> + Can't find it? <a href="/body">Browse all</a> or <a href="/help/contact">ask us to add it</a>. </p> <% end %> </div> diff --git a/config/routes.rb b/config/routes.rb index 3ecfdb373..4de8c1a35 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: routes.rb,v 1.36 2008-02-22 01:58:37 francis Exp $ +# $Id: routes.rb,v 1.37 2008-02-22 13:49:37 francis Exp $ ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. @@ -36,12 +36,15 @@ ActionController::Routing::Routes.draw do |map| user.show_user '/user/:simple_name', :action => 'show' end + map.with_options :controller => 'body' do |body| + body.list_public_bodies "/body", :action => 'list' + body.show_public_body "/body/:simple_short_name", :action => 'show' + end + map.with_options :controller => 'help' do |help| help.help_general '/help/:action', :action => :action end - map.show_public_body "/body/:simple_short_name", :controller => 'body', :action => 'show' - # NB: We don't use routes to *construct* admin URLs, as they need to be relative # paths to work on the live site proxied over HTTPS to secure.mysociety.org map.connect '/admin/:action', :controller => 'admin', :action => 'index' diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 7504e27ee..b2c41bdca 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -345,6 +345,25 @@ table#list_requests .odd { color: #ff0000; } +/* /body - listing bodies */ + +.body_listing { +} +.body_listing_bottomline { + color: #7aa600; +} +.body_listing_bottomline a:link { + color: #7777cc; +} +.body_listing_bottomline a:visited { + color: #551a8b; +} +.body_listing_bottomline a:active { + color: #ff0000; +} + + + /* /request - viewing requests */ |