diff options
Diffstat (limited to 'app')
31 files changed, 186 insertions, 159 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index 723bc4abb..bba0b6a8d 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -317,8 +317,7 @@ class FoiAttachment < ActiveRecord::Base text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text) html = text.gsub(/\n/, '<br>') - return '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"><html><head><title></title></head><body>' + html + "</body></html>", wrapper_id + return '<!DOCTYPE html><html><head><title></title></head><body>' + html + "</body></html>", wrapper_id end # the extractions will also produce image files, which go in the diff --git a/app/views/admin_general/_admin_navbar.rhtml b/app/views/admin_general/_admin_navbar.rhtml index 49592c545..5cc740f70 100644 --- a/app/views/admin_general/_admin_navbar.rhtml +++ b/app/views/admin_general/_admin_navbar.rhtml @@ -20,5 +20,3 @@ </div> </div> </div> - - diff --git a/app/views/admin_general/admin.coffee b/app/views/admin_general/admin.coffee index 407ef3e3d..8f9e879ae 100644 --- a/app/views/admin_general/admin.coffee +++ b/app/views/admin_general/admin.coffee @@ -13,7 +13,7 @@ jQuery -> info_request_id = $('#hide_request_form').attr('info_request_id') reason = $(this).val() $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]") - $.ajax "<%= Configuration::admin_public_url %>/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, + $.ajax "/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, type: "GET" dataType: "text" error: (data, textStatus, jqXHR) -> diff --git a/app/views/admin_general/admin.js b/app/views/admin_general/admin.js index c4c44dff0..61382dab3 100644 --- a/app/views/admin_general/admin.js +++ b/app/views/admin_general/admin.js @@ -17,7 +17,7 @@ info_request_id = $('#hide_request_form').attr('info_request_id'); reason = $(this).val(); $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]"); - return $.ajax("<%= Configuration::admin_public_url %>/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, { + return $.ajax("/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, { type: "GET", dataType: "text", error: function(data, textStatus, jqXHR) { diff --git a/app/views/admin_general/admin_js.erb b/app/views/admin_general/admin_js.erb index c4c44dff0..61382dab3 100644 --- a/app/views/admin_general/admin_js.erb +++ b/app/views/admin_general/admin_js.erb @@ -17,7 +17,7 @@ info_request_id = $('#hide_request_form').attr('info_request_id'); reason = $(this).val(); $('#request_hidden_user_explanation_field').attr("value", "[loading default text...]"); - return $.ajax("<%= Configuration::admin_public_url %>/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, { + return $.ajax("/hidden_user_explanation?reason=" + reason + "&info_request_id=" + info_request_id, { type: "GET", dataType: "text", error: function(data, textStatus, jqXHR) { diff --git a/app/views/admin_general/index.rhtml b/app/views/admin_general/index.rhtml index a6a768291..db1146302 100644 --- a/app/views/admin_general/index.rhtml +++ b/app/views/admin_general/index.rhtml @@ -16,6 +16,7 @@ </div> </div> +<hr> <div class="row"> <div class="span12"> @@ -63,7 +64,7 @@ <% for @request in @error_message_requests %> <tr> <td class="link"> - <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_url(@request))%> + <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%> <%= link_to(@request.title, request_path(@request)) %> </td> <td class="span2"> @@ -89,7 +90,7 @@ <% for @request in @attention_requests %> <tr> <td class="link"> - <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_url(@request))%> + <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%> <%= link_to(@request.title, request_path(@request)) %> </td> <td class="span2"> @@ -114,7 +115,7 @@ <% for @request in @requires_admin_requests %> <tr> <td class="link"> - <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_url(@request))%> + <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(@request))%> <%= link_to(@request.title, request_path(@request)) %> </td> <td class="span2"> @@ -140,7 +141,7 @@ <tr> <td class="link"> <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_body_show_path(@blank_contact))%> - <%= link_to h(@blank_contact.name), public_body_url(@blank_contact) %> + <%= link_to h(@blank_contact.name), public_body_path(@blank_contact) %> </td> <td class="span2"> <%=simple_date(@blank_contact.updated_at)%> @@ -164,8 +165,8 @@ <% for @request in @old_unclassified %> <tr> <td class="link"> - <%= link_to("<i class='icon-tags'></i>".html_safe, admin_request_show_url(@request)) %> - <%= link_to(@request.title, request_link(@request)) %> + <%= link_to("<i class='icon-tags'></i>".html_safe, admin_request_show_path(@request)) %> + <%= link_to(@request.title, request_path(@request)) %> </td> <td class="span2"> <%=simple_date(@request.get_last_response_event.created_at)%> diff --git a/app/views/admin_general/stats.rhtml b/app/views/admin_general/stats.rhtml index f9163b332..27dc25ee0 100644 --- a/app/views/admin_general/stats.rhtml +++ b/app/views/admin_general/stats.rhtml @@ -1,5 +1,4 @@ <% @title = "Statistics" %> - <div class="hero-unit"> <h2><%=@public_body_count%> public authorities</h2> <h2><%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages, <%=@incoming_message_count%> incoming messages</h2> @@ -11,7 +10,7 @@ <div class="span12"> <h1>Statistics</h1> <h2>Chart of requests (excluding backpaged)</h2> - <img src="/foi-live-creation.png"> + <img src="/foi-live-creation.png" alt="Chart of requests"> </div> </div> <div class="row"> @@ -34,7 +33,7 @@ <div class="row"> <div class="span12"> <h2>Chart of users</h2> - <img src="/foi-user-use.png"> + <img src="/foi-user-use.png" alt="Chart of users"> </div> </div> <div class="row"> diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.rhtml index 9b9b39646..6f153504e 100644 --- a/app/views/admin_general/timeline.rhtml +++ b/app/views/admin_general/timeline.rhtml @@ -31,7 +31,7 @@ <%= simple_time(event_at) %> <% if event.is_a? InfoRequestEvent %> - <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_url(event.info_request), :title => "view full details")%> + <%= link_to('<i class="icon-tags"></i>'.html_safe, admin_request_show_path(event.info_request), :title => "view full details")%> <%= link_to(event.info_request.title, request_path(event.info_request), :title => "view request on public website")%> <% if event.event_type == 'edit' %> diff --git a/app/views/admin_public_body/_one_list.rhtml b/app/views/admin_public_body/_one_list.rhtml index cf1866212..c867433a0 100644 --- a/app/views/admin_public_body/_one_list.rhtml +++ b/app/views/admin_public_body/_one_list.rhtml @@ -2,31 +2,30 @@ <% for public_body in bodies %> <div class="accordion-group"> <div class="accordion-heading accordion-toggle row"> - <span class="item-title span6"> - <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><i class="icon-chevron-right"></i></a> - <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%> - </span> - <span class="item-metadata span6"> - <%= render :partial => 'tags', :locals => { :body => public_body} %> - </span> + <span class="item-title span6"> + <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><i class="icon-chevron-right"></i></a> + <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%> + </span> + <span class="item-metadata span6"> + <%= render :partial => 'tags', :locals => { :body => public_body} %> + </span> </div> <div id="body_<%=public_body.id%>" class="item-detail accordion-body collapse row"> - - <% public_body.for_admin_column do |name, value, type| %> - <div> - <span class="span6"> - <b><%=name%></b> - </span> - <span class="span6"> - <% if type == 'datetime' %> - <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> - (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) - <% else %> - <%= h value %> - <% end %> - </span> + <% public_body.for_admin_column do |name, value, type| %> + <div> + <span class="span6"> + <b><%=name%></b> + </span> + <span class="span6"> + <% if type == 'datetime' %> + <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> + (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) + <% else %> + <%= h value %> + <% end %> + </span> </div> - <% end %> + <% end %> </div> </div> <% end %> @@ -41,6 +40,5 @@ <%= submit_tag "Add tag to all", :class => "btn btn-primary" %> (in table just above) </p> - <% end %> diff --git a/app/views/admin_public_body/_tags.rhtml b/app/views/admin_public_body/_tags.rhtml index 55c9db906..26526f304 100644 --- a/app/views/admin_public_body/_tags.rhtml +++ b/app/views/admin_public_body/_tags.rhtml @@ -5,6 +5,7 @@ <% else %> <%= link_to(h(t.name), list_public_bodies_path(:tag => t.name)) %> <% end %> + </span> <% end %> diff --git a/app/views/admin_public_body/list.rhtml b/app/views/admin_public_body/list.rhtml index 41c2ac119..acc05f50d 100644 --- a/app/views/admin_public_body/list.rhtml +++ b/app/views/admin_public_body/list.rhtml @@ -14,9 +14,8 @@ <%= link_to 'Import from CSV file', admin_body_import_csv_path, :class => "btn btn-warning" %> </div> </div> -</p> -<% form_tag("", :method => "get", :class => "form form-search") do %> +<% form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %> <%= submit_tag "Search", :class => "btn" %> <% if !@query.nil? %> diff --git a/app/views/admin_request/_incoming_message_actions.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml index 0fcf69111..84c29dcc3 100644 --- a/app/views/admin_request/_incoming_message_actions.rhtml +++ b/app/views/admin_request/_incoming_message_actions.rhtml @@ -1,33 +1,33 @@ -<formset class="form-horizontal"> +<fieldset class="form-horizontal"> <legend>Actions</legend> <% form_tag admin_request_redeliver_incoming_path, :class => "form form-inline" do %> <div class="control-group"> - <label class="control-label" for="url_title">Redeliver message to one or more other requests</label> + <label class="control-label" for="url_title_<%= incoming_message.id %>">Redeliver message to one or more other requests</label> <div class="controls"> <% if @info_requests && @info_requests.size == 1 %> - <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %> + <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20, :id => "url_title_#{incoming_message.id}" } %> <% else %> - <%= text_field_tag 'url_title', "", { :size => 20 } %> + <%= text_field_tag 'url_title', "", { :size => 20, :id => "url_title_#{incoming_message.id}" } %> <% end %> - <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %> + <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id, :id => nil %> <%= submit_tag "Redeliver to another request", :class => "btn" %> <p class="help-block"><code>id</code> or <code>url_title</code>; you can supply more than one, separated by commas</p> </div> </div> <% end %> <div class="control-group"> - <label class="control-label" for="generate_upload_url">Generate FOI officer upload URL</label> + <label class="control-label">Generate FOI officer upload URL</label> <div class="controls"> - <%= link_to 'Generate and take me there', admin_request_generate_upload_url_path(incoming_message.info_request, :incoming_message_id => incoming_message.id), :class => "btn", :id => "generate_upload_url" %> + <%= link_to 'Generate and take me there', admin_request_generate_upload_url_path(incoming_message.info_request, :incoming_message_id => incoming_message.id), :class => "btn" %> </div> </div> <% form_tag admin_request_destroy_incoming_path, :class => "form form-inline" do %> <div class="control-group"> - <label class="control-label" for="generate_upload_url">Destroy message</label> + <label class="control-label" for="destroy_message_<%= incoming_message.id %>">Destroy message</label> <div class="controls"> - <%= hidden_field_tag 'incoming_message_id', incoming_message.id %> - <%= submit_tag "Destroy message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?" %> + <%= hidden_field_tag 'incoming_message_id', incoming_message.id, :id => nil %> + <%= submit_tag "Destroy message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?", :id => "destroy_message_#{incoming_message.id}" %> </div> </div> <% end %> @@ -35,11 +35,11 @@ <% if @raw_email.nil? %> <%# we're not on the raw_email page itself %> <div class="control-group"> - <label class="control-label" for="show_rail_email">Inspect email</label> + <label class="control-label">Inspect email</label> <div class="controls"> - <%= link_to "View raw email", admin_request_show_raw_email_path(incoming_message.raw_email_id), :class => "btn", :id => "show_raw_email" %> + <%= link_to "View raw email", admin_request_show_raw_email_path(incoming_message.raw_email_id), :class => "btn" %> </div> </div> <% end %> -</formset> +</fieldset> diff --git a/app/views/admin_request/_some_requests.rhtml b/app/views/admin_request/_some_requests.rhtml index 50da67c86..03a77dd0b 100644 --- a/app/views/admin_request/_some_requests.rhtml +++ b/app/views/admin_request/_some_requests.rhtml @@ -4,7 +4,7 @@ <div class="accordion-heading accordion-toggle row"> <span class="item-title span6"> <a href="#request_<%=info_request.id%>" data-toggle="collapse" data-parent="requests"><i class="icon-chevron-right"></i></a> - <%= link_to(info_request.title, admin_request_show_url(info_request), :title => "view full details") %> + <%= link_to(info_request.title, admin_request_show_path(info_request), :title => "view full details") %> </span> <span class="item-metadata span6"> <%= user_admin_link_for_request(info_request) %> <i class="icon-arrow-right"></i> <%= link_to("#{info_request.public_body.name}", admin_body_show_path(info_request.public_body)) %>, <%= time_ago_in_words(info_request.updated_at) %> ago diff --git a/app/views/admin_request/list.rhtml b/app/views/admin_request/list.rhtml index ff67dd843..10b39d3a2 100644 --- a/app/views/admin_request/list.rhtml +++ b/app/views/admin_request/list.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<% form_tag("", :method => "get", :class => "form form-search") do %> +<% form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %> <%= submit_tag "Search", :class => "btn" %> (substring search, titles only) <% end %> diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index f987921e7..04695a761 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -26,45 +26,45 @@ <td><%= link_to request_url(@info_request), request_path(@info_request) %></td> </tr> <% @info_request.for_admin_column do |name, value, type, column_name|%> + <tr> + <td> + <b><%= name %>:</b> + </td> + <td> + <% if type == 'datetime' %> + <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> + (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) + <% else %> + <%= h value %> + <% end %> + <% if column_name == 'described_state' %> + <ul> + <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li> + <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li> + <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li> + <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li> + </ul> + <% end %> + </td> + </tr> + <% end %> <tr> <td> - <b><%= name %>:</b> + <b>Created by</b> </td> <td> - <% if type == 'datetime' %> - <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %> - (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>) + <% if @info_request.is_external? %> + <%= link_to("<i class='icon-eye-open'></i>".html_safe, @info_request.external_url, :title => "view URL of original request on external website") %> + <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API) <% else %> - <%= h value %> - <% end %> - <% if column_name == 'described_state' %> - <ul> - <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %> - <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %> - <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %> - <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %> - </ul> - <% end %> - </td> - </tr> - <% end %> - <tr> - <td> - <b>Created by</b> - </td> - <td> - <% if @info_request.is_external? %> - <%= link_to("<i class='icon-eye-open'></i>".html_safe, @info_request.external_url, :title => "view URL of original request on external website") %> - <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API) - <% else %> - <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_url(@info_request.user), :title => "view user's page on public website") %> - <%= user_admin_link_for_request(@info_request) %> - <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %> - <div style="display:none;"> - <strong>url_name of new user:</strong> - <%= text_field_tag 'user_url_name', "", { :size => 20 } %> - <%= submit_tag "Move request to user", :class => "btn btn-info" %> - </div> + <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_path(@info_request.user), :title => "view user's page on public website") %> + <%= user_admin_link_for_request(@info_request) %> + <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %> + <div style="display:none;"> + <strong>url_name of new user:</strong> + <%= text_field_tag 'user_url_name', "", { :size => 20 } %> + <%= submit_tag "Move request to user", :class => "btn btn-info" %> + </div> <% end %> </td> @@ -111,9 +111,8 @@ </table> </div> </div> -</div> <% end %> -<formset class="form-horizontal"> +<fieldset class="form-horizontal"> <legend>Actions</legend> <div class="control-group"> <label class="control-label"> @@ -124,15 +123,15 @@ <p class="help-block">(see also option to general URLs for individual incoming messages below)</p> </div> </div> - <% form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :info_request_id => @info_request.id.to_s, :id => "hide_request_form" do %> + <% form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form" do %> <div class="control-group"> - <% if @info_request.is_external? %> - <label class="control-label">Hide the request:</label> - <% else %> - <label class="control-label">Hide the request and notify the user:</label> - <% end %> + <% if @info_request.is_external? %> + <label class="control-label">Hide the request:</label> + <% else %> + <label class="control-label">Hide the request and notify the user:</label> + <% end %> - <div class="controls" id="request_hidden_user_explanation_reasons"> + <div class="controls" id="request_hidden_user_explanation_reasons"> <% if ['hidden', 'requester_only'].include? @info_request.prominence %> <p class="help-block">This request has already been hidden</p> <% else %> @@ -147,29 +146,29 @@ </div> <% if !['hidden', 'requester_only'].include? @info_request.prominence %> - <% if ! @info_request.is_external? %> + <% if ! @info_request.is_external? %> - <div class="control-group" id="request_hidden_user_subject"> - <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label> - <div class="controls"> - <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %> - </div> + <div class="control-group" id="request_hidden_user_subject"> + <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label> + <div class="controls"> + <%= text_field_tag "subject", "Your request on WhatDoTheyKnow.com hidden", {:id => "request_hidden_user_subject_field", :cols => 100} %> </div> + </div> - <div class="control-group" id="request_hidden_user_explanation"> - <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label> - <div class="controls"> - <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %> - </div> + <div class="control-group" id="request_hidden_user_explanation"> + <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label> + <div class="controls"> + <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %> </div> + </div> - <% end %> + <% end %> <div class="form-actions" id="request_hide_button"> <%= submit_tag _("Hide request"), :class => "btn" %> </div> <% end %> <% end %> -</formset> +</fieldset> <hr> <h2>Events</h2> @@ -195,7 +194,7 @@ <td> <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %> <% form_tag admin_request_clarification_path, :class => "form form-inline admin-table-form admin-inline-form" do %> - <%= hidden_field_tag 'info_request_event_id', info_request_event.id %> + <%= hidden_field_tag 'info_request_event_id', info_request_event.id, :id => nil %> <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %> <% end %> <% end %> @@ -344,9 +343,9 @@ <tbody> <tr> <td colspan="2"> - By <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_url(comment.user), :title => "view user's page on public website") %> + By <%= link_to("<i class='icon-eye-open'></i>".html_safe, user_path(comment.user), :title => "view user's page on public website") %> - <%= link_to(h(comment.user.name), admin_user_show_url(comment.user)) %> + <%= link_to(h(comment.user.name), admin_user_show_path(comment.user)) %> </td> </tr> <% comment.for_admin_column do |name, value, type, column_name |%> diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml index e8cc6471f..72c782ad6 100644 --- a/app/views/admin_request/show_raw_email.rhtml +++ b/app/views/admin_request/show_raw_email.rhtml @@ -1,24 +1,56 @@ -<% @title = 'Incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %> +<% @title = "Incoming message #{@raw_email.incoming_message.id} of FOI request '#{@raw_email.incoming_message.info_request.title}'" %> -<h1>Incoming message <%=@raw_email.incoming_message.id.to_s %></h1> +<h1>Incoming message <%=@raw_email.incoming_message.id %></h1> <p> FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %> - <% if @holding_pen %> + <% if @holding_pen %> <br>This is in the holding pen because: <strong><%= @rejected_reason %></strong> <% if @public_bodies.size > 0 %> <br>Guessed authority: - <% for public_body in @public_bodies %> - <%=public_body_both_links(public_body)%> + <% @public_bodies.each do |public_body| %> + <%=public_body_both_links(public_body)%> <% end %> (based on From: email domain) <% end %> <% if @info_requests.size > 0 %> - <br>Guessed request: - <% for info_request in @info_requests %> - <%=request_both_links(info_request)%> - <% end %> - (based on id, not hash, in To/Cc email) + <div class="accordion" id="guessed-requests"> + Guessed request: + <% @info_requests.each do |info_request| %> + <div class="accordion-group"> + <div class="accordion-heading"> + <a href="#info_request_<%= info_request.id %>" data-toggle="collapse"><i class="icon-chevron-right"></i></a> + <%=request_both_links(info_request)%> + </div> + <div class="accordion-body collapse" id="info_request_<%= info_request.id %>"> + <table class="table table-striped table-condensed"> + <tr> + <td><strong>Last outgoing message:</strong></td> + <td><%= info_request.outgoing_messages.last.body %></td> + </tr> + <tr> + <td><strong>Created by:</strong></td> + <td><%= user_admin_link_for_request(info_request) %></td> + </tr> + <tr> + <td><strong>Authority:</strong></td> + <td> + <%= link_to(info_request.public_body.name, admin_body_show_path(info_request.public_body)) %> + </td> + </tr> + <tr> + <td><strong>url_title:</strong></td> + <td><%= info_request.url_title %></td> + </tr> + </table> + <p> + This request was guessed because it has an incoming email address of <strong><%= info_request.incoming_email %></strong> and this incoming message was sent to <strong><%= @raw_email.incoming_message.mail.to %></strong>. + </p> + </div> + </div> + <% end %> + (based on id, not hash, in To/Cc email) + </div> <% end %> <% end %> </p> diff --git a/app/views/admin_track/_some_tracks.rhtml b/app/views/admin_track/_some_tracks.rhtml index 01eadca4d..68ebf7dd6 100644 --- a/app/views/admin_track/_some_tracks.rhtml +++ b/app/views/admin_track/_some_tracks.rhtml @@ -23,7 +23,7 @@ <% end %> <% if @admin_user.nil? %> <%# Do not show this on the list of tracks on the user page, because it’s rather repetitive there %> - tracked by <%=link_to '<i class="icon-eye-open"></i>'.html_safe, admin_user_show_url(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), user_path(track_thing.tracking_user) %> + tracked by <%=link_to '<i class="icon-eye-open"></i>'.html_safe, admin_user_show_path(track_thing.tracking_user) %> <%=link_to h(track_thing.tracking_user.name), user_path(track_thing.tracking_user) %> <% end %> </div> <div id="track_<%=track_thing.id%>" class="accordion-body collapse"> @@ -52,7 +52,7 @@ <%= I18n.l(track_thing.send(column.name), :format => "%e %B %Y %H:%M:%S") %> (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(track_thing.send(column.name))) %>) <% elsif column.name == 'track_medium' and track_thing.track_medium == 'feed' %> - <%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %> + <%= link_to track_thing.track_medium, atom_feed_path(:track_id => track_thing.id) %> <% else %> <%= h track_thing.send(column.name)%> <% end %> diff --git a/app/views/admin_track/list.rhtml b/app/views/admin_track/list.rhtml index 2c9ee9ed7..9cff5635b 100644 --- a/app/views/admin_track/list.rhtml +++ b/app/views/admin_track/list.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<% form_tag("", :method => "get", :class => "form form-search") do %> +<% form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %> <%= submit_tag "Search", :class => "btn" %> (substring search the query – so use url_names_for_a_particular_request_or_authority_or_person) <% end %> @@ -14,7 +14,7 @@ <h2>Current top tracks:</h2> <ol> <% for row in @popular %> - <li><%= link_to row['title'], admin_request_show_url(row['info_request_id']) %> (<%= row['count'] %> people following)</li> + <li><%= link_to row['title'], admin_request_show_path(row['info_request_id']) %> (<%= row['count'] %> people following)</li> <% end %> </ol> diff --git a/app/views/admin_user/list.rhtml b/app/views/admin_user/list.rhtml index 789b67fb1..23f75c159 100644 --- a/app/views/admin_user/list.rhtml +++ b/app/views/admin_user/list.rhtml @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<% form_tag("", :method => "get", :class => "form form-search") do %> +<% form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %> <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails) <%= link_to 'Banned users', admin_user_list_banned_path, :class => "btn btn-info" %> diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml index a900d4502..279758f03 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -10,7 +10,6 @@ <%= submit_tag "Clear photo", :class => "btn btn-info" %> <% end %> </div> - <% end %> <table class="table table-striped table-condensed"> diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml index aa5b6051c..578732cdb 100644 --- a/app/views/comment/new.rhtml +++ b/app/views/comment/new.rhtml @@ -67,10 +67,10 @@ </ul> <p> - <big><%= _('Annotations will be posted publicly here, and are - <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></big> + <span class="big"><%= _('Annotations will be posted publicly here, and are + <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></span> <% if @info_request.is_external? %> - <big><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></big> + <span class="big"><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></span> <% end %> </p> diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index 07d6d2f14..d42b32282 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -5,7 +5,7 @@ <div class="act_link"> <h2><%= _("Stay up to date") %></h2> <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> - <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> + <img src="/images/feed-16.png" alt="RSS icon"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> </div> <% if Configuration::twitter_widget_id %> <div id="twitter"> diff --git a/app/views/help/api.rhtml b/app/views/help/api.rhtml index 3a6c867ee..57390d65a 100644 --- a/app/views/help/api.rhtml +++ b/app/views/help/api.rhtml @@ -30,15 +30,15 @@ </ul> </dd> - <dt>RSS (actually, Atom) feeds</h2> + <dt>RSS (actually, Atom) feeds</dt> <dd> <p>There are Atom feeds on most pages which list FOI requests, which you can use to get updates and links in XML format. Find the URL of the Atom feed in one of these ways: <ul> <li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li> - <li>Examine the <tt><link rel="alternate" type="application/atom+xml"></tt> tag in the head of the HTML. </li> - <li>Add <tt>/feed</tt> to the start of another URL. + <li>Examine the <code><link rel="alternate" type="application/atom+xml"></code> tag in the head of the HTML. </li> + <li>Add <code>/feed</code> to the start of another URL. </ul> <p>In particular, even complicated search queries have Atom feeds. @@ -53,8 +53,8 @@ objects in a structured form. Find them by: </p> <ul> - <li>Adding <tt>.json</tt> to the end of the URL. </li> - <li>Look for the <tt><link rel="alternate" type="application/json"></tt> tag in the head of the HTML. </li> + <li>Adding <code>.json</code> to the end of the URL. </li> + <li>Look for the <code><link rel="alternate" type="application/json"></code> tag in the head of the HTML. </li> </ul> <p>Requests, users and authorities all have JSON versions containing basic diff --git a/app/views/help/officers.rhtml b/app/views/help/officers.rhtml index b13e225fe..6db706f78 100644 --- a/app/views/help/officers.rhtml +++ b/app/views/help/officers.rhtml @@ -222,7 +222,7 @@ form in an annotation. </dd> - <dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt> + <dt id="copyright"><a id="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt> <dd>Our Freedom of Information law is "applicant blind", so anyone in the world can request the same document and get a copy of it. @@ -235,9 +235,6 @@ </dl> - - </dl> - <p><strong>If you haven't already</strong>, read <a href="<%= help_about_path %>">the introduction</a> --> <br><strong>Otherwise</strong>, the <a href="<%= help_credits_path %>">credits</a> or the <a href="<%= help_api_path %>">programmers API</a> --> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 447b24537..a58913892 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<!DOCTYPE html> <html lang="en-gb"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" > diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 1e6a61f58..a66b85e02 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -1,6 +1,7 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<!DOCTYPE html> <html lang="<%= I18n.locale %>"> <head> + <meta charset="utf-8"> <title> <% if @title %> <%=@title%> - <%= site_name %> diff --git a/app/views/layouts/no_chrome.rhtml b/app/views/layouts/no_chrome.rhtml index 74c79b701..120ba6f28 100644 --- a/app/views/layouts/no_chrome.rhtml +++ b/app/views/layouts/no_chrome.rhtml @@ -1,6 +1,7 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> +<!DOCTYPE html> <html lang="<%= I18n.locale %>"> <head> + <meta charset="utf-8"> <title> <% if @title %> <%=@title%> - <%= site_name %> diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 5b6004e81..fde1cdfa7 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -3,7 +3,7 @@ <% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %> <h2><%= _('What best describes the status of this request now?') %></h2> - <hr> <!------------------------------------------------> + <hr> <h3><%= _('This request is still in progress:') %></h3> <% if @info_request.described_state != 'internal_review' %> <div> @@ -40,7 +40,7 @@ <%= render :partial => 'general/custom_state_transitions_pending', :locals => {:id_suffix => id_suffix } %> - <hr> <!------------------------------------------------> + <hr> <h3><%= _('This particular request is finished:') %></h3> <% if @info_request.described_state == 'internal_review' %> @@ -67,7 +67,7 @@ <%= render :partial => 'general/custom_state_transitions_complete', :locals => {:id_suffix => id_suffix } %> - <hr> <!------------------------------------------------> + <hr> <h3><%= _('Other:') %></h3> <div> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 94588c15b..af33d31a2 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -31,17 +31,20 @@ <h2><%= _("Act on what you've learnt") %></h2> <div class="act_link"> - <% tweet_link = "https://twitter.com/share?url=#{h(request.url)}&via=#{h(Configuration::twitter_username)}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %> - <% link_to tweet_link do %> + <% + # Cast "related" to normal string because html safe string (from rails_xss gem) and CGI::escape + # interact badly with ':' character. Go figure! Might go away in rails 3 + %> + <% link_to "https://twitter.com/share?" + {:url => request.url, :via => Configuration::twitter_username, :text => @info_request.title, :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name).to_str}.to_query do %> <%= image_tag "twitter-16.png", :alt => "twitter icon" %> + <%= _("Tweet this request") %> <% end %> - <%= link_to _("Tweet this request"), tweet_link %> </div> <div class="act_link"> <% link_to "http://wordpress.com/" do %> <%= image_tag "wordpress.png", :class => "rss" %> + <%= _("Start your own blog") %> <% end %> - <%= link_to _("Start your own blog"), "http://wordpress.com/"%> </div> <%= render :partial => 'request/next_actions' %> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index d25da8141..4766c981b 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -37,7 +37,7 @@ <div id="request_header"> <div id="request_header_body"> - <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label> + <label class="form_label"><%= _('To:') %></label> <span id="to_public_body"><%=h(@info_request.public_body.name)%></span> <div class="form_item_note"> <% if @info_request.public_body.info_requests.size > 0 %> diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml index 913423ffa..89ab19b7e 100644 --- a/app/views/user/_signup.rhtml +++ b/app/views/user/_signup.rhtml @@ -16,7 +16,7 @@ <p> <label class="form_label" for="user_signup_name"> <%= _('Your name:')%></label> - <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70 } %> + <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70, :autocomplete => "off" } %> </p> <div class="form_item_note"> <%= raw(_('Your <strong>name will appear publicly</strong> @@ -28,12 +28,12 @@ <p> <label class="form_label" for="user_signup_password"> <%= _('Password:')%></label> - <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80 } %> + <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80, :autocomplete => "off" } %> </p> <p> <label class="form_label" for="user_signup_password_confirmation"> <%= _('Password: (again)')%></label> - <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90 } %> + <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90, :autocomplete => "off" } %> </p> <% if @request_from_foreign_country %> |