diff options
-rw-r--r-- | app/controllers/user_controller.rb | 5 | ||||
-rw-r--r-- | app/views/body/show.rhtml | 9 | ||||
-rw-r--r-- | app/views/user/show.rhtml | 4 |
3 files changed, 13 insertions, 5 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 2dab3c522..7eb506337 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_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: user_controller.rb,v 1.37 2008-03-12 16:07:13 francis Exp $ +# $Id: user_controller.rb,v 1.38 2008-03-13 00:14:17 francis Exp $ class UserController < ApplicationController # Show page about a set of users with same url name @@ -15,6 +15,9 @@ class UserController < ApplicationController end @display_user = User.find(:first, :conditions => [ "url_name = ? and email_confirmed", params[:url_name] ]) + if not @display_user + raise "user not found" + end @same_name_users = User.find(:all, :conditions => [ "name = ? and email_confirmed and id <> ?", @display_user.name, @display_user.id ], :order => "created_at") end diff --git a/app/views/body/show.rhtml b/app/views/body/show.rhtml index 3d57ef57e..67e315d28 100644 --- a/app/views/body/show.rhtml +++ b/app/views/body/show.rhtml @@ -3,7 +3,7 @@ <h1><%=@title%></h1> <p class="subtitle"> -A public body in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %> +A public authority in the UK<% if not @public_body.short_name.empty? %>, also called <%= h(@public_body.short_name) %><% end %> </p> <p> @@ -11,10 +11,13 @@ A public body in the UK<% if not @public_body.short_name.empty? %>, also called </p> <% if @public_body.info_requests.empty? %> - <p>Nobody has made any Freedom of Information requests to this public body using this site.</p> + <h2>Freedom of Information requests made to this authority</h2> + <p>Nobody has made any Freedom of Information requests to this public authority using this site.</p> <% else %> - <p>People have made <%=pluralize(@public_body.info_requests.size, "Freedom of Information request") %> to this public body using this site.</p> + <h2> + <%=pluralize(@public_body.info_requests.size, "Freedom of Information request") %> made to this authority + </h2> <%= render :partial => 'request/request_listing', :locals => { :info_requests => @public_body.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %> <% end %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 21356f8f8..d4c4b06f7 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -10,17 +10,19 @@ <div class="single_user" id="user-<%=@display_user.id.to_s%>"> <h1><%=@title%></h1> - <p class="subtitle">Joined on <%= simple_date(@display_user.created_at) %></p> + <p class="subtitle">Joined WhatDoTheyKnow on <%= simple_date(@display_user.created_at) %></p> <p><%= link_to "Send message to " + h(@display_user.name), contact_user_url(:id => @display_user.id) %></p> <% if @display_user.info_requests.empty? %> + <h2>Freedom of Information requests made by this person</h2> <p><%= @display_user == @user ? 'You have' : 'This person has' %> made no Freedom of Information requests using this site.</p> <% else %> <h2> <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %> + made by this person </h2> <%= render :partial => 'request/request_listing', :locals => { :info_requests => @display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %> |