aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_request/show_raw_email.rhtml2
-rw-r--r--app/views/general/_localised_datepicker.rhtml10
-rw-r--r--app/views/public_body/view_email.rhtml4
-rw-r--r--app/views/request/_followup.rhtml23
-rw-r--r--app/views/request/_sidebar.rhtml2
-rw-r--r--app/views/request/_wall_listing.rhtml10
-rw-r--r--app/views/request/upload_response.rhtml6
-rw-r--r--app/views/track/atom_feed.atom.builder25
-rw-r--r--app/views/track/atom_feed.atom.erb30
9 files changed, 61 insertions, 51 deletions
diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml
index fa1470e77..ea0d6017e 100644
--- a/app/views/admin_request/show_raw_email.rhtml
+++ b/app/views/admin_request/show_raw_email.rhtml
@@ -33,5 +33,5 @@
<p><%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %></p>
-<pre><%=h(@raw_email.data).gsub(/\n/, '<br>') %></pre>
+<pre><%= h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre>
diff --git a/app/views/general/_localised_datepicker.rhtml b/app/views/general/_localised_datepicker.rhtml
index 5fdd63644..ec6593ea0 100644
--- a/app/views/general/_localised_datepicker.rhtml
+++ b/app/views/general/_localised_datepicker.rhtml
@@ -5,11 +5,11 @@
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
- monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
- monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
- dayNames: <%= I18n.translate('date.day_names').to_json %>,
- dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
- dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
+ monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>,
+ monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
+ dayNames: <%= raw I18n.translate('date.day_names').to_json %>,
+ dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>,
+ dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
diff --git a/app/views/public_body/view_email.rhtml b/app/views/public_body/view_email.rhtml
index 50601069f..79d7f7f4c 100644
--- a/app/views/public_body/view_email.rhtml
+++ b/app/views/public_body/view_email.rhtml
@@ -25,9 +25,9 @@
<p>
<% if @public_body.is_requestable? || @public_body.not_requestable_reason != 'bad_contact' %>
- <%= _('If the address is wrong, or you know a better address, please <a href="%s">contact us</a>.')% [help_contact_path]%>
+ <%= raw _('If the address is wrong, or you know a better address, please <a href="%s">contact us</a>.')% [help_contact_path]%>
<% else %>
- <%= _(' If you know the address to use, then please <a href="%s">send it to us</a>.
+ <%= raw _(' If you know the address to use, then please <a href="%s">send it to us</a>.
You may be able to find the address on their website, or by phoning them up and asking.')% [help_contact_path] %>
<% end %>
</p>
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml
index 451932b8d..045bcd9ba 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.rhtml
@@ -1,5 +1,10 @@
<div id="followup">
<% if (incoming_message.nil? || !incoming_message.valid_to_reply_to?)
+ # TRANSLATORS: This phrase completes the following sentences:
+ # Request an internal review from...
+ # Send a public follow up message to...
+ # Send a public reply to...
+ # Don't want to address your message to... ?
name_for_followup = _("the main FOI contact at {{public_body}}", :public_body => h(OutgoingMailer.name_for_followup(@info_request, nil)))
else
name_for_followup = h(OutgoingMailer.name_for_followup(@info_request, incoming_message))
@@ -8,16 +13,16 @@
<h1><%= _('Request an internal review from {{person_or_body}}', :person_or_body => name_for_followup) %>
</h1>
<% elsif incoming_message.nil? || !incoming_message.valid_to_reply_to? %>
- <h2><%= _('Send a public follow up message to {{person_or_body}}', :person_or_body => name_for_followup) %>
+ <h2><%= _('Send a public follow up message to {{person_or_body}}', :person_or_body => name_for_followup) %>
</h2>
<% else %>
- <h2><%= _('Send a public reply to {{person_or_body}}', :person_or_body => name_for_followup) %>
+ <h2><%= _('Send a public reply to {{person_or_body}}', :person_or_body => name_for_followup) %>
</h2>
<% end %>
<% if @info_request.who_can_followup_to(incoming_message).count > 0 %>
<div id="other_recipients">
- <%= _("Don't want to address your message to {{person_or_body}}? You can also write to:", :person_or_body => name_for_followup) %>
- <ul>
+ <%= _("Don't want to address your message to {{person_or_body}}? You can also write to:", :person_or_body => name_for_followup) %>
+ <ul>
<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %>
<% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>
<li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
@@ -51,7 +56,7 @@
<% end %>
<p>
- <%= _('Please <strong>only</strong> write messages directly relating to your request {{request_link}}. If you would like to ask for information that was not in your original request, then <a href="{{new_request_link}}">file a new request</a>.', :request_link=>request_link(@info_request), :new_request_link => new_request_to_body_url(:url_name => @info_request.public_body.url_name)) %>
+ <%= _('Please <strong>only</strong> write messages directly relating to your request {{request_link}}. If you would like to ask for information that was not in your original request, then <a href="{{new_request_link}}">file a new request</a>.', :request_link=>request_link(@info_request), :new_request_link => new_request_to_body_url(:url_name => @info_request.public_body.url_name)) %>
</p>
<% status = @info_request.calculate_status %>
@@ -60,11 +65,11 @@
by law, the authority should normally have responded
<strong>promptly</strong> and') %>
<% if @info_request.public_body.is_school? %>
- <%= _('in term time') %>
+ <%= _('in term time') %>
<% end %>
<%= _('by <strong>{{date}}</strong>',:date=>simple_date(@info_request.date_response_required_by)) %>
(<%= raw(_('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"]) %>).
-
+
</p>
<% elsif status == 'waiting_response_very_overdue' %>
<p>
@@ -97,8 +102,8 @@
-->
<div>
<%= radio_button "outgoing_message", "what_doing", "internal_review", :id => "internal_review" %>
- <label for="internal_review"><%= _('I am requesting an <strong>internal review</strong>') %>
- <%= raw(_('<a href="%s">what\'s that?</a>') % ["/help/unhappy"]) %>
+ <label for="internal_review"><%= _('I am requesting an <strong>internal review</strong>') %>
+ <%= raw(_('<a href="%s">what\'s that?</a>') % ["/help/unhappy"]) %>
</label>
</div>
<div>
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index 5e0c6fd2d..884d4b2b1 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -4,7 +4,7 @@
<% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>
<p><%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %></p>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>
+ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user && @info_request.user == @user, :location => 'sidebar' } %>
</div>
<% if @info_request.described_state != "attention_requested" %>
<h2><%= _('Offensive? Unsuitable?') %></h2>
diff --git a/app/views/request/_wall_listing.rhtml b/app/views/request/_wall_listing.rhtml
index 9cde234c0..26d34e1a1 100644
--- a/app/views/request/_wall_listing.rhtml
+++ b/app/views/request/_wall_listing.rhtml
@@ -6,13 +6,13 @@ end %>
<div class="request_left">
<div class="requester">
<% if event.event_type == 'sent' %>
- <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at),:request_url=>request_url(info_request),:request_title=>info_request.title) %>
+ <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>request_url(info_request),:request_title=>info_request.title) %>
<% elsif event.event_type == 'followup_sent' %>
- <%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at),:request_url=>outgoing_message_url(event.outgoing_message),:request_title=>info_request.title) %>
+ <%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>outgoing_message_url(event.outgoing_message),:request_title=>info_request.title) %>
<% elsif event.event_type == 'response' %>
- <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at),:request_url=>incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
+ <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
<% elsif event.event_type == 'comment' %>
- <%= _('An <a href="{{request_url}}">annotation</a> to <em>{{request_title}}</em> was made by {{event_comment_user}} on {{date}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at),:request_url=>comment_url(event.comment),:request_title=>info_request.title) %>
+ <%= _('An <a href="{{request_url}}">annotation</a> to <em>{{request_title}}</em> was made by {{event_comment_user}} on {{date}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at),:request_url=>comment_url(event.comment),:request_title=>info_request.title) %>
<% else %>
<%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
However, it can happen that we see other types of event transiently here in the period
@@ -22,7 +22,7 @@ end %>
</div>
</div>
<div class="request_right">
- <span class="desc">
+ <span class="desc">
<%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
</span>
</div>
diff --git a/app/views/request/upload_response.rhtml b/app/views/request/upload_response.rhtml
index bc129426d..675951595 100644
--- a/app/views/request/upload_response.rhtml
+++ b/app/views/request/upload_response.rhtml
@@ -12,7 +12,7 @@
<h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1>
<p>
- <%= _('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.')% [help_officers_path] %>
+ <%= raw(_('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.') % [help_officers_path]) %>
</p>
<h2><%= _('Respond by email')%></h2>
@@ -27,8 +27,8 @@
<h2><%= _('Respond using the web')%></h2>
- <p><%= _('Enter your response below. You may attach one file (use email, or
- <a href="%s">contact us</a> if you need more).')% [help_contact_path] %></p>
+ <p><%= raw(_('Enter your response below. You may attach one file (use email, or
+ <a href="%s">contact us</a> if you need more).')% [help_contact_path]) %></p>
<% form_tag '', :id => 'upload_response_form', :multipart => true do %>
<p>
diff --git a/app/views/track/atom_feed.atom.builder b/app/views/track/atom_feed.atom.builder
deleted file mode 100644
index d1e9310b8..000000000
--- a/app/views/track/atom_feed.atom.builder
+++ /dev/null
@@ -1,25 +0,0 @@
-atom_feed do |feed|
- feed.title(@track_thing.params[:title_in_rss])
- @highlight_words = @xapian_object.words_to_highlight
-
- for result in @xapian_object.results
- feed.entry(result[:model]) do |entry|
- # Get the HTML content from the same partial template as website search does
- content = ''
- if result[:model].class.to_s == 'InfoRequestEvent'
- content += render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request }
- else
- content = "<p><strong>Unknown search result type " + result[:model].class.to_s + "</strong></p>"
- end
- # Pull out the heading as separate item, from the partial template
- content.match(/(<span class="head">\s+<a href="[^>]*">(.*)<\/a>\s+<\/span>)/)
- heading = $1
- heading_text = $2
- content.sub!(heading, "")
- # Render the atom
- entry.title(heading_text, :type => 'html')
- entry.content(content, :type => 'html')
- end
- end
-end
-
diff --git a/app/views/track/atom_feed.atom.erb b/app/views/track/atom_feed.atom.erb
new file mode 100644
index 000000000..23c932308
--- /dev/null
+++ b/app/views/track/atom_feed.atom.erb
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
+ <id>tag:<%= request.host %>,2005:<%= request.fullpath.split(".")[0] %></id>
+ <link type="text/html" rel="alternate" href="<%= request.protocol + request.host_with_port %>"/>
+ <link type="application/atom+xml" rel="self" href="<%= request.url %>"/>
+ <title><%= @track_thing.params[:title_in_rss] %></title>
+ <% @xapian_object.results.each do |result| %>
+ <%
+ # Get the HTML content from the same partial template as website search does
+ content = ''
+ if result[:model].class.to_s == 'InfoRequestEvent'
+ content += render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request }
+ else
+ content = "<p><strong>Unknown search result type " + result[:model].class.to_s + "</strong></p>"
+ end
+ # Pull out the heading as separate item, from the partial template
+ content.match(/(<span class="head">\s+<a href="[^>]*">(.*)<\/a>\s+<\/span>)/)
+ heading = $1
+ heading_text = $2
+ content.sub!(heading, "")
+ %>
+ <entry>
+ <id>tag:<%= request.host %>,2005:<%= result[:model].class %>/<%= result[:model].id %></id>
+ <published><%= result[:model].created_at.xmlschema %></published>
+ <link type="text/html" rel="alternate" href="<%= polymorphic_url(result[:model]) %>"/>
+ <title type="html"><%= heading_text %></title>
+ <content type="html"><%= content %></content>
+ </entry>
+ <% end %>
+</feed>