aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb11
-rw-r--r--app/views/layouts/default.rhtml2
-rw-r--r--app/views/request/frontpage.rhtml31
-rw-r--r--app/views/request/list.rhtml4
-rw-r--r--app/views/request/show.rhtml38
5 files changed, 54 insertions, 32 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 55e71a42e..6f002e4a2 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.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: application_helper.rb,v 1.7 2007-10-16 21:17:14 louise Exp $
+# $Id: application_helper.rb,v 1.8 2007-10-24 19:13:06 francis Exp $
module ApplicationHelper
@@ -43,9 +43,16 @@ module ApplicationHelper
link_to h(info_request.title), request_url(:id => info_request)
end
- def public_body_link(public_body)
+ def public_body_link_short(public_body)
link_to h(public_body.short_name), public_body_url(:short_name => public_body.short_name)
end
+ def public_body_link(public_body)
+ link_to h(public_body.name), public_body_url(:short_name => public_body.short_name)
+ end
+
+ def user_link(user)
+ link_to h(user.name), show_user_url(:name => user.name)
+ end
end
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index d480d82e9..038bdecef 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -45,7 +45,9 @@
<div id="wrapper">
<div id="content">
+ <div id="<%= controller.controller_name + "_" + controller.action_name %>">
<%= yield :layout %>
+ <?div>
</div>
</div>
diff --git a/app/views/request/frontpage.rhtml b/app/views/request/frontpage.rhtml
index 43d641a06..b98b27e30 100644
--- a/app/views/request/frontpage.rhtml
+++ b/app/views/request/frontpage.rhtml
@@ -1,20 +1,15 @@
-<div id="frontpage">
-
- <div id="make_requests">
- <h1>Make requests for information from the UK Government</h1>
-
- <% form_for(:info_request, @info_request, :url => new_request_url, :html => { :id => 'public_body_form', :class => 'plaque' } ) do |f| %>
- <p>Choose which public body you would like information from.</p>
- <%= @public_bodies = PublicBody.find(:all, :order => "name")
- f.collection_select(:public_body_id, @public_bodies, :id, :name) %>
- <p><%= submit_tag "Submit >>" %></p>
- <% end %>
- </div>
-
- <div id="find_information">
- <h1>Find information that others requested</h1>
- <p><a href="/list">View all information</a></p>
- </div>
-
+<div id="make_requests">
+ <h1>Make requests for information from the UK Government</h1>
+
+ <% form_for(:info_request, @info_request, :url => new_request_url, :html => { :id => 'public_body_form', :class => 'plaque' } ) do |f| %>
+ <p>Choose which public body you would like information from.</p>
+ <%= @public_bodies = PublicBody.find(:all, :order => "name")
+ f.collection_select(:public_body_id, @public_bodies, :id, :name) %>
+ <p><%= submit_tag "Submit >>" %></p>
+ <% end %>
+</div>
+<div id="find_information">
+ <h1>Find information that others requested</h1>
+ <p><a href="/list">View all information</a></p>
</div>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index 9316ab576..21e3e003a 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -13,9 +13,9 @@
<% for info_request in @info_requests %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%= public_body_link(info_request.public_body) %></td>
+ <td><%= public_body_link_short(info_request.public_body) %></td>
<td><%= request_link(info_request) %></td>
- <td><%= link_to h(info_request.user.name), show_user_url(:name => info_request.user.name) %></td>
+ <td><%= user_link(info_request.user) %></td>
<td><%= simple_date(info_request.created_at) %></td>
</tr>
<% end %>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index acde44703..acbeee27e 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -7,18 +7,36 @@ Request to
<%= public_body_link(@info_request.public_body) %>
</p>
-<p>
-Created by
-<%= link_to h(@info_request.user.name), show_user_url(:name => @info_request.user.name) %>
-on <%= simple_date(@info_request.created_at) %>
-</p>
-
<h2>Correspondence</h2>
<% for outgoing_message in @info_request.outgoing_messages %>
- <h3><%= simple_date(outgoing_message.created_at) %></h3>
- <p><%= outgoing_message.status %>, <%= outgoing_message.message_type %> </p>
- <pre><%= outgoing_message.body %></pre>
-<% end %>
+ <div id="correspondence">
+ <blockquote class="xsnazzy">
+ <b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b><b class="xb5"></b><b class="xb6"></b><b class="xb7"></b>
+ <div class="xboxcontent">
+ <p><%= outgoing_message.body.gsub(/\n/, '<br>') %></p>
+ </div>
+ <b class="xb7"></b><b class="xb6"></b><b class="xb5"></b><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1"></b>
+ <em></em><span></span>
+ </blockquote>
+
+ <p class="xspeaker">
+ <%= user_link(@info_request.user) %>
+
+ <% if outgoing_message.message_type == 'initial_request' %>
+ sent the initial request
+ <% if outgoing_message.status == 'sent' %>
+ to <%= public_body_link(@info_request.public_body) %>
+ on <strong><%= simple_date(outgoing_message.sent_at) %></strong>
+ <% elsif outgoing_message.status == 'ready' %>
+ it has <strong>not yet been sent</strong>
+ <% else raise "unknown outgoing_message.status" %>
+ <% end %>
+ <% else raise "unknown outgoing_message.message_type" %>
+ <% end %>
+ </p>
+
+ </div>
+<% end %>