diff options
-rw-r--r-- | app/controllers/body_controller.rb | 5 | ||||
-rw-r--r-- | app/views/body/_body_listing.rhtml | 30 |
2 files changed, 21 insertions, 14 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb index 940df1609..5c06521f2 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.8 2008-03-03 00:43:51 francis Exp $ +# $Id: body_controller.rb,v 1.9 2008-03-03 09:29:43 francis Exp $ class BodyController < ApplicationController # XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL @@ -54,6 +54,9 @@ class BodyController < ApplicationController @description = "All" if not @tag.nil? @description = PublicBody.categories_by_tag[@tag] + if @description.nil? + @description = @tag + end end end end diff --git a/app/views/body/_body_listing.rhtml b/app/views/body/_body_listing.rhtml index 97660547d..0287997c8 100644 --- a/app/views/body/_body_listing.rhtml +++ b/app/views/body/_body_listing.rhtml @@ -1,16 +1,20 @@ -<% for public_body in public_bodies %> - <p class="body_listing"> - <%= public_body_link(public_body) %> - - <br> - <% if not public_body.short_name.empty? %> - Also called <%=h public_body.short_name %>. +<% if public_bodies.empty? %> + None found. +<% else %> + <% for public_body in public_bodies %> + <p class="body_listing"> + <%= public_body_link(public_body) %> + <br> - <% end %> + <% if not public_body.short_name.empty? %> + Also called <%=h public_body.short_name %>. + <br> + <% end %> - <span class="request_listing_bottomline"> - <%= pluralize(public_body.info_requests.size, "request") %> made. - Added on <%= simple_date(public_body.created_at) %>. - </span> - </p> + <span class="request_listing_bottomline"> + <%= pluralize(public_body.info_requests.size, "request") %> made. + Added on <%= simple_date(public_body.created_at) %>. + </span> + </p> + <% end %> <% end %> |