diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/info_request_event.rb | 3 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 11 | ||||
-rw-r--r-- | app/views/body/_body_listing_single.rhtml | 15 | ||||
-rw-r--r-- | app/views/body/show.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/_bubble.rhtml | 15 | ||||
-rw-r--r-- | app/views/request/_request_listing_single.rhtml | 21 | ||||
-rw-r--r-- | app/views/request/_request_listing_via_event.rhtml | 55 | ||||
-rw-r--r-- | app/views/request/_sidebar_request_listing.rhtml | 18 | ||||
-rw-r--r-- | app/views/request/new.rhtml | 133 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 110 |
10 files changed, 189 insertions, 195 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 60253df3b..e8e1ecaa5 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -20,7 +20,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.38 2008-04-21 16:44:06 francis Exp $ +# $Id: info_request_event.rb,v 1.39 2008-04-24 22:50:03 angie Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -184,7 +184,6 @@ class InfoRequestEvent < ActiveRecord::Base end end - end diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 28aa0a754..189ff77d2 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: outgoing_message.rb,v 1.43 2008-04-21 16:44:06 francis Exp $ +# $Id: outgoing_message.rb,v 1.44 2008-04-24 22:50:03 angie Exp $ class OutgoingMessage < ActiveRecord::Base belongs_to :info_request @@ -133,9 +133,16 @@ class OutgoingMessage < ActiveRecord::Base text = self.body text = MySociety::Format.make_clickable(text, :contract => 1) text = text.gsub(/\n/, '<br>') - return text end + + def get_body_for_neat_html_display + text = self.body + text = MySociety::Format.make_clickable(text, :contract => 1) + text = text.gsub(/\n\n/, '<br>') + return text + end + # Return body for display as HTML # XXX this is repeating code in a combination of diff --git a/app/views/body/_body_listing_single.rhtml b/app/views/body/_body_listing_single.rhtml index c060ccdb3..dd0ab36c5 100644 --- a/app/views/body/_body_listing_single.rhtml +++ b/app/views/body/_body_listing_single.rhtml @@ -2,18 +2,19 @@ @highlight_words = [] end %> -<p class="body_listing"> +<div class="body_listing"> + <span class="head"> <%= link_to highlight_words(public_body.name, @highlight_words), public_body_url(public_body) %> - - <br> + </span> + <span class="desc"> <% if not public_body.short_name.empty? %> Also called <%=highlight_words(public_body.short_name, @highlight_words) %>. <br> <% end %> - - <span class="body_listing_bottomline"> - <%= pluralize(public_body.info_requests.size, "request") %> made. + </span> + <span class="bottomline"> + <%= pluralize(public_body.info_requests.size, "request") %> made. <br> Added on <%= simple_date(public_body.created_at) %>. </span> -</p> +</div> diff --git a/app/views/body/show.rhtml b/app/views/body/show.rhtml index 5a972831b..66b8a8555 100644 --- a/app/views/body/show.rhtml +++ b/app/views/body/show.rhtml @@ -1,5 +1,4 @@ <% @title = "Information freed from '" + h(@public_body.name) + "'" %> - <h1><%=h(@public_body.name)%></h1> <p class="subtitle"> @@ -21,5 +20,3 @@ <%= render :partial => 'request/request_listing', :locals => { :info_requests => @public_body.info_requests } %> <% end %> - - diff --git a/app/views/request/_bubble.rhtml b/app/views/request/_bubble.rhtml index de3ee296f..f3f053522 100644 --- a/app/views/request/_bubble.rhtml +++ b/app/views/request/_bubble.rhtml @@ -1,8 +1,4 @@ -<blockquote class="xsnazzy"> - <div> - <strong class="xb1"></strong><strong class="xb2"></strong><strong class="xb3"></strong><strong class="xb4"></strong><strong class="xb5"></strong><strong class="xb6"></strong><strong class="xb7"></strong> - </div> - <div class="xboxcontent"> + <div class="correspondence_text"> <% if not attachments.nil? and attachments.size > 0 %> <p> <% attachments.each do |a| %> <% attachment_url = get_attachment_url(:id => incoming_message.info_request_id, @@ -21,11 +17,4 @@ </p> <% end %> <p><%= body %></p> - </div> - <div> - <strong class="xb7"></strong><strong class="xb6"></strong><strong class="xb5"></strong><strong class="xb4"></strong><strong class="xb3"></strong><strong class="xb2"></strong><strong class="xb1"></strong> - <em></em> - <span class="bubblebit"></span> - </div> -</blockquote> - + </div>
\ No newline at end of file diff --git a/app/views/request/_request_listing_single.rhtml b/app/views/request/_request_listing_single.rhtml index f50627a5f..0a060dece 100644 --- a/app/views/request/_request_listing_single.rhtml +++ b/app/views/request/_request_listing_single.rhtml @@ -1,18 +1,17 @@ -<p class="request_listing"> - <%= link_to h(info_request.title), request_url(info_request) %> - - <br> - <%= excerpt(info_request.initial_request_text, "", 150) %> - <br> - - <span class="request_listing_bottomline"> +<div class="request_listing"> + <span class="head"> + <%= link_to h(info_request.title), request_url(info_request) %> + </span> + <span class="desc"> + <%= excerpt(info_request.initial_request_text, "", 150) %> + </span> + <span class="bottomline icon_<%= info_request.calculate_status %>"> <strong> <%= info_request.display_status %> - </strong> - + </strong><br> Requested from <%= public_body_link(info_request.public_body) %> by <%= user_link(info_request.user) %> on <%= simple_date(info_request.created_at) %>. </span> -</p> +</div> diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml index 58630337b..8fe1d23ca 100644 --- a/app/views/request/_request_listing_via_event.rhtml +++ b/app/views/request/_request_listing_via_event.rhtml @@ -1,34 +1,34 @@ -<p class="request_listing"> +<div class="request_listing"> + <span class="head"> + <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].include?('title') %> + <%= link_to @highlighting['InfoRequestEvent'][event.id]["title"], request_url(info_request) %> + <% @highlighting['InfoRequestEvent'][event.id].delete("title") %> + <% elsif not event.incoming_message.nil? %> + <%= link_to "Response to '" + h(info_request.title) + "'", incoming_message_url(event.incoming_message) %> + <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %> + <%= link_to "Follow up message for '" + h(info_request.title) + "'", outgoing_message_url(event.outgoing_message) %> + <% else %> + <%= link_to h(info_request.title), request_url(info_request) %> + <% end %> + </span> + <span class="desc"> + <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0 %> + <%= @highlighting['InfoRequestEvent'][event.id].values.join(" ") %> + <% elsif not event.outgoing_message.nil? %> + <%= excerpt(event.outgoing_message.body_without_salutation, "", 150) %> + <% elsif not event.incoming_message.nil? %> + <%= excerpt(event.incoming_message.get_body_for_quoting, "", 150) %> + <% else %> + <%= excerpt(info_request.initial_request_text, "", 150) %> + <% end %> + </span> - <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].include?('title') %> - <%= link_to @highlighting['InfoRequestEvent'][event.id]["title"], request_url(info_request) %> - <% @highlighting['InfoRequestEvent'][event.id].delete("title") %> - <% elsif not event.incoming_message.nil? %> - <%= link_to "Response to '" + h(info_request.title) + "'", incoming_message_url(event.incoming_message) %> - <% elsif not event.outgoing_message.nil? and event.event_type == 'followup_sent' %> - <%= link_to "Follow up message for '" + h(info_request.title) + "'", outgoing_message_url(event.outgoing_message) %> - <% else %> - <%= link_to h(info_request.title), request_url(info_request) %> - <% end %> - - <br> - <% if not @highlighting.nil? and @highlighting['InfoRequestEvent'][event.id].size > 0 %> - <%= @highlighting['InfoRequestEvent'][event.id].values.join(" ") %> - <% elsif not event.outgoing_message.nil? %> - <%= excerpt(event.outgoing_message.body_without_salutation, "", 150) %> - <% elsif not event.incoming_message.nil? %> - <%= excerpt(event.incoming_message.get_body_for_quoting, "", 150) %> - <% else %> - <%= excerpt(info_request.initial_request_text, "", 150) %> - <% end %> - <br> - - <span class="request_listing_bottomline"> + <span class="bottomline icon_<%= info_request.calculate_status %>"> <% if event.event_type == 'sent' %> <strong> <%= info_request.display_status %> - </strong> + </strong><br> Request sent to <%= public_body_link(info_request.public_body) %> by <%= user_link(info_request.user) %> <% elsif event.event_type == 'followup_sent' %> @@ -45,8 +45,7 @@ <% else %> <% raise "unknown event type indexed " + event.event_type %> <% end %> - on <%= simple_date(event.created_at) %>. </span> -</p> +</div> diff --git a/app/views/request/_sidebar_request_listing.rhtml b/app/views/request/_sidebar_request_listing.rhtml index 3da0b4972..e9aeb4f73 100644 --- a/app/views/request/_sidebar_request_listing.rhtml +++ b/app/views/request/_sidebar_request_listing.rhtml @@ -1,16 +1,16 @@ <% for info_request in info_requests %> - <p class="request_listing"> - <%= request_link(info_request) %> - - <br> + <div class="request_listing"> + <span class="head"> + <%= request_link(info_request) %> + </span> + <span class="desc"> <%=h excerpt(info_request.initial_request_text, "", 100) %> - <br> - - <span class="request_listing_bottomline"> + </span> + <span class="bottomline"> <strong> <%= info_request.display_status %> - </strong> + </strong><br> Requested on <%= simple_date(info_request.created_at) %>. </span> - </p> + </div> <% end %> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index 44bae85c9..1c64b9c8a 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -16,73 +16,74 @@ <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %> <div id="request_advice"> - <h1>Read this before writing your Freedom of Information request</h1> - <ul> - <li>Use a <strong>search engine first</strong> to check that the information isn't already published. - </li> - <li>Write your request in <strong>simple, precise language</strong>. - <% if @info_request.public_body.info_requests.size > 0 %> - <li>Browse <%= link_to "other requests", public_body_url(@info_request.public_body) %> - to '<%= h(@info_request.public_body.name) %>' - for examples of how to word your request. - </li> - <% else %> - <li>Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request. - </li> - <% end %> - <li>Keep it <strong>focussed</strong>, if you ask for everything it might cost too much - and you might get nothing. - </li> - <li>Top tip: Ask for a <strong>particular document</strong> you have seen mentioned elsewhere. - </li> - <li>This site is <strong>public</strong>, everything you type (except your email address) and any response will be published. - </li> - </ul> + <h1>Read this before writing your Freedom of Information request</h1> + <ul> + <li>Use a <strong>search engine first</strong> to check that the information isn't already published. + </li> + <li>Write your request in <strong>simple, precise language</strong>. + <% if @info_request.public_body.info_requests.size > 0 %> + <li>Browse <%= link_to "other requests", public_body_url(@info_request.public_body) %> + to '<%= h(@info_request.public_body.name) %>' + for examples of how to word your request. + </li> + <% else %> + <li>Browse <%= link_to "other requests", request_list_url %> for examples of how to word your request. + </li> + <% end %> + <li>Keep it <strong>focussed</strong>, if you ask for everything it might cost too much + and you might get nothing. + </li> + <li>Top tip: Ask for a <strong>particular document</strong> you have seen mentioned elsewhere. + </li> + <li>This site is <strong>public</strong>, everything you type (except your email address) and any response will be published. + </li> + </ul> </div> - - <p> - <label class="form_label" for="info_request_public_body_id">To:</label> - <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> - </p> - - <p> - <label class="form_label" for="info_request_title">Summary:</label> - <%= f.text_field :title, :size => 50 %> - </p> - <div class="form_item_note"> - (a one line summary of the information you are requesting, - e.g. 'Crime statistics by ward level for Wales') - </div> - - <% fields_for :outgoing_message do |o| %> - <p> - <label class="form_label" for="outgoing_message_body">Your request:</label> - <%= o.text_area :body, :rows => 20, :cols => 60 %> - </p> - <% end %> - - <div class="form_button"> - <script type="text/javascript">document.write('<input name="doSpell" type="button" value="Check spelling" onClick="openSpellChecker(document.getElementById(\'write_form\').body);"/> (optional)')</script> - </div> - - <p class="form_note"> - <strong>Privacy warning:</strong> All information that you enter, except - for your email address, will be displayed publically on this website. Any - response you get will also be published. - </p> - - <p class="form_note"> - <strong>Can I request information about myself?</strong> - <a href="/help/about#data_protection">No! (Click here for details)</a> - </p> - - <div class="form_button"> - <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> - <%= hidden_field_tag(:submitted_new_request, 1 ) %> - <%= hidden_field_tag(:preview, 1 ) %> - <%= submit_tag "Preview your public request" %> - </div> - + + <div id="request_form"> + <h1> + <label class="form_label" for="info_request_public_body_id">To:</label> + <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> + </h1> + + <p> + <label class="form_label" for="info_request_title">Summary:</label> + <%= f.text_field :title, :size => 50 %> + </p> + <div class="form_item_note"> + (a one line summary of the information you are requesting, + e.g. 'Crime statistics by ward level for Wales') + </div> + + <% fields_for :outgoing_message do |o| %> + <p> + <label class="form_label" for="outgoing_message_body">Your request:</label> + <%= o.text_area :body, :rows => 20, :cols => 60 %> + </p> + <% end %> + + <div class="form_button"> + <script type="text/javascript">document.write('<input name="doSpell" type="button" value="Check spelling" onClick="openSpellChecker(document.getElementById(\'write_form\').body);"/> (optional)')</script> + </div> + + <p class="form_note"> + <strong>Privacy warning:</strong> All information that you enter, except + for your email address, will be displayed publically on this website. Any + response you get will also be published. + </p> + + <p class="form_note"> + <strong>Can I request information about myself?</strong> + <a href="/help/about#data_protection">No! (Click here for details)</a> + </p> + + <div class="form_button"> + <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %> + <%= hidden_field_tag(:submitted_new_request, 1 ) %> + <%= hidden_field_tag(:preview, 1 ) %> + <%= submit_tag "Preview your public request" %> + </div> + </div> <% end %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index a8970a242..ae9f2bda2 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -6,6 +6,62 @@ </div> <% end %> +<div id="request_sidebar"> + <h2>People tracking this request</h2> + <% if @info_request.track_things.size > 0 %> + <ul> + <% for track_thing in @info_request.track_things %> + <li><%=user_link(track_thing.tracking_user)%></li> + <% end %> + </ul> + <p> + <% if @existing_track %> + You are already tracking this request + (<%= link_to "alter your subscriptions", user_url(@user) %>). + <% else %> + <% if @info_request.user == @user %> + <p>You will be emailed when there are updates to your own request.</p> + <p>You may also <%= link_to "get an RSS feed", track_request_url(:url_title => @info_request.url_title) %> + <img src="/images/feed-14.png" alt="" class="rss"></p> + <% else %> + <%= link_to "Track updates to this request", track_request_url(:url_title => @info_request.url_title) %> + (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">) + <% end %> + <% end %> + </p> + <% else %> + <% if @info_request.user == @user %> + <p>You will be emailed when there are updates to your own request.</p> + <p>You may also get an <%= link_to 'RSS feed', track_request_url(:url_title => @info_request.url_title) %> + <img src="/images/feed-14.png" alt="" class="rss"></p> + <% else %> + <p>Be the first to <%= link_to "track updates to this request", track_request_url(:url_title => @info_request.url_title) %> + (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)</p> + <% end %> + <% end %> + + <h2>Act on this request</h2> + <p> + <img src="/images/writetothem.png" alt=""> <a href="http://www.writetothem.com">Write to your politician</a> about it + <br><img src="/images/pledgebank.png" alt=""> <a href="http://www.pledgebank.com">Pledge with others</a> + </p> + + <% if @info_requests_same_user_same_body.size > 0 %> + <h2>Requests from same user to same authority</h2> + <!-- <h2>Some other requests made by <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> --> + <%= render :partial => 'sidebar_request_listing', :locals => { :info_requests => @info_requests_same_user_same_body } %> + <% if @info_requests_same_user_same_body_more %> + <p><%= link_to "More such requests", search_url(:query => "variety:sent requested_from:" + @info_request.public_body.url_name + " requested_by:" + @info_request.user.url_name + " -request:" + @info_request.url_title, :sortby => "newest") %></p> + <% end %> + <% end %> + + <!--<h2>Blog posts about this request</h2> + <p>... + <h2>Wikipedia articles</h2> + <p>...--> +</div> + + <div id="request_main"> <h1><%=@title%></h1> @@ -65,60 +121,6 @@ <% end %> </div> -<div id="request_sidebar"> - <h2>People tracking this request</h2> - <% if @info_request.track_things.size > 0 %> - <ul> - <% for track_thing in @info_request.track_things %> - <li><%=user_link(track_thing.tracking_user)%></li> - <% end %> - </ul> - <p> - <% if @existing_track %> - You are already tracking this request - (<%= link_to "alter your subscriptions", user_url(@user) %>). - <% else %> - <% if @info_request.user == @user %> - <p>You will be emailed when there are updates to your own request.</p> - <p>You may also <%= link_to "get an RSS feed", track_request_url(:url_title => @info_request.url_title) %> - <img src="/images/feed-14.png" alt="" class="rss"></p> - <% else %> - <%= link_to "Track updates to this request", track_request_url(:url_title => @info_request.url_title) %> - (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">) - <% end %> - <% end %> - </p> - <% else %> - <% if @info_request.user == @user %> - <p>You will be emailed when there are updates to your own request.</p> - <p>You may also get an <%= link_to 'RSS feed', track_request_url(:url_title => @info_request.url_title) %> - <img src="/images/feed-14.png" alt="" class="rss"></p> - <% else %> - <p>Be the first to <%= link_to "track updates to this request", track_request_url(:url_title => @info_request.url_title) %> - (by email or RSS feed <img src="/images/feed-14.png" alt="" class="rss">)</p> - <% end %> - <% end %> - - <h2>Act on this request</h2> - <p> - <img src="/images/writetothem.png" alt=""> <a href="http://www.writetothem.com">Write to your politician</a> about it - <br><img src="/images/pledgebank.png" alt=""> <a href="http://www.pledgebank.com">Pledge with others</a> - </p> - - <% if @info_requests_same_user_same_body.size > 0 %> - <h2>Requests from same user to same authority</h2> - <!-- <h2>Some other requests made by <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> --> - <%= render :partial => 'sidebar_request_listing', :locals => { :info_requests => @info_requests_same_user_same_body } %> - <% if @info_requests_same_user_same_body_more %> - <p><%= link_to "More such requests", search_url(:query => "variety:sent requested_from:" + @info_request.public_body.url_name + " requested_by:" + @info_request.user.url_name + " -request:" + @info_request.url_title, :sortby => "newest") %></p> - <% end %> - <% end %> - - <!--<h2>Blog posts about this request</h2> - <p>... - <h2>Wikipedia articles</h2> - <p>...--> -</div> <% if @info_request.awaiting_description %> <div class="describe_state_form"> |