diff options
-rw-r--r-- | app/helpers/application_helper.rb | 11 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/frontpage.rhtml | 31 | ||||
-rw-r--r-- | app/views/request/list.rhtml | 4 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 38 | ||||
-rw-r--r-- | public/stylesheets/main.css | 43 |
6 files changed, 93 insertions, 36 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 %> diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index c78f5aa0f..26055502e 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -180,18 +180,18 @@ label { /* / - front page */ -#frontpage h1 { +#request_frontpage h1 { margin-bottom: 1em; } -#frontpage #make_requests { +#request_frontpage #make_requests { text-align: center; width: 45%; float: left; } -#frontpage #public_body_form { +#request_frontpage #public_body_form { } -#frontpage #find_information { +#request_frontpage #find_information { text-align: center; width: 45%; float: right; @@ -227,6 +227,10 @@ table#list_requests .odd { background-color: #dddddd; } +/* /request - viewing requests */ + + + /* User accounts */ #accountForm { @@ -261,5 +265,36 @@ table#list_requests .odd { text-align: center; } +/* Speech bubbles + * from http://www.cssplay.co.uk/boxes/chunky.html */ + +.xsnazzy h1, .xsnazzy h2, .xsnazzy p {margin:0 10px; letter-spacing:1px;} +.xsnazzy h1 {font-size:2.5em; color:#fc0;} +.xsnazzy h2 {font-size:2em; color:#234; border:0;} +.xsnazzy p {padding-bottom:0.5em; color:#eee;} +.xsnazzy h2 {padding-top:0.5em; padding-left:10px;} +.xsnazzy {background: transparent; margin:1em;} + +.xsnazzy em {display:block; width:0; height:0; color:#d8d8ee; overflow:hidden; border-top:12px solid #fff; border-left:12px dotted transparent; border-right:12px dotted transparent; margin-left:50px;} + +/* hack for IE5.5 */ +* html .xsnazzy em {width:24px; height:12px; w\idth:0; hei\ght:0;} + +.xsnazzy span {display:block; width:0; height:0; color:#fff; overflow:hidden; border-top:10px solid #7f7f9c; border-left:10px dotted transparent; border-right:10px dotted transparent; margin-left:52px; margin-top:-15px;} +* html .xsnazzy span {width:20px; height:10px; w\idth:0; hei\ght:0;} + +.xb1, .xb2, .xb3, .xb4, .xb5, .xb6, .xb7 {display:block; overflow:hidden; font-size:0;} +.xb1, .xb2, .xb3, .xb4, .xb5, .xb6 {height:1px;} +.xb4, .xb5, .xb6, .xb7 {background:#ccc; border-left:1px solid #fff; border-right:1px solid #fff;} +.xb1 {margin:0 8px; background:#fff;} +.xb2 {margin:0 6px; background:#fff;} +.xb3 {margin:0 4px; background:#fff;} +.xb4 {margin:0 3px; background:#7f7f9c; border-width:0 5px;} +.xb5 {margin:0 2px; background:#7f7f9c; border-width:0 4px;} +.xb6 {margin:0 2px; background:#7f7f9c; border-width:0 3px;} +.xb7 {margin:0 1px; background:#7f7f9c; border-width:0 3px; height:2px;} + +.xboxcontent {display:block; background:#7f7f9c; border:3px solid #fff; border-width:0 3px;} +.xspeaker { margin: -0.5em 52px; } |