diff options
Diffstat (limited to 'app/views')
22 files changed, 172 insertions, 56 deletions
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.rhtml index 40fe33616..d7bf1c6da 100644 --- a/app/views/admin_general/debug.rhtml +++ b/app/views/admin_general/debug.rhtml @@ -7,6 +7,8 @@ <h2>Version numbers</h2> <p> +Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %> +<br> Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %> <br> Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %> diff --git a/app/views/admin_general/index.rhtml b/app/views/admin_general/index.rhtml index 1a4b8ba96..48bd7f694 100644 --- a/app/views/admin_general/index.rhtml +++ b/app/views/admin_general/index.rhtml @@ -46,6 +46,20 @@ </ul> <% end %> +<% if @attention_requests.size > 0 %> + <h3>Review requests which have been marked as requiring your attention by users (<%=@error_message_requests.size%> total)</h3> + + <ul> + <% for @request in @attention_requests %> + <li> + <%= request_both_links(@request)%> + – <%=simple_date(@request.get_last_event.created_at)%> + </li> + <% end %> + </ul> +<% end %> + + <% if @requires_admin_requests.size > 0 %> <h3>These require administrator attention (<%=@requires_admin_requests.size%> total)</h3> diff --git a/app/views/admin_request/_incoming_message_actions.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml index c23b4060a..569132861 100644 --- a/app/views/admin_request/_incoming_message_actions.rhtml +++ b/app/views/admin_request/_incoming_message_actions.rhtml @@ -1,6 +1,6 @@ <% form_tag '../redeliver_incoming' do %> <div> - id or url_title of request: + id or url_title of request (or a list of requests, comma-separated): <% if @info_requests && @info_requests.size == 1 %> <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %> <% else %> diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml index b659c676d..4026ee712 100644 --- a/app/views/admin_request/edit.rhtml +++ b/app/views/admin_request/edit.rhtml @@ -22,20 +22,7 @@ </p> <p><label for="info_request_described_state"><strong>Described state</strong></label> - <%= select( 'info_request', "described_state", - [ - 'waiting_response', - 'waiting_clarification', - 'gone_postal', - 'not_held', - 'rejected', - 'successful', - 'partially_successful', - 'internal_review', - 'error_message', - 'requires_admin', - 'user_withdrawn' - ]) %>; + <%= select( 'info_request', "described_state", InfoRequest.enumerate_states ) %>; <label for="info_request_awaiting_description"><strong>Awaiting description</strong></label> <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %> <br/>(don't forget to change 'awaiting description' when you set described state)<br/> @@ -60,7 +47,7 @@ <hr> -<% form_tag '../fully_destroy/' + @info_request.id.to_s do %> +<% form_tag '../destroy/' + @info_request.id.to_s do %> <p> <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destory request entirely' %> <br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It diff --git a/app/views/admin_request/hidden_user_explanation.rhtml b/app/views/admin_request/hidden_user_explanation.rhtml new file mode 100644 index 000000000..aaea49fb6 --- /dev/null +++ b/app/views/admin_request/hidden_user_explanation.rhtml @@ -0,0 +1,9 @@ +Dear <%= name_to %>, + +Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators. + +We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. Please reply to this email if you would like to discuss this decision further. + +Yours, + +The <%= site_name %> team. diff --git a/app/views/contact_mailer/from_admin_message.rhtml b/app/views/contact_mailer/from_admin_message.rhtml new file mode 100644 index 000000000..bdb48d580 --- /dev/null +++ b/app/views/contact_mailer/from_admin_message.rhtml @@ -0,0 +1,2 @@ +<%= @message.strip %> + diff --git a/app/views/general/_locale_switcher.rhtml b/app/views/general/_locale_switcher.rhtml index 27e492e84..2521b5eb5 100644 --- a/app/views/general/_locale_switcher.rhtml +++ b/app/views/general/_locale_switcher.rhtml @@ -1,11 +1,13 @@ - <% if FastGettext.default_available_locales.length > 1 && !params.empty? %> - <div id="user_locale_switcher"> - <% for possible_locale in FastGettext.default_available_locales %> - <% if possible_locale == I18n.locale.to_s %> - <span class="active"><%= locale_name(possible_locale) %></span> - <% else %> - <a href="<%= locale_switcher(possible_locale, params) %>"><%= locale_name(possible_locale) %></a> - <% end %> - <% end %> + <% if FastGettext.default_available_locales.length > 1 && !params.empty? %> + <div id="user_locale_switcher"> + <div class="btn-group"> + <% for possible_locale in FastGettext.default_available_locales %> + <% if possible_locale == I18n.locale.to_s %> + <a href="#" class="btn disabled"><%= locale_name(possible_locale) %></a> + <% else %> + <a href="<%= locale_switcher(possible_locale, params) %>" class="btn"><%= locale_name(possible_locale) %></a> + <% end %> + <% end %> </div> - <% end %> + </div> + <% end %> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 90ace809e..a1f8c8f04 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -131,8 +131,7 @@ </p> <% end %> </div> <!-- header left --> - -<% if @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%> +<% if !@track_thing.nil? %> <div id="header_right"> <h2><%= _('Track this search')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 42ca5dbbb..65670538d 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -9,7 +9,7 @@ <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %> </head> - <body> + <body class="admin"> <p> <strong><%= link_to 'Alaveteli', main_url('/') %> admin:</strong> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index f439b27d2..bc9dfb02d 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -58,7 +58,7 @@ <%= render :partial => 'general/before_head_end' %> </head> - <body <%= "class='front'" if params[:action] == 'frontpage' %>> + <body class="<%= 'admin' if !session[:using_admin].nil?%> <%= 'front' if params[:action] == 'frontpage' %>"> <!-- XXX: move to a separate file --> <% if force_registration_on_new_request && !@user %> @@ -104,6 +104,7 @@ <% if @user %> <%=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) %> <% end %> @@ -154,6 +155,20 @@ <br /> <input type="text"> </div> + <% + ga_code = MySociety::Config.get('GA_CODE', '') + unless ga_code.empty? + %> + <script> + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); + </script> + <script> + var pageTracker = _gat._getTracker("<%=ga_code%>"); + pageTracker._trackPageview(); + </script> + <% end %> + </body> </html> diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 5f20a9717..63bd5f7fc 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -4,7 +4,7 @@ <h2><%= _('Follow this authority')%></h2> <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %> - <p><%= n_("There is %d person following this authority", "There are %d people following this authority", follower_count) % follower_count %></p> + <p><%= n_("<span id='follow_count'>%d</span> person is following this authority", "<span id='follow_count'>%d</span> people are following this authority", follower_count) % follower_count %></p> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> <h2><%= _('More about this authority')%></h2> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 758387b09..bca142fa9 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -1,10 +1,21 @@ <div id="right_column"> + <div id="follow_box"> <h2><%= _('Follow this request') %></h2> <% 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' } %> - + </div> + <% if @info_request.described_state != "attention_requested" %> + <h2><%= _('Offensive? Unsuitable?') %></h2> + <% if @info_request.attention_requested %> + <p><%= ('The site administrators have reviewed this request and consider it to be suitable for the website.') %></p> + <% else %> + <p><%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (<a href="/help/about">read more</a>).') %> + <p><%= ('If you believe this request is not suitable, you can report it for attention by the site administrators') %></p> + <%= link_to _("Report this request"), report_path, :class => "link_button_green" %> + <% end %> + <% end %> <h2><%= _("Act on what you've learnt") %></h2> <div class="act_link"> diff --git a/app/views/request/_wall_listing.rhtml b/app/views/request/_wall_listing.rhtml new file mode 100644 index 000000000..9cde234c0 --- /dev/null +++ b/app/views/request/_wall_listing.rhtml @@ -0,0 +1,30 @@ +<% if @highlight_words.nil? + @highlight_words = [] +end %> + +<div class="request_listing"> + <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) %> + <% 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) %> + <% 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) %> + <% 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) %> + <% 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 %> + </div> + </div> + <div class="request_right"> + <span class="desc"> + <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %> + </span> + </div> +</div> + diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index c5d040fb7..27ad0700e 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -1,4 +1,6 @@ -<% @title = "#{h(@info_request.title)} - a Freedom of Information request to #{h(@info_request.public_body.name)}" %> +<% @title = _("{{title}} - a Freedom of Information request to {{public_body}}", + :title => h(@info_request.title), + :public_body => (@info_request.public_body.name)) %> <% if @info_request.prominence == 'hidden' %> <p id="hidden_request"> @@ -72,7 +74,7 @@ <%= _('normally') %> <% end %> <%= _('no later than') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong> - (<%= link_to "details", "/help/requesting#quickly_response" %>). + (<%= link_to _("details"), "/help/requesting#quickly_response" %>). <% elsif @status == 'waiting_response_overdue' %> <%= _('Response to this request is <strong>delayed</strong>.') %> <%= _('By law, {{public_body_link}} should normally have responded <strong>promptly</strong> and',:public_body_link=>public_body_link(@info_request.public_body)) %> @@ -116,6 +118,12 @@ <% elsif @status == 'user_withdrawn' %> <%= _('This request has been <strong>withdrawn</strong> by the person who made it. There may be an explanation in the correspondence below.') %> + <% elsif @status == 'attention_requested' %> + <%= _('This request has been <strong>reported</strong> as needing administrator attention (perhaps because it is vexatious, or a request for personal information)') %> + <% elsif @status == 'vexatious' %> + <%= _('This request has been <strong>hidden</strong> from the site, because an administrator considers it vexatious') %> + <% elsif @status == 'not_foi' %> + <%= _('This request has been <strong>hidden</strong> from the site, because an administrator considers it not to be an FOI request') %> <% else %> <%= render :partial => 'general/custom_state_descriptions', :locals => { :status => @status } %> <% end %> diff --git a/app/views/request_mailer/not_clarified_alert.rhtml b/app/views/request_mailer/not_clarified_alert.rhtml index 82d15ba76..2408452b3 100644 --- a/app/views/request_mailer/not_clarified_alert.rhtml +++ b/app/views/request_mailer/not_clarified_alert.rhtml @@ -1,5 +1,7 @@ -<%=@info_request.public_body.name%> <%=('has asked you to explain part of your')%> <%=@info_request.law_used_short%> <%= _('request.')%> -<%= _('To do this, first click on the link below.')%> +<%= _('{{public_body}} has asked you to explain part of your {{law_used}} request.', + :public_body => @info_request.public_body.name, + :law_used => @info_request.law_used_short ) %> +<%= _('To do this, first click on the link below.') %> <%=@url%> diff --git a/app/views/track/_tracking_links.rhtml b/app/views/track/_tracking_links.rhtml index f50a8bbbf..39f346eff 100644 --- a/app/views/track/_tracking_links.rhtml +++ b/app/views/track/_tracking_links.rhtml @@ -7,18 +7,17 @@ <% if own_request %> <p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p> <% elsif existing_track %> - <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form feed_form_" + location) do %> - <p> - <%= track_thing.params[:verb_on_page_already] %> - <%= hidden_field_tag 'track_medium', "delete" %> - <%= hidden_field_tag 'r', request.request_uri %> - <%= submit_tag "unsubscribe" %> - </p> - <% end %> + <p><%= track_thing.params[:verb_on_page_already] %></p> + <div class="feed_link feed_link_<%=location%>"> + <%= link_to "Unsubscribe", {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.request_uri}, :class => "link_button_green" %> + </div> <% elsif track_thing %> <div class="feed_link feed_link_<%=location%>"> - <%= link_to '<img src="/images/email-16.png" alt="">', do_track_url(track_thing) %> - <%= link_to _("Follow by email"), do_track_url(track_thing) %> + <% if defined? follower_count && follower_count > 0 %> + <%= link_to _("I like this request"), do_track_url(track_thing), :class => "link_button_green" %> + <% else %> + <%= link_to _("Follow"), do_track_url(track_thing), :class => "link_button_green" %> + <% end %> </div> <div class="feed_link feed_link_<%=location%>"> diff --git a/app/views/user/_change_receive_email.rhtml b/app/views/user/_change_receive_email.rhtml new file mode 100644 index 000000000..83e5d8601 --- /dev/null +++ b/app/views/user/_change_receive_email.rhtml @@ -0,0 +1,16 @@ +<% form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %> + <div> + <% if @user.receive_email_alerts %> + <%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %><br><br> + <%= hidden_field_tag 'receive_email_alerts', 'false' %> + <%= hidden_field_tag 'came_from', request.url %> + <%= submit_tag _("Turn off email alerts") %> + <% else %> + <%= _('Items matching the following conditions are currently displayed on your wall.') %><br><br> + <%= hidden_field_tag 'receive_email_alerts', 'true' %> + <%= hidden_field_tag 'came_from', request.url %> + <%= submit_tag _("Also send me alerts by email") %> + <% end %> + </div> +<% end %> + diff --git a/app/views/user/confirm.rhtml b/app/views/user/confirm.rhtml index bdaf5c8e9..bc70a1f36 100644 --- a/app/views/user/confirm.rhtml +++ b/app/views/user/confirm.rhtml @@ -1,6 +1,6 @@ -<% @title = h("Now check your email!") %> +<% @title = _("Now check your email!") %> -<h1 class="confirmation_heading">Now check your email!</h1> +<h1 class="confirmation_heading"><%= _("Now check your email!") %></h1> <p class="confirmation_message"> <%= _('We\'ve sent you an email, and you\'ll need to click the link in it before you can diff --git a/app/views/user/rate_limited.rhtml b/app/views/user/rate_limited.rhtml index 2a770d62e..d5accf114 100644 --- a/app/views/user/rate_limited.rhtml +++ b/app/views/user/rate_limited.rhtml @@ -1,4 +1,4 @@ -<% @title = "Too many requests" %> +<% @title = _("Too many requests") %> <h1><%=@title%></h1> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 8f1803442..d723196d3 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -1,7 +1,7 @@ <% if @show_requests %> - <% @title = h(@display_user.name) + " - Freedom of Information requests" %> + <% @title = h(@display_user.name) + _(" - Freedom of Information requests") %> <% else %> - <% @title = h(@display_user.name) + " - user profile" %> + <% @title = h(@display_user.name) + _(" - user profile") %> <% end %> <% if (@same_name_users.size >= 1) %> @@ -139,7 +139,7 @@ <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.empty? %> <% if @page == 1 %> - <h2 class="foi_results" id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %> + <h2 class="foi_results" id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> <%= @match_phrase %> </h2> <p><%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %> <%= @page_desc %> @@ -192,11 +192,12 @@ </div> <% end %> <% if @show_profile && @is_you %> + <h2 id="email_subscriptions"> <%= _("Things you're following")%></h2> + <%= render :partial => 'change_receive_email' %> + <br> <% if @track_things.empty? %> - <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2> - <p><%= _('None made.')%></p> + <p><%= _("You're not following anything.")%></p> <% else %> - <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2> <% if @track_things_grouped.size == 1 %> <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %> <h3> diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml index bfd0fa63e..4704ea95a 100644 --- a/app/views/user/sign.rhtml +++ b/app/views/user/sign.rhtml @@ -10,7 +10,10 @@ <%= @post_redirect.reason_params[:web] %>, <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>. <% end %> - </p> + </p> + <% if @post_redirect.post_params["controller"] == "admin_general" %> + <p id="superuser_message">Don't have a superuser account yet? <%= link_to "Sign in as the emergency user", @post_redirect.uri + "?emergency=1" %></p> + <% end %> <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => true } %> diff --git a/app/views/user/wall.rhtml b/app/views/user/wall.rhtml new file mode 100644 index 000000000..190cc0a6d --- /dev/null +++ b/app/views/user/wall.rhtml @@ -0,0 +1,16 @@ +<% @title = h(@display_user.name) + _(" - wall") %> +<% if @is_you %> +<div class="medium_column"> + <p><%= _('You can change the requests and users you are following on <a href="{{profile_url}}">your profile page</a>.', :profile_url => show_user_profile_path) %> + <%= render :partial => 'change_receive_email' %> +</div> +<% end %> +<div id="user_profile_search"> + <% if !@feed_results.nil? %> + <% for result in @feed_results %> + <%= render :partial => 'request/wall_listing', :locals => { :event => result, :info_request => result.info_request } %> + <% end %> + <% end %> + + +</div> |