diff options
Diffstat (limited to 'app/views')
36 files changed, 407 insertions, 188 deletions
diff --git a/app/views/admin_public_body/import_csv.html.erb b/app/views/admin_public_body/import_csv.html.erb index 18341ecf1..d15ef1791 100644 --- a/app/views/admin_public_body/import_csv.html.erb +++ b/app/views/admin_public_body/import_csv.html.erb @@ -36,23 +36,35 @@ %> </p> - <p><strong>CSV file format:</strong>The first row should be a list - of fields, starting with '#'. The fields 'name' and - 'request_email' are required; additionally, translated values are + <p><strong>CSV file format:</strong> The first row should be a list + of fields, starting with <code>#</code>. The fields <code>name</code> and + <code>request_email</code> are required; additionally, translated values are supported by adding the locale name to the field name, - e.g. 'name.es', 'name.de'... Example: + e.g. <code>name.es</code>, <code>name.de</code>…<br /> + <strong>Example:</strong> </p> - <blockquote> - <p> - #id,name,request_email,name.es,tag_string<br/> - 1,An Authority,a@example.com,Un organismo,a_tag another_tag<br/> - 2,Another One,another@example.com,Otro organismo,a_tag<br/> - <p> - </blockquote> + <pre> +#name,request_email,name.es,tag_string +An Authority,a@example.com,Un organismo,a_tag another_tag +Another One,another@example.com,Otro organismo,a_tag + </pre> - <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n), - publication_scheme (i18n), disclosure_log (i18n), home_page, tag_string (tags separated by spaces).</p> + <p><strong>Supported fields:</strong> + <ul> + <li> + <code>name</code> (i18n) + <strong>Existing records cannot be renamed</strong> + </li> + <li><code>short_name</code> (i18n)</li> + <li><code>request_email</code> (i18n)</li> + <li><code>notes</code> (i18n)</li> + <li><code>publication_scheme</code> (i18n)</li> + <li><code>disclosure_log</code> (i18n)</li> + <li><code>home_page</code></li> + <li><code>tag_string</code> (tags separated by spaces)</li> + </ul> + </p> <p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without actually altering the database. Choose <strong>upload</strong> to actually diff --git a/app/views/admin_request/_incoming_message_actions.html.erb b/app/views/admin_request/_incoming_message_actions.html.erb index 4cf099b53..dd50eb047 100644 --- a/app/views/admin_request/_incoming_message_actions.html.erb +++ b/app/views/admin_request/_incoming_message_actions.html.erb @@ -22,6 +22,13 @@ </div> </div> + <div class="control-group"> + <label class="control-label">Mark <code>To:</code> address as spam</label> + <div class="controls"> + <%= link_to 'Spam Addresses', spam_addresses_path %> + </div> + </div> + <%= form_tag admin_incoming_destroy_path, :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="destroy_message_<%= incoming_message.id %>">Destroy message</label> diff --git a/app/views/admin_request/_some_annotations.html.erb b/app/views/admin_request/_some_annotations.html.erb index dfd46f828..7adcdc5bb 100644 --- a/app/views/admin_request/_some_annotations.html.erb +++ b/app/views/admin_request/_some_annotations.html.erb @@ -1,48 +1,61 @@ -<% if comments.size > 0 %> - <div class="accordion" id="comments"> - <% for comment in comments %> - <div class="accordion-group"> - <div class="accordion-heading"> - <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="#comments"><%= chevron_right %></a> - <%= link_to admin_request_edit_comment_path(comment) do %> - #<%=comment.id%> - -- - <%=h(comment.user.name)%> - <%=admin_value(comment.created_at)%> +<% if comments.any? %> + <%= form_tag admin_user_modify_comment_visibility_path do %> + <div class="accordion" id="comments"> + <% comments.each do |comment| %> + <div class="accordion-group"> + <div class="accordion-heading"> + <%= check_box_tag 'comment_ids[]', comment.id %> + + <a href="#comment_<%= comment.id %>" data-toggle="collapse" data-parent="#comments"><%= chevron_right %></a> + + <%= link_to admin_request_edit_comment_path(comment) do %> + #<%= comment.id %> + -- + <%= h(comment.user.name) %> + <%= admin_value(comment.created_at) %> <% end %> - <blockquote class="incoming-message"> - <%= truncate(comment.body, :length => 400) %> - </blockquote> - </div> - <div id="comment_<%=comment.id%>" class="accordion-body collapse"> - <table class="table table-striped table-condensed"> - <tbody> - <tr> - <td colspan="2"> - By <%= user_both_links(comment.user) %> - </td> - </tr> - <% comment.for_admin_column do |name, value, type, column_name |%> + + <%= comment_visibility(comment) %> + + <blockquote class="incoming-message"> + <%= truncate(comment.body, :length => 400) %> + </blockquote> + </div> + + <div id="comment_<%= comment.id %>" class="accordion-body collapse"> + <table class="table table-striped table-condensed"> + <tbody> <tr> - <td> - <b><%=name%></b> - </td> - <td> - <% if column_name == 'body' && !comment.visible %> - <s><%=h comment.send(column_name) %></s> - <% else %> - <%=h comment.send(column_name) %> - <% end %> + <td colspan="2"> + By <%= user_both_links(comment.user) %> </td> </tr> - <% end %> - </tbody> - </table> + <% comment.for_admin_column do |name, value, type, column_name |%> + <tr> + <td> + <b><%= name %></b> + </td> + <td> + <% if column_name == 'body' && !comment.visible %> + <s><%= h comment.send(column_name) %></s> + <% else %> + <%= h comment.send(column_name) %> + <% end %> + </td> + </tr> + <% end %> + </tbody> + </table> + </div> + </div> - </div> - <% end %> - </div> + <% end %> + </div> + + <%= submit_tag 'Hide selected', :name => 'hide_selected' %> + <%= submit_tag 'Unhide selected', :name => 'unhide_selected' %> + + <% end %> <% else %> <p>None yet.</p> -<% end %> - +<% end %> diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index 2589e52b4..9c04badeb 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -118,7 +118,7 @@ </label> <div class="controls"> <%= link_to 'Generate URL', admin_request_generate_upload_url_path(@info_request), :class => "btn" %> - <p class="help-block">(see also option to general URLs for individual incoming messages below)</p> + <p class="help-block">(see also option to generate URLs for individual incoming messages below)</p> </div> </div> <%= form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form", 'data-info-request-id' => @info_request.id.to_s do %> diff --git a/app/views/admin_spam_addresses/index.html.erb b/app/views/admin_spam_addresses/index.html.erb new file mode 100644 index 000000000..9846bc017 --- /dev/null +++ b/app/views/admin_spam_addresses/index.html.erb @@ -0,0 +1,51 @@ +<% @title = 'Spam Addresses' %> + +<h1><%= @title %></h1> + +<div class="row"> + <div class="span12"> + <p> + Incoming mail that gets redirected to the holding pen will be + rejected if it is sent <code>To:</code> an address on this + list. + </p> + </div> +</div> + +<hr /> + +<div class="row"> + <div class="span12"> + <%= form_for(@spam_address, :html => { :class => 'form-inline' }) do |f| -%> + <%= error_messages_for @spam_address %> + <%= f.text_field :email, :class => 'input-xxlarge', :placeholder => 'Enter email' %> + <%= f.submit 'Add Spam Address', :class => 'btn btn-warning' %> + <% end -%> + </div> +</div> + +<hr /> + +<% if @spam_addresses.any? %> + <div class="row"> + <table class="table table-hover span12"> + <thead> + <tr> + <th>Email</th> + <th></th> + </tr> + </thead> + <tbody> + <% @spam_addresses.each do |spam| %> + <tr> + <td><%= spam.email %></td> + <td><%= link_to 'Remove', spam, + :method => :delete, + :confirm => 'This is permanent! Are you sure?', + :class => 'btn btn-mini btn-danger' %></td> + </tr> + <% end %> + </tbody> + </table> + </div> +<% end %> diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb index a6d234b34..cdcb3b85f 100644 --- a/app/views/comment/_single_comment.html.erb +++ b/app/views/comment/_single_comment.html.erb @@ -9,9 +9,8 @@ <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> - <div class="comment_in_request_text"> + <div class="comment_in_request_text"> <p> - <%= image_tag "quote-marks.png", :class => "comment_quote" %> <%= comment.get_body_for_html_display %> </p> </div> diff --git a/app/views/comment/_single_comment.text.erb b/app/views/comment/_single_comment.text.erb index 925e8b688..4932a7e4a 100644 --- a/app/views/comment/_single_comment.text.erb +++ b/app/views/comment/_single_comment.text.erb @@ -1,2 +1,2 @@ -<%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date(comment.created_at || Time.now) %>) +<%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date((comment.created_at || Time.now), :format => :text) %>) <%= comment.body.strip %> diff --git a/app/views/general/_responsive_credits.html.erb b/app/views/general/_responsive_credits.html.erb new file mode 100644 index 000000000..01a5df13a --- /dev/null +++ b/app/views/general/_responsive_credits.html.erb @@ -0,0 +1,2 @@ +<li><%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>') %> +</li> diff --git a/app/views/general/_responsive_footer.html.erb b/app/views/general/_responsive_footer.html.erb new file mode 100644 index 000000000..2967872f1 --- /dev/null +++ b/app/views/general/_responsive_footer.html.erb @@ -0,0 +1,15 @@ +<div class="footer" id="footer"> + <div id="footer-nav"> + <ul> + <li><%= link_to image_tag('logo.png'), frontpage_path, :id => 'logo' %></li> + <li><%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_path %></li> + <% unless AlaveteliConfiguration::twitter_username.blank? %> + <li><a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>"><%= _("Follow us on twitter") %></a></li> + <% end %> + + <%= render :partial => 'general/responsive_credits' %> + + </ul> + + </div> +</div> diff --git a/app/views/general/_responsive_header.html.erb b/app/views/general/_responsive_header.html.erb new file mode 100644 index 000000000..3a2994b4d --- /dev/null +++ b/app/views/general/_responsive_header.html.erb @@ -0,0 +1,31 @@ +<div id="banner"> + <div id="banner_inner"> + <div id="banner_content"> + <div id="logo_wrapper"> + <%= link_to image_tag('logo.png'), frontpage_path, :id => 'logo' %> + </div> + <div class="rsp_menu_button"> + <a href="#banner" class="open"> <i class="icon-menu"></i> Menu </a> + <a href="#" class="close"> <i class="icon-menu"></i> Close </a> + </div> + <%= render :partial => 'general/locale_switcher' %> + <% if ! (controller.action_name == 'signin' or controller.action_name == 'signup') %> + <div id="logged_in_bar"> + <div id="logged_in_links"> + <% if @user %> + <span class="greeting"><%= _('Hello, {{username}}!', :username => @user.name) %></span> + <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %> + <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %> + <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %> + <%= link_to _("Sign out"), signout_path(:r => request.fullpath) %> + <% else %> + <%= link_to _("Sign in or sign up"), signin_path(:r => request.fullpath) %> + <% end %> + </div> + </div> + <% end %> + </div> + <%= render :partial => 'general/responsive_topnav' %> + </div> +</div> + diff --git a/app/views/general/_responsive_stylesheets.html.erb b/app/views/general/_responsive_stylesheets.html.erb new file mode 100644 index 000000000..e3c3660c4 --- /dev/null +++ b/app/views/general/_responsive_stylesheets.html.erb @@ -0,0 +1,11 @@ +<!--[if LTE IE 7]> +<%= stylesheet_link_tag 'responsive/application-lte-ie7', :title => "Main", :rel => "stylesheet", :media => "all" %> +<![endif]--> + +<!--[if IE 8]> +<%= stylesheet_link_tag 'responsive/application-ie8', :title => "Main", :rel => "stylesheet", :media => "all" %> +<![endif]--> + +<!--[if GT IE 8]><!--> +<%= stylesheet_link_tag 'responsive/application', :title => "Main", :rel => "stylesheet", :media => "all" %> +<!--<![endif]--> diff --git a/app/views/general/_responsive_topnav.html.erb b/app/views/general/_responsive_topnav.html.erb new file mode 100644 index 000000000..e726c17f4 --- /dev/null +++ b/app/views/general/_responsive_topnav.html.erb @@ -0,0 +1,32 @@ +<div id="topnav"> + <ul id="navigation"> + + <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"> + <%= link_to _("Make a request"), select_authority_path, :id => 'make-request-link' %> + </li> + + <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"> + <%= link_to _("View requests"), request_list_successful_path %> + </li> + + <li class="<%= 'selected' if params[:controller] == 'public_body' %>"> + <%= link_to _("View authorities"), list_public_bodies_default_path %> + </li> + + <% unless AlaveteliConfiguration::blog_feed.empty? %> + <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_path %></li> + <% end %> + <li class="<%= 'selected' if params[:controller] == 'help' %>"> + <%= link_to _("Help"), help_about_path %> + </li> + + <li id="navigation_search"> + <form id="navigation_search_form" method="post" action="<%= search_redirect_path %>"> + <label for="navigation_search_button"> + <img src="/assets/search.png" alt="Search:"> + </label> + <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :title => "type your search term here" } %> + </form> + </li> + </ul> +</div> diff --git a/app/views/general/_stylesheet_includes.html.erb b/app/views/general/_stylesheet_includes.html.erb index 7a1648efd..ac7c37217 100644 --- a/app/views/general/_stylesheet_includes.html.erb +++ b/app/views/general/_stylesheet_includes.html.erb @@ -1,22 +1,40 @@ -<%- if @render_to_file %> - <style> - <%= Rails.application.assets["main.css"].to_s %> - <%= Rails.application.assets["print.css"].to_s %> - </style> -<%- else %> - <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> - <% if !params[:print_stylesheet].nil? %> - <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> +<% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%- if @render_to_file %> + <style> + <%= Rails.application.assets["responsive/application.css"].to_s %> + <%= Rails.application.assets["responsive/print.css"].to_s %> + </style> + <%- else %> + <%= render :partial => 'general/responsive_stylesheets' %> + <%= stylesheet_link_tag 'responsive/print', :rel => "stylesheet", :media => "print" %> + <% if !params[:print_stylesheet].nil? %> + <%= stylesheet_link_tag 'responsive/print', :rel => "stylesheet", :media => "all" %> + <% end %> + <% if AlaveteliConfiguration::force_registration_on_new_request %> + <%= stylesheet_link_tag 'fancybox.css', :rel => "stylesheet" %> + <% end %> <% end %> - <!--[if LT IE 7]> - <%= stylesheet_link_tag 'ie6.css' %> - <![endif]--> - <!--[if LT IE 8]> - <%= stylesheet_link_tag 'ie7.css' %> - <![endif]--> - <% if AlaveteliConfiguration::force_registration_on_new_request %> - <%= stylesheet_link_tag 'jquery.fancybox-1.3.4.css', :rel => "stylesheet" %> +<% else %> + <%- if @render_to_file %> + <style> + <%= Rails.application.assets["main.css"].to_s %> + <%= Rails.application.assets["print.css"].to_s %> + </style> + <%- else %> + <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> + <% if !params[:print_stylesheet].nil? %> + <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> + <% end %> + <!--[if LT IE 7]> + <%= stylesheet_link_tag 'ie6.css' %> + <![endif]--> + <!--[if LT IE 8]> + <%= stylesheet_link_tag 'ie7.css' %> + <![endif]--> + <% if AlaveteliConfiguration::force_registration_on_new_request %> + <%= stylesheet_link_tag 'fancybox.css', :rel => "stylesheet" %> + <% end %> <% end %> <% end %> diff --git a/app/views/general/blog.html.erb b/app/views/general/blog.html.erb index b81989ca8..5dda7ab74 100644 --- a/app/views/general/blog.html.erb +++ b/app/views/general/blog.html.erb @@ -1,21 +1,5 @@ <% @title = _("{{site_name}} blog and tweets", :site_name => site_name) %> -<% if !@twitter_user.empty? %> -<div id="right_column"> - <div class="act_link"> - <h2><%= _("Stay up to date") %></h2> - <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> - <%= image_tag "feed-16.png", :alt => "RSS icon" %> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> - </div> - <% if AlaveteliConfiguration::twitter_widget_id %> - <div id="twitter"> - <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a> - <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> - </div> - <% end %> -</div> -<% end %> - <div id="left_column"> <h1><%=@title %></h1> @@ -42,3 +26,18 @@ </div> </div> +<% if !@twitter_user.empty? %> +<div id="right_column"> + <div class="act_link"> + <h2><%= _("Stay up to date") %></h2> + <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/> + <%= image_tag "feed-16.png", :alt => "RSS icon" %> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a> + </div> + <% if AlaveteliConfiguration::twitter_widget_id %> + <div id="twitter"> + <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a> + <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> + </div> + <% end %> +</div> +<% end %> diff --git a/app/views/general/search.html.erb b/app/views/general/search.html.erb index 18f258444..3914a2f30 100644 --- a/app/views/general/search.html.erb +++ b/app/views/general/search.html.erb @@ -136,15 +136,18 @@ <div style="clear:both;"></div> <% if @total_hits == 0 %> + <div class="results_section"> <h2><%=@title %></h2> <% if @spelling_correction %> <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction)) %></p> <% end %> + </div> <% end %> <% if not @query.nil? %> - <div class="results_section"> - <% if @xapian_bodies_hits > 0 %> + + <% if @xapian_bodies_hits > 0 %> + <div class="results_section"> <% if @xapian_bodies_hits == 1 && @page == 1 %> <h2 class="publicbody_results"><%= _('One public authority found') %></h2> <% else %> @@ -158,13 +161,13 @@ </div> <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> - <% elsif @variety_postfix == 'bodies' %> - <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p> - <% end %> - </div> + </div> + <% elsif @variety_postfix == 'bodies' %> + <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p> + <% end %> - <div class="results_section"> - <% if @xapian_users_hits > 0 %> + <% if @xapian_users_hits > 0 %> + <div class="results_section"> <% if @xapian_users_hits == 1 && @page == 1 %> <h2 class="person_results"><%= _("One person found") %></h2> <% else %> @@ -178,11 +181,12 @@ </div> <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %> - <% end %> - </div> + </div> + <% end %> - <div class="results_section"> - <% if @xapian_requests_hits > 0 %> + + <% if @xapian_requests_hits > 0 %> + <div class="results_section"> <% if @xapian_requests_hits == 1 && @page == 1 %> <h2 class="foi_results"><%= _("One FOI request found") %></h2> <% else %> @@ -191,13 +195,13 @@ <div class="results_block"> <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> </div> <%= will_paginate WillPaginate::Collection.new(@page, @requests_per_page, @xapian_requests.matches_estimated) %> - <% end %> - </div> + </div> + <% end %> <% end %> <% if @advanced %> diff --git a/app/views/help/contact.html.erb b/app/views/help/contact.html.erb index ad89db9ec..d228aa3a5 100644 --- a/app/views/help/contact.html.erb +++ b/app/views/help/contact.html.erb @@ -65,6 +65,11 @@ <%= f.text_area :message, :rows => 10, :cols => 60 %> </p> + <p style="display:none;"> + <%= f.label :comment, 'Do not fill in this field' %> + <%= f.text_field :comment %> + </p> + <% if !@last_request.nil? %> <p> <label class="form_label" for="contact_message">Include link to request:</label> @@ -88,7 +93,7 @@ <div class="form_button"> <%= hidden_field_tag(:submitted_contact_form, 1) %> - <%= submit_tag "Send message to the charity" %> + <%= submit_tag "Send message to the charity", :disable_with => "Sending..." %> <-- we run this site, not the Government! </div> diff --git a/app/views/info_request_batch/show.html.erb b/app/views/info_request_batch/show.html.erb index aaecdd45d..8bb834b3c 100644 --- a/app/views/info_request_batch/show.html.erb +++ b/app/views/info_request_batch/show.html.erb @@ -1,25 +1,29 @@ <% @title = _("{{title}} - a batch request", :title => @info_request_batch.title) %> -<h1><%= @title %></h1> -<% if @info_request_batch.sent_at %> - <%= n_('Sent to one authority by {{info_request_user}} on {{date}}.', 'Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}.', @info_request_batch.info_requests.size, :authority_count=> @info_request_batch.info_requests.size, :info_request_user => user_link(@info_request_batch.user), :date => simple_date(@info_request_batch.sent_at)) %> - <div class="results_section"> - <div class="results_block"> - <% @info_requests.each do |info_request| %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => info_request.last_event_forming_initial_request, :info_request => info_request } %> - <% end %> - </div> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.info_requests.visible.count) %> +<div class="info_request_batch_intro"> + <h1><%= @title %></h1> + <% if @info_request_batch.sent_at %> + <%= n_('Sent to one authority by {{info_request_user}} on {{date}}.', 'Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}.', @info_request_batch.info_requests.size, :authority_count=> @info_request_batch.info_requests.size, :info_request_user => user_link(@info_request_batch.user), :date => simple_date(@info_request_batch.sent_at)) %> + + </div> + <div class="results_section"> + <div class="results_block"> + <% @info_requests.each do |info_request| %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => info_request.last_event_forming_initial_request } %> + <% end %> + </div> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.info_requests.visible.count) %> </div> <% else %> <%= _('Created by {{info_request_user}} on {{date}}.', :info_request_user => user_link(@info_request_batch.user), :date => simple_date(@info_request_batch.created_at)) %> - <%= _('Requests will be sent to the following bodies:') %> - <div class="results_section"> - <div class="results_block"> - <%= render :partial => 'public_body/body_listing', :locals => { :public_bodies => @public_bodies } %> - </div> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.public_bodies.count) %> - </div> + <%= _('Requests will be sent to the following bodies:') %> + </div> + <div class="results_section"> + <div class="results_block"> +<%= render :partial => 'public_body/body_listing', :locals => { :public_bodies => @public_bodies } %> + </div> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.public_bodies.count) %> + </div> <% end %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index c1f9335b1..2147f22e1 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -2,6 +2,8 @@ <html lang="en-gb"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" > + <%= csrf_meta_tags %> + <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title> <%= javascript_include_tag "admin" %> diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 52b718be8..50abc59c3 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -2,6 +2,8 @@ <html lang="<%= I18n.locale %>"> <head> <meta charset="utf-8"> + <%= csrf_meta_tags %> + <title> <% if @title %> <%=@title%> - <%= site_name %> @@ -38,17 +40,19 @@ <% if @no_crawl %> <meta name="robots" content="noindex, nofollow"> <% end %> - + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <% end %> <%= render :partial => 'general/before_head_end' %> </head> <body class="<%= 'front' if params[:action] == 'frontpage' %>"> <% if AlaveteliConfiguration::force_registration_on_new_request && !@user %> - <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack.js' %> + <%= javascript_include_tag 'fancybox.js' %> <script type="text/javascript"> $(document).ready(function() { $("#make-request-link").fancybox({ 'modal': false, - 'width': 920, + 'width': 950, 'height': 400, 'type': 'iframe', 'href': '/<%= FastGettext.locale %>/profile/sign_in?modal=1', @@ -82,7 +86,11 @@ </span> <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span> </div> - <%= render :partial => 'general/header' %> + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_header' %> + <% else %> + <%= render :partial => 'general/header' %> + <% end %> <div id="wrapper"> <div id="content"> <% if flash[:notice] %> @@ -98,8 +106,11 @@ <div style="clear:both"></div> </div> </div> - - <%= render :partial => 'general/footer' %> + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_footer' %> + <% else %> + <%= render :partial => 'general/footer' %> + <% end %> </div> <div id="link_box"><span class="close-button">X</span> diff --git a/app/views/layouts/no_chrome.html.erb b/app/views/layouts/no_chrome.html.erb index e613b8ca2..f3ca9ef9e 100644 --- a/app/views/layouts/no_chrome.html.erb +++ b/app/views/layouts/no_chrome.html.erb @@ -2,6 +2,8 @@ <html lang="<%= I18n.locale %>"> <head> <meta charset="utf-8"> + <%= csrf_meta_tags %> + <title> <% if @title %> <%=@title%> - <%= site_name %> @@ -12,11 +14,15 @@ <%= javascript_include_tag "application" %> - <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet" %> - <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %> - <!--[if LT IE 7]> - <%= stylesheet_link_tag 'ie6', :rel => "stylesheet" %> - <![endif]--> + <% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_stylesheets' %> + <% else %> + <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet" %> + <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %> + <!--[if LT IE 7]> + <%= stylesheet_link_tag 'ie6', :rel => "stylesheet" %> + <![endif]--> + <% end %> </head> <body> <div class="entirebody"> diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb index c36396149..a9c50e657 100644 --- a/app/views/public_body/show.html.erb +++ b/app/views/public_body/show.html.erb @@ -119,7 +119,7 @@ <% if !@xapian_requests.nil? %> <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %> diff --git a/app/views/request/_list_results.html.erb b/app/views/request/_list_results.html.erb index 4da042816..9e6b07c79 100644 --- a/app/views/request/_list_results.html.erb +++ b/app/views/request/_list_results.html.erb @@ -5,7 +5,7 @@ <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @results[:matches_estimated]) %></h2> <div class="results_block"> <% @results[:results].each do |result| %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result } %> <% end %> </div> <% end %> diff --git a/app/views/request/_outgoing_correspondence.text.erb b/app/views/request/_outgoing_correspondence.text.erb index 5375ef81b..221e359e2 100644 --- a/app/views/request/_outgoing_correspondence.text.erb +++ b/app/views/request/_outgoing_correspondence.text.erb @@ -3,6 +3,6 @@ <%- else %> <%= _('From:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %> <%= _('To:') %> <%= @info_request.public_body.name %> - <%= _('Date:') %> <%= simple_date(info_request_event.created_at) %> + <%= _('Date:') %> <%= simple_date(info_request_event.created_at, :format => :text) %> <%= outgoing_message.get_body_for_text_display %> <%- end %> diff --git a/app/views/request/_request_listing_via_event.html.erb b/app/views/request/_request_listing_via_event.html.erb index cc8bae8a9..20bc5b2c8 100644 --- a/app/views/request/_request_listing_via_event.html.erb +++ b/app/views/request/_request_listing_via_event.html.erb @@ -6,36 +6,21 @@ end %> <div class="request_left"> <span class="head"> <% if event.is_incoming_message? %> - <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")) %> + <%= link_to highlight_words(event.info_request.title, @highlight_words), incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")) %> <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %> - <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_path(event.outgoing_message) %> + <%= link_to highlight_words(event.info_request.title, @highlight_words), outgoing_message_path(event.outgoing_message) %> <% elsif event.is_comment? %> - <%= link_to highlight_words(info_request.title, @highlight_words), comment_path(event.comment) %> + <%= link_to highlight_words(event.info_request.title, @highlight_words), comment_path(event.comment) %> <% else %> - <%= link_to highlight_words(info_request.title, @highlight_words), request_path(info_request) %> + <%= link_to highlight_words(event.info_request.title, @highlight_words), request_path(event.info_request) %> <% end %> </span> <div class="requester"> - <% if event.event_type == 'sent' %> - <%= _('Request 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 )) %> - <% elsif event.event_type == 'followup_sent' %> - <%=event.display_status %> - <%= _('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 )) %> - <% elsif event.event_type == 'response' %> - <%=event.display_status %> - <%= _('by {{public_body_name}} to {{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 )) %> - <% elsif event.event_type == 'comment' %> - <%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated 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)) %> - <% 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 - between a change being made and the update-xapian-index job being run. %> - <!-- Event of type '<%= event.event_type %>', id=<%= event.id %> --> - <% end %> + <%= event_description(event) %> </div> - <span class="bottomline icon_<%= info_request.calculate_status %>"> + <span class="bottomline icon_<%= event.info_request.calculate_status %>"> <strong> - <%= info_request.display_status(cached_value_ok=true) %> + <%= event.info_request.display_status(cached_value_ok=true) %> </strong><br> </span> </div> diff --git a/app/views/request/_resent_outgoing_correspondence.text.erb b/app/views/request/_resent_outgoing_correspondence.text.erb index d645e9488..d39f8395b 100644 --- a/app/views/request/_resent_outgoing_correspondence.text.erb +++ b/app/views/request/_resent_outgoing_correspondence.text.erb @@ -1,2 +1,2 @@ -<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %> +<%= _('Date:') %> <%= simple_date(info_request_event.created_at, :format => :text) %> Sent <% if outgoing_message.message_type == 'initial_request' %> request <% elsif outgoing_message.message_type == 'followup' %> a follow up <% else %> <% raise "unknown message_type" %><% end %> to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>. diff --git a/app/views/request/_summary_suggestion.html.erb b/app/views/request/_summary_suggestion.html.erb index a5da09cda..74d9c46c5 100644 --- a/app/views/request/_summary_suggestion.html.erb +++ b/app/views/request/_summary_suggestion.html.erb @@ -1,5 +1,5 @@ <% if @info_request.law_used == 'eir' %> - <%= _("'Pollution levels over time for the River Tyne'") %> + <%= _("'Pollution levels over time for the River Tyne'") -%> <% else %> - <%= _("'Crime statistics by ward level for Wales'") %> + <%= _("'Crime statistics by ward level for Wales'") -%> <% end %> diff --git a/app/views/request/_view_html_prefix.html.erb b/app/views/request/_view_html_prefix.html.erb index 63fac7c6d..d21f234b9 100644 --- a/app/views/request/_view_html_prefix.html.erb +++ b/app/views/request/_view_html_prefix.html.erb @@ -6,7 +6,7 @@ <%=link_to _("Download original attachment"), @attachment_url %> <br>(<%=h @attachment.name_of_content_type %>) </div> - <%= _('This is an HTML version of an attachment to the Freedom of Information request')%> - '<%=link_to h(@info_request.title), incoming_message_path(@incoming_message)%>'. + <p class="view_html_description"><%= _('This is an HTML version of an attachment to the Freedom of Information request')%> + '<%=link_to h(@info_request.title), incoming_message_path(@incoming_message)%>'.</p> </div> diff --git a/app/views/request/_view_html_stylesheet.html.erb b/app/views/request/_view_html_stylesheet.html.erb index 125ce66ec..6746cf71b 100644 --- a/app/views/request/_view_html_stylesheet.html.erb +++ b/app/views/request/_view_html_stylesheet.html.erb @@ -1 +1,6 @@ -<link type="text/css" title="Main" rel="stylesheet" media="screen" href="/assets/application.css"> +<% if AlaveteliConfiguration::responsive_styling || params[:responsive] %> + <%= render :partial => 'general/responsive_stylesheets' %> +<% else %> + <link type="text/css" title="Main" rel="stylesheet" media="screen" href="/assets/application.css"> + +<% end %> diff --git a/app/views/request/select_authority.html.erb b/app/views/request/select_authority.html.erb index 83abdb184..ed072cf64 100644 --- a/app/views/request/select_authority.html.erb +++ b/app/views/request/select_authority.html.erb @@ -18,6 +18,7 @@ $("#authority_preview").show(); $(window).scrollTop($("#banner").height()); $("#authority_preview #header_right").hide(); + location.hash = '#header_left'; }); return false; }); diff --git a/app/views/request/similar.html.erb b/app/views/request/similar.html.erb index 5bdefc494..4ce4bf9ba 100644 --- a/app/views/request/similar.html.erb +++ b/app/views/request/similar.html.erb @@ -22,7 +22,7 @@ --> <% for result in @xapian_object.results %> <% if result[:model].class.to_s == 'InfoRequestEvent' %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% else %> <p><strong><%= _('Unexpected search result type ')%><%=result[:model].class.to_s%></strong></p> <% end %> diff --git a/app/views/request_game/play.html.erb b/app/views/request_game/play.html.erb index d5aa0d00e..544274e93 100644 --- a/app/views/request_game/play.html.erb +++ b/app/views/request_game/play.html.erb @@ -27,20 +27,21 @@ <% end %> </table> </div> -<h2><%= _("Play the request categorisation game!")%></h2> -<p><%= _("Some people who've made requests haven't let us know whether they were +<div id="game"> + <h2><%= _("Play the request categorisation game!")%></h2> + <p><%= _("Some people who've made requests haven't let us know whether they were successful or not. We need <strong>your</strong> help – choose one of these requests, read it, and let everyone know whether or not the information has been provided. Everyone'll be exceedingly grateful.")%></p> -<% for info_request in @requests %> - <%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %> -<% end %> -<p id="game_buttons"> -<%= button_to _('I don\'t like these ones — give me some more!'), categorise_play_url %> -<%= button_to _('I don\'t want to do any more tidying now!'), categorise_stop_url %> -</p> -<p><%= _('Thanks for helping - your work will make it easier for everyone to find successful + <% for info_request in @requests %> + <%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %> + <% end %> + <p id="game_buttons"> + <%= button_to _('I don\'t like these ones — give me some more!'), categorise_play_url %> + <%= button_to _('I don\'t want to do any more tidying now!'), categorise_stop_url %> + </p> + <p><%= _('Thanks for helping - your work will make it easier for everyone to find successful responses, and maybe even let us make league tables...')%></p> - +</div> diff --git a/app/views/track/_track_set.erb b/app/views/track/_track_set.erb new file mode 100644 index 000000000..c7665312d --- /dev/null +++ b/app/views/track/_track_set.erb @@ -0,0 +1,6 @@ +<% if @user.receive_email_alerts %> + <%= subscribe_email_notice(@track_thing) %> + <%= link_to(_('Prefer not to receive emails?'), show_user_wall_path(:url_name => @user.url_name)) %> +<% else %> + <%= subscribe_follow_notice(@track_thing) %> +<% end %> diff --git a/app/views/track/atom_feed.atom.erb b/app/views/track/atom_feed.atom.erb index be9c39e72..892727aef 100644 --- a/app/views/track/atom_feed.atom.erb +++ b/app/views/track/atom_feed.atom.erb @@ -9,7 +9,7 @@ # 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', :formats => ['html'], :locals => { :event => result[:model], :info_request => result[:model].info_request } + content += render :partial => 'request/request_listing_via_event', :formats => ['html'], :locals => { :event => result[:model] } else content = "<p><strong>Unknown search result type " + result[:model].class.to_s + "</strong></p>" end diff --git a/app/views/track_mailer/event_digest.text.erb b/app/views/track_mailer/event_digest.text.erb index 8dbc7fe06..b83c184f0 100644 --- a/app/views/track_mailer/event_digest.text.erb +++ b/app/views/track_mailer/event_digest.text.erb @@ -32,7 +32,7 @@ else raise "unknown type in event_digest " + event.event_type end - main_text += " (" + simple_date(event.created_at) + ")\n" + main_text += " (" + simple_date(event.created_at, :format => :text) + ")\n" # Main text, wrapped, words highlighted with * and indented. if event.is_outgoing_message? diff --git a/app/views/user/river.html.erb b/app/views/user/river.html.erb index 9618e0aa8..7277e5ee5 100644 --- a/app/views/user/river.html.erb +++ b/app/views/user/river.html.erb @@ -4,8 +4,7 @@ <h1><%=@title%></h1> <% for result in @results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { - :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> </div> diff --git a/app/views/user/show.html.erb b/app/views/user/show.html.erb index 76ecdeda0..ce328b46f 100644 --- a/app/views/user/show.html.erb +++ b/app/views/user/show.html.erb @@ -42,7 +42,7 @@ <% end %> </div> - <div class="header_left"> + <div id="header_left"> <p id="user_photo_on_profile"> <% if @display_user.profile_photo %> <% if @is_you %> @@ -147,7 +147,7 @@ <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %> @@ -175,7 +175,7 @@ </h2> <% for result in @xapian_comments.results %> - <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> + <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %> <% end %> <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.visible_comments.size) %> @@ -224,7 +224,7 @@ <li> <%= form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %> <div> - <%= track_thing.params[:list_description] %> + <%= track_description(track_thing) %> <%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %> <%= hidden_field_tag 'r', request.fullpath, { :id => 'r_' + track_thing.id.to_s } %> <%= submit_tag _('unsubscribe') %> |