diff options
Diffstat (limited to 'app/views')
23 files changed, 295 insertions, 232 deletions
diff --git a/app/views/admin_censor_rule/_form.rhtml b/app/views/admin_censor_rule/_form.rhtml index d077afd9a..ac43de704 100644 --- a/app/views/admin_censor_rule/_form.rhtml +++ b/app/views/admin_censor_rule/_form.rhtml @@ -11,6 +11,9 @@ <% end %> </p> +<p><label for="censor_rule_regexp">Is it regexp replacement?</label> (Leave unchecked if you are not sure about this)<br/> +<%= check_box 'censor_rule', 'regexp' %></p> + <p><label for="censor_rule_text">Text</label> (that you want to remove, case sensitive)<br/> <%= text_field 'censor_rule', 'text', :size => 60 %></p> @@ -21,9 +24,9 @@ <%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :cols => 60 %></p> <p><strong>Warning and notes:</strong> This does replace text in binary files, but for -most formats only in a naive way. It works well on surprisingly many Word documents. Notably -it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code -which works on some PDFs. Please <strong>carefully check</strong> all attachments have +most formats only in a naive way. It works well on surprisingly many Word documents. Notably +it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code +which works on some PDFs. Please <strong>carefully check</strong> all attachments have changed in the way you expect, and haven't become corrupted. </p> @@ -32,4 +35,6 @@ things by individual request or by user by adding the censor rule from the appropriate page. If you need to redact across a whole authority, it will be easy enough to make code changes to add it, so do ask. </p> +<p><strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to. +</p> diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml index d5717de23..4a03d0665 100644 --- a/app/views/admin_public_body/import_csv.rhtml +++ b/app/views/admin_public_body/import_csv.rhtml @@ -9,48 +9,57 @@ <pre id="error"><%=@errors %></pre> <% end %> - <% form_tag 'import_csv', :multipart => true do %> <p> - <label for="csv_file">CSV file:</label> - <%= file_field_tag :csv_file, :size => 40 %> + <% if @original_csv_file && @temporary_csv_file %> + CSV file: + <%= @original_csv_file %> + <%= hidden_field_tag :original_csv_file, @original_csv_file %> + <%= hidden_field_tag :temporary_csv_file, @temporary_csv_file %> + <%= link_to 'Clear current file', 'import_csv', :class => "btn btn-warning" %> + <% else %> + <label for="csv_file">CSV file:</label> + <%= file_field_tag :csv_file, :size => 40 %> + <% end %> </p> - + <p> <label for="tag">Optional: Tag to add entries to / alter entries for:</label> <%= text_field_tag 'tag', params[:tag] %> </p> - + <p> <label for="tag_behaviour">What to do with existing tags?</label> - <%= select_tag 'tag_behaviour', + <%= select_tag 'tag_behaviour', "<option value='add' selected>Add new tags to existing ones</option> - <option value='replace'>Replace existing tags with new ones</option>" + <option value='replace'>Replace existing tags with new ones</option>" %> </p> - <p><strong>CSV file format:</strong> A first row with the list of fields, + <p><strong>CSV file format:</strong> A first row with the list of fields, starting with '#', is optional but highly recommended. The fields 'name' and 'request_email' are required; additionally, translated values are supported by adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example: </p> - + <blockquote> - #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> + #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> - <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n), + <p>Supported fields: name (i18n), short_name (i18n), request_email (i18n), notes (i18n), publication_scheme (i18n), home_page, tag_string (tags separated by spaces).</p> - + <p><strong>Note:</strong> Choose <strong>dry run</strong> to test, without actually altering the database. Choose <strong>upload</strong> to actually make the changes. In either case, you will be shown any errors, or details of the changes. When uploading, any changes since last import will be overwritten - e.g. email addresses changed back. </p> - + <p><strong>Note:</strong> The import tag will also be added to the imported bodies if no tags are provided in the CSV file or if the import mode is set to "Add new tags to existing ones". @@ -61,7 +70,7 @@ <hr> -<p>Standard tags: +<p>Standard tags: <% for category, description in PublicBodyCategories::get().by_tag() %> <% if category != "other" %> <strong><%= category %></strong>=<%= description %>; diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml index 4026ee712..808028b47 100644 --- a/app/views/admin_request/edit.rhtml +++ b/app/views/admin_request/edit.rhtml @@ -7,21 +7,21 @@ <p><label for="info_request_title"><strong>Title</strong></label> (warning: editing this will break URLs right now)<br/> <%= text_field 'info_request', 'title', :size => 50 %></p> - <p><label for="info_request_prominence"><strong>Prominence</strong></label> + <p><label for="info_request_prominence"><strong>Prominence</strong></label> <%= select( 'info_request', "prominence", [ "normal", "backpage", "requester_only", "hidden" ]) %> (backpage means hidden from lists/search; hidden means completely hidden; super users can see anything) </p> <p> - <label for="info_request_allow_new_responses_from"><strong>Allow new responses</strong> from</label> + <label for="info_request_allow_new_responses_from"><strong>Allow new responses</strong> from</label> <%= select( 'info_request', "allow_new_responses_from", [ "anybody", "authority_only", "nobody" ] ) %>; - <label for="info_request_handle_rejected_responses"><strong>Handle rejected responses</strong> with</label> + <label for="info_request_handle_rejected_responses"><strong>Handle rejected responses</strong> with</label> <%= select( 'info_request', "handle_rejected_responses", [ "bounce", "holding_pen", "blackhole" ] ) %> <br> ('authority_only' means email From: domain of authority request email or any domain that has previously sent a response; 'nobody' also stops requester making followups; take care when using 'blackhole' which just drops mail) </p> - <p><label for="info_request_described_state"><strong>Described state</strong></label> + <p><label for="info_request_described_state"><strong>Described state</strong></label> <%= 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]]) %> @@ -49,7 +49,7 @@ <% form_tag '../destroy/' + @info_request.id.to_s do %> <p> - <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destory request entirely' %> + <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely' %> <br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It destroys all responses and tracks as well. </p> diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml index aac68ad2e..9d939eb35 100644 --- a/app/views/admin_request/show.rhtml +++ b/app/views/admin_request/show.rhtml @@ -11,14 +11,20 @@ <% if column.name == 'described_state' %> <strong>Calculated status:</strong> <%= @info_request.calculate_status %> <br/><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %> - <strong>Date response required by:</strong> <%= @info_request.date_response_required_by %> + <strong>Date response required by:</strong> <%= @info_request.date_response_required_by %> <strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %> <% end %> <% if ![ 'allow_new_responses_from' ].include?(column.name) %> <br/> <% end %> <% end %> - <strong>Created by:</strong> <%= user_both_links(@info_request.user) %> + <strong>Created by:</strong> + <% if @info_request.is_external? %> + <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API) + <% else %> + <%= user_both_links(@info_request.user) %> + <% end %> + <span> <span> (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) @@ -30,7 +36,7 @@ </span> </span> <br> -<strong>Public authority:</strong> <%= public_body_both_links(@info_request.public_body) %> +<strong>Public authority:</strong> <%= public_body_both_links(@info_request.public_body) %> <span> <span> (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>) @@ -63,7 +69,7 @@ <% end %> <th>Actions</th> </tr> - + <% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %> <tr class="<%= cycle('odd', 'even') %>"> <td><%=h info_request_event.id %></td> @@ -102,7 +108,7 @@ <% end %> <th>Actions</th> </tr> - + <% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %> <tr class="<%= cycle('odd', 'even') %>"> <td><%=h outgoing_message.id %></td> @@ -110,8 +116,8 @@ <% if column == 'body' %> <td> - <div><%= simple_format( truncate(outgoing_message.body, :length => 400, - :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + <div><%= simple_format( truncate(outgoing_message.body, :length => 400, + :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") )) %></div> <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div> </td> @@ -143,15 +149,15 @@ <% end %> <th>Actions</th> </tr> - + <% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %> <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>"> <td><%=h incoming_message.id %></td> <% for column in IncomingMessage.content_columns.map { |c| c.name } %> <% if column =~ /^cached_.*?$/ %> <td> - <div><%= simple_format( truncate(incoming_message.send(column), :length => 400, - :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") + <div><%= simple_format( truncate(incoming_message.send(column), :length => 400, + :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')") )) %></div> <div style="display:none;"><%= simple_format( incoming_message.send(column) ) %></div> </td> @@ -183,7 +189,7 @@ <% end %> <th>Actions</th> </tr> - + <% for comment in @info_request.comments %> <tr class="<%= cycle('odd', 'even') %>"> <td><%=h comment.id %></td> diff --git a/app/views/api/request_events.atom.builder b/app/views/api/request_events.atom.builder new file mode 100644 index 000000000..4f0133051 --- /dev/null +++ b/app/views/api/request_events.atom.builder @@ -0,0 +1,25 @@ +atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/Atom") do |feed| + feed.title("Events relating to #{@public_body.name}") + feed.updated(@events.first.created_at) + + for event in @events + feed.entry(event) do |entry| + request = event.info_request + + entry.published(event.created_at) + entry.tag!("alaveteli:event_type", event.event_type) + entry.tag!("alaveteli:request_url", main_url(request_url(request))) + entry.title(request.title) + + entry.content(event.outgoing_message.body, :type => 'text') + + entry.author do |author| + author.name(request.user_name) + if !request.user.nil? + author.uri(main_url(user_url(request.user))) + end + author.email(request.incoming_email) + end + end + end +end diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.rhtml index cf9367b88..aa5b6051c 100644 --- a/app/views/comment/new.rhtml +++ b/app/views/comment/new.rhtml @@ -33,7 +33,7 @@ <% if [ 'successful', 'partially_successful' ].include?(@info_request.described_state) %> <li><%= _(' <strong>Summarise</strong> the content of any information returned. ')%></li> <li><%= _(' Say how you\'ve <strong>used the information</strong>, with links if possible.')%> </li> - <li> <%= _('<strong>Thank</strong> the public authority or ')%><%=h @info_request.user.name %>. </li> + <li> <%= _('<strong>Thank</strong> the public authority or ')%><%=h (@info_request.user_name ? @info_request.user_name : _('the requester')) %>. </li> <% end %> <% if [ 'partially_successful' ].include?(@info_request.described_state) %> <li> <%= _('Suggest how the requester can find the <strong>rest of the information</strong>.')%></li> @@ -67,8 +67,11 @@ </ul> <p> - <big><%= _('Annotations will be posted publicly here, and are + <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> + <% 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> + <% end %> </p> <%= render :partial => 'comment/comment_form', :locals => { :track_thing => @track_thing } %> diff --git a/app/views/general/_popup_banner.rhtml b/app/views/general/_popup_banner.rhtml new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/app/views/general/_popup_banner.rhtml @@ -0,0 +1 @@ + diff --git a/app/views/general/_stylesheet_includes.rhtml b/app/views/general/_stylesheet_includes.rhtml new file mode 100644 index 000000000..2ffa5dadf --- /dev/null +++ b/app/views/general/_stylesheet_includes.rhtml @@ -0,0 +1,21 @@ + <%= stylesheet_link_tag 'main', :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 %> + <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> + <!--[if LT IE 7]> + <style type="text/css">@import url("/stylesheets/ie6.css");</style> + <![endif]--> + <!--[if LT IE 7]> + <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style> + <![endif]--> + <!--[if LT IE 8]> + <style type="text/css">@import url("/stylesheets/ie7.css");</style> + <![endif]--> + <!-- the following method for customising CSS is deprecated; see `doc/THEMES.md` for detail --> + <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> + <% if force_registration_on_new_request %> + <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %> + <% end %> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 5c3499c93..e4022661f 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -10,40 +10,19 @@ </title> <link rel="shortcut icon" href="/favicon.ico"> - <%= stylesheet_link_tag 'main', :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 is_admin? %> + <%= render :partial => 'general/stylesheet_includes' %> + <% if is_admin? %> <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %> - <% end %> - <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> + <% end %> + <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> <% if @profile_photo_javascript %> <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script> <script type="text/javascript" src="/javascripts/profile_photo.js"></script> <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" > <% end %> - <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> - <!--[if LT IE 7]> - <style type="text/css">@import url("/stylesheets/ie6.css");</style> - <![endif]--> - <!--[if LT IE 7]> - <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style> - <![endif]--> - <!--[if LT IE 8]> - <style type="text/css">@import url("/stylesheets/ie7.css");</style> - <![endif]--> - <!-- the following method for customising CSS is deprecated; see `doc/THEMES.md` for detail --> - <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> - <% if force_registration_on_new_request %> - <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %> - <% end %> - <% if @feed_autodetect %> <% for feed in @feed_autodetect %> <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>"> @@ -63,7 +42,6 @@ <%= render :partial => 'general/before_head_end' %> </head> <body class="<%= 'admin' if is_admin? %> <%= 'front' if params[:action] == 'frontpage' %>"> - <!-- XXX: move to a separate file --> <% if force_registration_on_new_request && !@user %> <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %> <script type="text/javascript"> @@ -79,7 +57,7 @@ if (typeof modal_signin_successful != 'undefined' ) { window.location.href = '<%= select_authority_url %>'; } - } + } }); }); </script> @@ -89,20 +67,19 @@ <%= render :partial => 'admin_general/admin_navbar' %> <% end %> -<% # code for popup advert for a campaign etc. -=begin - <div id="everypage" class="jshide"> - <p style="float:right"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;">Close</a></p> - [ message goes here ] - <p style="text-align: right"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;">Close</a></p> - </div> -=end -%> +<% if !@popup_banner.blank? %> +<div id="everypage" class="jshide"> + <p style="float:right"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p> + <%= @popup_banner %> + <p style="text-align: right"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p> +</div> +<% end %> + <div class="entirebody"> <div id="banner"> <div id="banner_inner"> <div class="lang"><%= render :partial => 'general/locale_switcher' %></div> - + <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %> <div id="logged_in_bar"> <% if @user %> @@ -120,19 +97,19 @@ <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %> <% end %> </div> - <% end %> + <% end %> <div id="navigation_search"> <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "navigation_search_form"}) do %> <p> <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %> - <%= image_submit_tag('search-button.png') %> + <%= submit_tag 'search', :id => "navigation_search_button" %> </p> <% end %> </div> - + <%= render :partial => 'general/orglink' %> - + <%= render :partial => 'general/topnav' %> </div> </div> @@ -163,7 +140,7 @@ </div> <% ga_code = MySociety::Config.get('GA_CODE', '') - + unless ga_code.empty? %> <script> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); @@ -173,10 +150,9 @@ var pageTracker = _gat._getTracker("<%=ga_code%>"); pageTracker._trackPageview(); </script> - + <% end %> <%= render :partial => 'general/before_body_end' %> </body> </html> - diff --git a/app/views/request/_after_actions.rhtml b/app/views/request/_after_actions.rhtml index 205b738de..15ca6302e 100644 --- a/app/views/request/_after_actions.rhtml +++ b/app/views/request/_after_actions.rhtml @@ -1,51 +1,52 @@ <div id="after_actions"> - + <h2><%= _('Things to do with this request') %></h2> <div id="anyone_actions"> <strong><%= _('Anyone:') %></strong> <ul> <li> - <%= _('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_url(:url_title => @info_request.url_title)] %> + <%= _('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_url(:url_title => @info_request.url_title)] %> </li> - <% if @old_unclassified %> + <% if @old_unclassified %> <li> <%= link_to _('Update the status of this request'), '#describe_state_form_1' %> </li> <% end %> <li> - <%= link_to _("Download a zip file of all correspondence"), download_entire_request_url(:url_title => @info_request.url_title) %> + <%= link_to _("Download a zip file of all correspondence"), download_entire_request_url(:url_title => @info_request.url_title) %> </li> </ul> </div> + <% if ! @info_request.is_external? %> + <div id="owner_actions"> + <strong><%= _('{{info_request_user_name}} only:',:info_request_user_name=>h(@info_request.user_name)) %></strong> + <ul> + + <li> + <% if @last_response.nil? %> + <%= link_to _("Send a followup"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %> + <% else %> + <%= link_to _("Write a reply"), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %> + <% end %> + </li> + <% if !@old_unclassified %> + <li> + <%= link_to _("Update the status of this request"), request_url(@info_request, :update_status => 1) %> + </li> + <% end %> + <li> + <%= link_to _("Request an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> + </li> + </ul> + </div> + <% end %> - <div id="owner_actions"> - <strong><%= _('{{info_request_user_name}} only:',:info_request_user_name=>h(@info_request.user.name)) %></strong> - <ul> - - <li> - <% if @last_response.nil? %> - <%= link_to _("Send a followup"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %> - <% else %> - <%= link_to _("Write a reply"), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %> - <% end %> - </li> - <% if !@old_unclassified %> - <li> - <%= link_to _("Update the status of this request"), request_url(@info_request, :update_status => 1) %> - </li> - <% end %> - <li> - <%= link_to _("Request an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> - </li> - </ul> - </div> - <div id="public_body_actions"> - <strong><%= _('{{public_body_name}} only:',:public_body_name=>h(@info_request.public_body.name) ) %> </strong> + <strong><%= _('{{public_body_name}} only:',:public_body_name=>h(@info_request.public_body.name) ) %> </strong> <ul> <li> - <%= link_to _("Respond to request"), upload_response_url(:url_title => @info_request.url_title) %> + <%= link_to _("Respond to request"), upload_response_url(:url_title => @info_request.url_title) %> </li> </ul> </div> diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml index 9a198ad7d..bcfc93657 100644 --- a/app/views/request/_correspondence.rhtml +++ b/app/views/request/_correspondence.rhtml @@ -33,14 +33,14 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>"> <h2> - <%= _("From:") %> <%=h @info_request.user.name %><br> + <%= _("From:") %> <%=h @info_request.user_name %><br> <br><%= simple_date(info_request_event.created_at) %> </h2> <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil } %> <p class="event_actions"> - <% if outgoing_message.status == 'ready' %> + <% if outgoing_message.status == 'ready' && !@info_request.is_external? %> <strong>Warning:</strong> This message has <strong>not yet been sent</strong> for an unknown reason. <% end %> diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 71699835c..5b6004e81 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -104,9 +104,11 @@ <% elsif @old_unclassified %> <%= render :partial => 'other_describe_state', :locals => {:id_suffix => id_suffix } %> <% else %> -<%= _('We don\'t know whether the most recent response to this request contains + <% if !@info_request.is_external? %> + <%= _('We don\'t know whether the most recent response to this request contains information or not – if you are {{user_link}} please <a href="{{url}}">sign in</a> and let everyone know.',:user_link=>user_link(@info_request.user), :url=>signin_url(:r => request.request_uri)) %> + <% end %> <% end %> diff --git a/app/views/request/followup_bad.rhtml b/app/views/request/followup_bad.rhtml index 306eddd10..7efa3f826 100644 --- a/app/views/request/followup_bad.rhtml +++ b/app/views/request/followup_bad.rhtml @@ -25,6 +25,9 @@ one on their website, or by phoning them up and asking. If you manage to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path] %> </p> +<% elsif @reason == 'external' %> + <p><%= _("Followups cannot be sent for this request, as it was made externally, and published here by {{public_body_name}} on the requester's behalf.", :public_body_name => h(@info_request.public_body.name)) %> + </p> <% else %> <% raise _("unknown reason ") + @reason %> <% end %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index 27ad0700e..cf1f971d9 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -16,7 +16,7 @@ <% end %> -<% if @update_status || @info_request.awaiting_description %> +<% if ( @update_status || @info_request.awaiting_description ) && ! @info_request.is_external? %> <div class="describe_state_form" id="describe_state_form_1"> <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %> </div> @@ -27,7 +27,7 @@ <div id="left_column"> <h1><%=h(@info_request.title)%></h1> - <% if @info_request.user.profile_photo %> + <% if !@info_request.is_external? && @info_request.user.profile_photo %> <p class="user_photo_on_request"> <img src="<%= get_profile_photo_url(:url_name => @info_request.user.url_name) %>" alt=""> </p> @@ -35,60 +35,62 @@ <p class="subtitle"> <% if !@user.nil? && @user.admin_page_links? %> - <%= _('{{user}} (<a href="{{user_admin_url}}">admin</a>) made this {{law_used_full}} request (<a href="{{request_admin_url}}">admin</a>) to {{public_body_link}} (<a href="{{public_body_admin_url}}">admin</a>)', - :user => user_link(@info_request.user), + <%= _('{{user}} ({{user_admin_link}}) made this {{law_used_full}} request (<a href="{{request_admin_url}}">admin</a>) to {{public_body_link}} (<a href="{{public_body_admin_url}}">admin</a>)', + :user => @info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user), :law_used_full => h(@info_request.law_used_full), - :user_admin_url => user_admin_url(@info_request.user), + :user_admin_link => user_admin_link_for_request(@info_request, _('external'), _('admin')), :request_admin_url => request_admin_url(@info_request), :public_body_link => public_body_link(@info_request.public_body), :public_body_admin_url => public_body_admin_url(@info_request.public_body)) %> <% else %> - <%= _('{{user}} made this {{law_used_full}} request',:user=>user_link(@info_request.user), :law_used_full=>h(@info_request.law_used_full)) %> - <%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %> + <%= _('{{user}} made this {{law_used_full}} request',:user=>@info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user), :law_used_full=>h(@info_request.law_used_full)) %> + <%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %> <% end %> </p> <p id="request_status" class="request_icon_line icon_<%= @info_request.calculate_status %>"> <% if @info_request.awaiting_description %> - <% if @is_owning_user %> - <%= _('Please <strong>answer the question above</strong> so we know whether the ')%> + <% if @is_owning_user && !@info_request.is_external? %> + <%= _('Please <strong>answer the question above</strong> so we know whether the ')%> <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> <%= _('useful information.') %> <% else %> <%= _('This request has an <strong>unknown status</strong>.') %> <% if @old_unclassified %> - <%= _('We\'re waiting for someone to read') %> + <%= _('We\'re waiting for someone to read') %> <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> <%= _('and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?') %> <% else %> <%= _('We\'re waiting for') %> - <%= user_link(@info_request.user) %> <%= _('to read') %> - <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> + <%= user_link_for_request(@info_request) %> <%= _('to read') %> + <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> <%= _('and update the status.') %> <% end %> <% end %> <% elsif @status == 'waiting_response' %> - <%= _('Currently <strong>waiting for a response</strong> from {{public_body_link}}, they must respond promptly and', :public_body_link=> public_body_link(@info_request.public_body)) %> + <%= _('Currently <strong>waiting for a response</strong> from {{public_body_link}}, they must respond promptly and', :public_body_link=> public_body_link(@info_request.public_body)) %> <% if @info_request.public_body.is_school? %> <%= _('in term time') %> <% else %> - <%= _('normally') %> + <%= _('normally') %> <% end %> <%= _('no later than') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong> (<%= 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)) %> + <%= _('By law, {{public_body_link}} should normally have responded <strong>promptly</strong> and',:public_body_link=>public_body_link(@info_request.public_body)) %> <% if @info_request.public_body.is_school? %> - <%= _('in term time') %> + <%= _('in term time') %> <% end %> <%= _('by') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong> - (<%= _('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response'] %>) + (<%= _('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response'] %>) <% elsif @status == 'waiting_response_very_overdue' %> - <%= _('Response to this request is <strong>long overdue</strong>.') %> - <%= _('By law, under all circumstances, {{public_body_link}} should have responded by now',:public_body_link => public_body_link(@info_request.public_body)) %> + <%= _('Response to this request is <strong>long overdue</strong>.') %> + <%= _('By law, under all circumstances, {{public_body_link}} should have responded by now',:public_body_link => public_body_link(@info_request.public_body)) %> (<%= _('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response'] %>). - <%= _('You can <strong>complain</strong> by') %> - <%= link_to _("requesting an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>. + <% if !@info_request.is_external? %> + <%= _('You can <strong>complain</strong> by') %> + <%= link_to _("requesting an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>. + <% end %> <% elsif @status == 'not_held' %> <%= public_body_link(@info_request.public_body) %> <%= _('<strong>did not have</strong> the information requested.') %> <% elsif @status == 'rejected' %> @@ -98,26 +100,28 @@ <% elsif @status == 'partially_successful' %> <%= _('The request was <strong>partially successful</strong>.') %> <% elsif @status == 'waiting_clarification' %> - <% if @is_owning_user %> - <%=h @info_request.public_body.name %> <%= _('is <strong>waiting for your clarification</strong>.') %> + <% if @is_owning_user && !@info_request.is_external? %> + <%=h @info_request.public_body.name %> <%= _('is <strong>waiting for your clarification</strong>.') %> <%= _('Please') %> <%= link_to _("send a follow up message"), respond_to_last_url(@info_request) + '#followup' %>. <% else %> - <%= _('The request is <strong>waiting for clarification</strong>.') %> - <%= _('If you are {{user_link}}, please',:user_link=>user_link(@info_request.user)) %> - <%= link_to _("sign in"), signin_url(:r => request.request_uri) %> <%= _('to send a follow up message.') %> + <%= _('The request is <strong>waiting for clarification</strong>.') %> + <% if !@info_request.is_external? %> + <%= _('If you are {{user_link}}, please',:user_link=>user_link_for_request(@info_request)) %> + <%= link_to _("sign in"), signin_url(:r => request.request_uri) %> <%= _('to send a follow up message.') %> + <% end %> <% end %> <% elsif @status == 'gone_postal' %> <%= _('The authority would like to / has <strong>responded by post</strong> to this request.') %> <% elsif @status == 'internal_review' %> - <%= _('Waiting for an <strong>internal review</strong> by {{public_body_link}} of their handling of this request.',:public_body_link=>public_body_link(@info_request.public_body)) %> + <%= _('Waiting for an <strong>internal review</strong> by {{public_body_link}} of their handling of this request.',:public_body_link=>public_body_link(@info_request.public_body)) %> <% elsif @status == 'error_message' %> <%= _('There was a <strong>delivery error</strong> or similar, which needs fixing by the {{site_name}} team.', :site_name=>site_name) %> <% elsif @status == 'requires_admin' %> <%= _('This request has had an unusual response, and <strong>requires attention</strong> from the {{site_name}} team.', :site_name=>site_name) %> <% 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.') %> + <%= _('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' %> @@ -135,7 +139,7 @@ <% end %> <% end %> - <% if @info_request.awaiting_description %> + <% if @info_request.awaiting_description && ! @info_request.is_external? %> <div class="describe_state_form" id="describe_state_form_2"> <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %> </div> diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml index d8647d1ec..c40b37c3b 100644 --- a/app/views/request/show_response.rhtml +++ b/app/views/request/show_response.rhtml @@ -1,9 +1,9 @@ <% if @incoming_message.nil? %> - <% @title = "Send follow up to '" + h(@info_request.title) + "'" %> + <% @title = _("Send follow up to '{{title}}'", :title => h(@info_request.title)) %> <% elsif @incoming_message.recently_arrived %> - <% @title = "New response to '" + h(@info_request.title) + "'" %> + <% @title = _("New response to '{{title}}'", :title => h(@info_request.title)) %> <% else %> - <% @title = "Response to '" + h(@info_request.title) + "'" %> + <% @title = _("Response to '{{title}}'", :title => h(@info_request.title)) %> <% end %> <%= foi_error_messages_for :incoming_message, :outgoing_message %> @@ -34,11 +34,11 @@ <%= _('You want to <strong>give your postal address</strong> to the authority in private.') %> </dt> <dd> - <%= _('To do that please send a private email to ') %><%=h(@postal_email_name)%> + <%= _('To do that please send a private email to ') %><%=h(@postal_email_name)%> <<%=link_to h(@postal_email), "mailto:" + @postal_email%>> <%= _('containing your postal address, and asking them to reply to this request. Or you could phone them.') %> - + <%= _('When you receive the paper response, please help others find out what it says:') %> <ul> @@ -68,7 +68,7 @@ <h2>Response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'</h2> <% end %> <% end %> - + <% if @incoming_message.nil? %> <%= render :partial => 'correspondence', :locals => { :info_request_event => @info_request.get_last_outgoing_event, :incoming_message => nil } %> <% else %> diff --git a/app/views/request/simple_correspondence.rhtml b/app/views/request/simple_correspondence.rhtml index 45b90b84b..bcbc795e7 100644 --- a/app/views/request/simple_correspondence.rhtml +++ b/app/views/request/simple_correspondence.rhtml @@ -4,16 +4,16 @@ <% incoming_message = nil if info_request_event.visible - if !info_request_event.nil? && info_request_event.event_type == 'response' - incoming_message = info_request_event.incoming_message - end + if !info_request_event.nil? && info_request_event.event_type == 'response' + incoming_message = info_request_event.incoming_message + end if not incoming_message.nil? if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %> <%= _('From:') %> <%= incoming_message.safe_mail_from %><% end if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>, <%= @info_request.public_body.name %><% end %> -<%= _('To:') %> <%= @info_request.user.name %> +<%= _('To:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %> <%= _('Date:') %> <%= simple_date(incoming_message.sent_at) %> <%= incoming_message.get_body_for_quoting %> @@ -24,7 +24,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) outgoing_message = info_request_event.outgoing_message %> -<%= _('From:') %> <%= @info_request.user.name %> +<%= _('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) %> <% @@ -36,7 +36,7 @@ elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type) <%= _('Date:') %> <%= simple_date(info_request_event.created_at) %> Sent <% if info_request_event.outgoing_message.message_type == 'initial_request' %> request <% elsif info_request_event.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 %>. -<% elsif info_request_event.event_type == 'comment' +<% elsif info_request_event.event_type == 'comment' comment = info_request_event.comment %> <%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date(comment.created_at || Time.now) %>) diff --git a/app/views/request/upload_response.rhtml b/app/views/request/upload_response.rhtml index 38c3db268..697ff99aa 100644 --- a/app/views/request/upload_response.rhtml +++ b/app/views/request/upload_response.rhtml @@ -1,45 +1,52 @@ -<% @title = "Respond to the FOI request '" + h(@info_request.title) + "' made by " + h(@info_request.user.name) %> +<% @title = "Respond to the FOI request '" + h(@info_request.title) + "' made by " + h(@info_request.user_name) %> -<%= foi_error_messages_for :comment %> +<% if @info_request.is_external? %> -<h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1> + <h1><%= _('This request was not made via {{site_name}}', :site_name => site_name) %></h1> + <p><%= _('Sorry - you cannot respond to this request via {{site_name}}, because this is a copy of the request originally at {{link_to_original_request}}.', :site_name => site_name, :link_to_original_request => link_to(@info_request.external_url, @info_request.external_url)) %></p> -<p> - <%= _('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.')% [help_officers_path] %> -</p> +<% else %> -<h2><%= _('Respond by email')%></h2> + <%= foi_error_messages_for :comment %> -<p><%= _('You should have received a copy of the request by email, and you can respond -by <strong>simply replying</strong> to that email. For your convenience, here is the address:')%> -<a href="mailto:<%=h @info_request.incoming_email%>"><%=h @info_request.incoming_email%></a>. -<%= _('You may <strong>include attachments</strong>. If you would like to attach a -file too large for email, use the form below.')%> -</p> + <h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1> + <p> + <%= _('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.')% [help_officers_path] %> + </p> -<h2><%= _('Respond using the web')%></h2> + <h2><%= _('Respond by email')%></h2> -<p><%= _('Enter your response below. You may attach one file (use email, or -<a href="%s">contact us</a> if you need more).')% [help_contact_path] %></p> + <p><%= _('You should have received a copy of the request by email, and you can respond + by <strong>simply replying</strong> to that email. For your convenience, here is the address:')%> + <a href="mailto:<%=h @info_request.incoming_email%>"><%=h @info_request.incoming_email%></a>. + <%= _('You may <strong>include attachments</strong>. If you would like to attach a + file too large for email, use the form below.')%> + </p> -<% form_tag '', :id => 'upload_response_form', :multipart => true do %> - <p> - <label class="form_label" for="body"><% _('Response:')%></label> - <%= text_area_tag :body, "", :rows => 10, :cols => 55 %> - </p> - <p> - <label class="form_label" for="file_1"><% _('Attachment (optional):')%></label> - <%= file_field_tag :file_1, :size => 35 %> - </p> + <h2><%= _('Respond using the web')%></h2> - <p> - <%= hidden_field_tag 'submitted_upload_response', 1 %> - <%= submit_tag "Upload FOI response" %> - <%= _(' (<strong>patience</strong>, especially for large files, it may take a while!)')%> - </p> + <p><%= _('Enter your response below. You may attach one file (use email, or + <a href="%s">contact us</a> if you need more).')% [help_contact_path] %></p> + <% form_tag '', :id => 'upload_response_form', :multipart => true do %> + <p> + <label class="form_label" for="body"><% _('Response:')%></label> + <%= text_area_tag :body, "", :rows => 10, :cols => 55 %> + </p> + + <p> + <label class="form_label" for="file_1"><% _('Attachment (optional):')%></label> + <%= file_field_tag :file_1, :size => 35 %> + </p> + + <p> + <%= hidden_field_tag 'submitted_upload_response', 1 %> + <%= submit_tag "Upload FOI response" %> + <%= _(' (<strong>patience</strong>, especially for large files, it may take a while!)')%> + </p> + <% end %> <% end %> diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index 089b778f8..2c2e3c957 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -18,14 +18,14 @@ # e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008) if event.event_type == 'response' url = main_url(incoming_message_url(event.incoming_message)) - main_text += _("{{public_body}} sent a response to {{user_name}}", :public_body => event.info_request.public_body.name, :user_name => event.info_request.user.name) + main_text += _("{{public_body}} sent a response to {{user_name}}", :public_body => event.info_request.public_body.name, :user_name => event.info_request.user_name) elsif event.event_type == 'followup_sent' url = main_url(outgoing_message_url(event.outgoing_message)) - main_text += _("{{user_name}} sent a follow up message to {{public_body}}", :user_name => event.info_request.user.name, :public_body => event.info_request.public_body.name) + main_text += _("{{user_name}} sent a follow up message to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name) elsif event.event_type == 'sent' # this is unlikely to happen in real life, but happens in the test code url = main_url(outgoing_message_url(event.outgoing_message)) - main_text += _("{{user_name}} sent a request to {{public_body}}", :user_name => event.info_request.user.name, :public_body => event.info_request.public_body.name) + main_text += _("{{user_name}} sent a request to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name) elsif event.event_type == 'comment' url = main_url(comment_url(event.comment)) main_text += _("{{user_name}} added an annotation", :user_name => event.comment.user.name) diff --git a/app/views/user/_show_user_info.rhtml b/app/views/user/_show_user_info.rhtml new file mode 100644 index 000000000..5dfecee1e --- /dev/null +++ b/app/views/user/_show_user_info.rhtml @@ -0,0 +1,20 @@ + + <% if !@display_user.get_about_me_for_html_display.empty? || @is_you %> + <div class="user_about_me"> + <img class="comment_quote" src="/images/quote.png" alt=""> + <%= @display_user.get_about_me_for_html_display %> + <% if @is_you %> + (<%= link_to _("edit text about you"), set_profile_about_me_url() %>) + <% end %> + </div> + <% end %> + + <% if @is_you %> + <p id="user_change_password_email"> + <% if @display_user.profile_photo %> + <%= link_to _('Change profile photo'), set_profile_photo_url() %> | + <% end %> + <%= link_to _('Change your password'), signchangepassword_url() %> | + <%= link_to _('Change your email'), signchangeemail_url() %> + </p> + <% end %> diff --git a/app/views/user/contact.rhtml b/app/views/user/contact.rhtml index 4bbb15789..333b72334 100644 --- a/app/views/user/contact.rhtml +++ b/app/views/user/contact.rhtml @@ -9,21 +9,21 @@ <% form_for :contact do |f| %> <div class="form_note"> - <h1>Contact <%=h @recipient_user.name%></h1> + <h1><%= _("Contact {{recipient}}", :recipient => h(@recipient_user.name)) %></h1> </div> <p> - <label class="form_label">From:</label> + <label class="form_label"><%= _("From") %>:</label> <%= h(@user.name_and_email) %> </p> <p> - <label class="form_label" for="contact_subject">Subject:</label> + <label class="form_label" for="contact_subject"><%= _("Subject") %>:</label> <%= f.text_field :subject, :size => 50 %> </p> <p> - <label class="form_label" for="contact_message">Message:</label> + <label class="form_label" for="contact_message"><%= _("Message") %>:</label> <%= f.text_area :message, :rows => 10, :cols => 50 %> </p> @@ -39,9 +39,7 @@ <div class="form_button"> <%= hidden_field_tag(:submitted_contact_form, { :value => 1 } ) %> - <%= submit_tag "Send message" %> + <%= submit_tag _("Send message") %> </div> <% end %> - - diff --git a/app/views/user/set_crop_profile_photo.rhtml b/app/views/user/set_crop_profile_photo.rhtml index db18d10a1..eed0304d2 100644 --- a/app/views/user/set_crop_profile_photo.rhtml +++ b/app/views/user/set_crop_profile_photo.rhtml @@ -20,7 +20,7 @@ <div style="width:96px;height:96px;overflow:hidden;"> <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>" id="profile_photo_preview" /> </div> - + </td> </tr> </table> @@ -32,12 +32,12 @@ <%= hidden_field_tag 'draft_profile_photo_id', @draft_profile_photo.id %> - <p><%= _('<strong>Privacy note:</strong> Your photo will be shown in public on the Internet, + <p><%= _('<strong>Privacy note:</strong> Your photo will be shown in public on the Internet, wherever you do something on {{site_name}}.', :site_name=>site_name)%> <p> <%= hidden_field_tag 'submitted_crop_profile_photo', 1 %> - <%= submit_tag "Done >>" %> + <%= submit_tag _("Done") + " >>" %> </p> <% end %> diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml index 90be49600..b3faba7fc 100644 --- a/app/views/user/set_draft_profile_photo.rhtml +++ b/app/views/user/set_draft_profile_photo.rhtml @@ -10,12 +10,12 @@ <% form_tag 'set_photo', :id => 'set_draft_profile_photo_form', :multipart => true do %> <p> - <label class="form_label" for="file_1"><%= _('Photo of you:')%></label> + <label class="form_label" for="file_1"><%= _('Photo of you:')%></label> <%= file_field_tag :file, :size => 35, :id => 'file_1' %> </p> <ul> - <li><%= _('Your photo will be shown in public <strong>on the Internet</strong>, + <li><%= _('Your photo will be shown in public <strong>on the Internet</strong>, wherever you do something on {{site_name}}.', :site_name=>site_name)%> </li> @@ -36,7 +36,7 @@ <noscript> <div> <%= hidden_field_tag 'automatically_crop', 1 %> - <%= submit_tag "Done >>" %> + <%= submit_tag _("Done >>") %> </div> </noscript> <% end %> @@ -46,7 +46,7 @@ <h2><%= _('OR remove the existing photo')%></h2> <% form_tag 'clear_photo', :id => 'clear_profile_photo_form', :multipart => true do %> - <%= submit_tag "Clear photo" %> + <%= submit_tag _("Clear photo") %> <% end %> <% end %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index d723196d3..12a9d3f74 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -1,14 +1,14 @@ <% if @show_requests %> - <% @title = h(@display_user.name) + _(" - Freedom of Information requests") %> + <% @title = _("{{user_name}} - Freedom of Information requests", :user_name => h(@display_user.name)) %> <% else %> - <% @title = h(@display_user.name) + _(" - user profile") %> + <% @title = _("{{user_name}} - user profile", :user_name => h(@display_user.name)) %> <% end %> <% if (@same_name_users.size >= 1) %> - <p><%= _('There is <strong>more than one person</strong> who uses this site and has this name. + <p><%= _('There is <strong>more than one person</strong> who uses this site and has this name. One of them is shown below, you may mean a different one:')%> <% for @same_name_user in @same_name_users %> <%= user_link(@same_name_user) %> - <% end %> + <% end %> <% end%> <% if @show_profile && @is_you && @undescribed_requests.size > 0 %> @@ -40,11 +40,11 @@ <a href="#foi_requests"><%= _('FOI requests')%></a> <br><a href="#annotations"><%= _('Annotations')%></a> <% end %> - </div> + </div> <div class="header_left"> <p id="user_photo_on_profile"> - <% if @display_user.profile_photo %> + <% if @display_user.profile_photo %> <% if @is_you %> <a href="<%= set_profile_photo_url() %>"> <% end %> @@ -93,25 +93,7 @@ </div> <% end %> - <% if !@display_user.get_about_me_for_html_display.empty? || @is_you %> - <div class="user_about_me"> - <img class="comment_quote" src="/images/quote.png" alt=""> - <%= @display_user.get_about_me_for_html_display %> - <% if @is_you %> - (<%= link_to _("edit text about you"), set_profile_about_me_url() %>) - <% end %> - </div> - <% end %> - - <% if @is_you %> - <p id="user_change_password_email"> - <% if @display_user.profile_photo %> - <%= link_to _('Change profile photo'), set_profile_photo_url() %> | - <% end %> - <%= link_to _('Change your password'), signchangepassword_url() %> | - <%= link_to _('Change your email'), signchangeemail_url() %> - </p> - <% end %> + <%= render :partial => 'user/show_user_info' %> <% if not @is_you %> <p id="user_not_logged_in"> @@ -127,7 +109,7 @@ <div id="user_profile_search"> <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %> <div> - <%= text_field_tag(:user_query, params[:user_query]) %> + <%= text_field_tag(:user_query, params[:user_query]) %> <% if @is_you %> <%= submit_tag(_("Search your contributions")) %> <% else %> @@ -146,7 +128,7 @@ <% end %> <% else %> <h2 class="foi_results" id="foi_requests"> - <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.matches_estimated.to_s) % @xapian_requests.matches_estimated.to_s : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.matches_estimated.to_s) % @xapian_requests.matches_estimated %> + <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.matches_estimated) % @xapian_requests.matches_estimated.to_s : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.matches_estimated) % @xapian_requests.matches_estimated %> <!-- matches_estimated <%=@xapian_requests.matches_estimated%> --> <%= @match_phrase %> <%= @page_desc %> @@ -159,12 +141,12 @@ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %> <% end %> - <% else %> + <% else %> <% if @show_requests %> <h2 class="foi_results" id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> </h2> <p><%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%></p> <% end %> - <% end %> + <% end %> <% if !@xapian_comments.nil? %> <% if @xapian_comments.results.empty? %> @@ -221,7 +203,7 @@ <%= hidden_field_tag 'r', request.request_uri %> <% if track_things.size > 1 %> <%= submit_tag _('unsubscribe all')%> - <% end %> + <% end %> </h3> <% end %> <% end %> @@ -231,7 +213,7 @@ <li> <% form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %> <div> - <%= track_thing.params[:list_description] %> + <%= track_thing.params[:list_description] %> <%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %> <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s } %> <%= submit_tag _('unsubscribe') %> |