diff options
Diffstat (limited to 'app')
28 files changed, 257 insertions, 196 deletions
diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico Binary files differnew file mode 100644 index 000000000..26127495c --- /dev/null +++ b/app/assets/images/favicon.ico diff --git a/app/assets/images/small-green-cross.png b/app/assets/images/small-green-cross.png Binary files differnew file mode 100644 index 000000000..5868f5775 --- /dev/null +++ b/app/assets/images/small-green-cross.png diff --git a/app/assets/javascripts/general.js b/app/assets/javascripts/general.js index b52131b83..529bbeb04 100644 --- a/app/assets/javascripts/general.js +++ b/app/assets/javascripts/general.js @@ -2,49 +2,56 @@ $(document).ready(function() { // flash message for people coming from other countries if(window.location.search.substring(1).search("country_name") == -1) { if (!$.cookie('has_seen_country_message')) { - $.ajax({ - url: "/country_message", - dataType: 'html', - success: function(country_message){ - if (country_message != ''){ - $('#other-country-notice').html(country_message); - $('body:not(.front) #other-country-notice').show() - } - } - }) + $.ajax({ + url: "/country_message", + dataType: 'html', + success: function(country_message){ + if (country_message != ''){ + $('#other-country-notice .popup-content').html(country_message); + $('body:not(.front) #other-country-notice').show() + } + } + }) } } - $('#other-country-notice').click(function() { - $('#other-country-notice').hide(); - $.cookie('has_seen_country_message', 1, {expires: 365, path: '/'}); + // popup messages + $('#other-country-notice .popup-close').click(function() { + $('#other-country-notice').hide('slow'); + $.cookie('has_seen_country_message', 1, {expires: 365, path: '/'}); }); + $('#everypage .popup-close').click(function() { + $('#everypage').hide('slow'); + $.cookie('seen_foi2', 1, { expires: 7, path: '/' }); + return false; + }); + // "link to this" widget $('a.link_to_this').click(function() { - var box = $('div#link_box'); - var location = window.location.protocol + "//" + window.location.hostname + $(this).attr('href'); - box.width(location.length + " em"); - box.find('input').val(location).attr('size', location.length + " em"); - box.show(); - box.find('input').select(); - box.position({ - my: "left top", - at: "left bottom", - of: this, - collision: "fit" }); - return false; - }); - + var box = $('div#link_box'); + var location = window.location.protocol + "//" + window.location.hostname + $(this).attr('href'); + box.width(location.length + " em"); + box.find('input').val(location).attr('size', location.length + " em"); + box.show(); + box.find('input').select(); + box.position({ + my: "left top", + at: "left bottom", + of: this, + collision: "fit" }); + return false; + }); + $('.close-button').click(function() { $(this).parent().hide() }); $('div#variety-filter a').each(function() { - $(this).click(function() { - var form = $('form#search_form'); - form.attr('action', $(this).attr('href')); - form.submit(); - return false; - }) - }) + $(this).click(function() { + var form = $('form#search_form'); + form.attr('action', $(this).attr('href')); + form.submit(); + return false; + }) + }) if($.cookie('seen_foi2') == 1) { $('#everypage').hide(); diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 584b0d00d..b0de2eb7b 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -22,12 +22,8 @@ body.admin { /* When the admin stylesheet is loaded (and so the user is seeing the admin navbar), pad the banner of the front end interface so that it isn't hidden, and move any special notice down too. */ -.entirebody, #banner { - padding-top: 50px; -} - -#special-notice { - margin-top: 50px; +.entirebody { + padding-top: 42px; } .admin { diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 625245cce..6405d1dc3 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -8,7 +8,6 @@ padding:0; } #banner { -position:absolute; top:0; background-color:#F3F3F3; left:0; @@ -121,7 +120,6 @@ clear:both; top:0; text-align:left; overflow:visible; -padding-top:160px; width:900px; margin:0 auto 1.2em; } @@ -719,28 +717,45 @@ margin:60px 0 0; padding:0.5em 0; } -#everypage { -background-color:#fc9; -border:solid 2px #f60; -border-top:none; -opacity:0.97; -border-bottom-left-radius:10px; -border-bottom-right-radius:10px; -position:fixed; -width:70%; -left:15%; +.popup { +background-color:#D5FFD8; +border:solid 3px #16C132; z-index:2000; -max-height:95%; overflow:auto; -padding:4px; +text-align:center; +margin-top:2px; +} + +.popup .popup-content{ +margin:0.5em; +width: 95%; +float: left; +} + +.popup p { +margin: 0; } #everypage h2,#everypage h3 { margin:0.5em 0; } -#everypage .popup-close { - text-align: right; + +.popup .popup-close { +color:#FFF; +text-decoration:none; +display:inline-block; +border-radius:2px; +-moz-border-radius:2px; +cursor:pointer; +background: image-url('small-green-cross.png') no-repeat 0; +width:15px; +height:15px; +border:solid 0 #FFF; +text-indent:-999px; +overflow:hidden; +float:right; +padding:10px 0; } #game_sidebar { @@ -1568,17 +1583,6 @@ cursor:pointer; opacity:1; } -#other-country-notice { -background:#222; -color:#FFF; -font-size:1.1em; -width:100%; -z-index:999; -display:block; -position:absolute; -top:0; -opacity:0.9; -} p.public-body-name-prefix { color:#888; @@ -1587,10 +1591,6 @@ margin-bottom:-15px; font-size: 1.2em; } -#other-country-notice a { -color:#FFF; -} - .close-button { color:#FFF; text-decoration:none; diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 4d45ced8b..2f5f51c0f 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -26,15 +26,13 @@ class AdminRequestController < AdminController def show @info_request = InfoRequest.find(params[:id]) - # XXX is this *really* the only way to render a template to a - # variable, rather than to the response? - vars = OpenStruct.new(:name_to => @info_request.user_name, - :name_from => AlaveteliConfiguration::contact_name, - :info_request => @info_request, :reason => params[:reason], - :info_request_url => 'http://' + AlaveteliConfiguration::domain + request_url(@info_request), - :site_name => site_name) - template = File.read(File.join(File.dirname(__FILE__), "..", "views", "admin_request", "hidden_user_explanation.html.erb")) - @request_hidden_user_explanation = ERB.new(template).result(vars.instance_eval { binding }) + vars_for_explanation = {:reason => params[:reason], + :info_request => @info_request, + :name_to => @info_request.user_name, + :name_from => AlaveteliConfiguration::contact_name, + :info_request_url => request_url(@info_request, :only_path => false)} + @request_hidden_user_explanation = render_to_string(:template => "admin_request/hidden_user_explanation", + :locals => vars_for_explanation) end def resend diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 649075568..b79ead73d 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -324,7 +324,7 @@ class RequestController < ApplicationController if !authenticated?( :web => _("To send your FOI request").to_str, :email => _("Then your FOI request to {{public_body_name}} will be sent.",:public_body_name=>@info_request.public_body.name), - :email_subject => _("Confirm your FOI request to ") + @info_request.public_body.name + :email_subject => _("Confirm your FOI request to {{public_body_name}}",:public_body_name=>@info_request.public_body.name) ) # do nothing - as "authenticated?" has done the redirect to signin page for us return diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 11ed4ac8f..78c494dba 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -24,9 +24,6 @@ class ServicesController < ApplicationController FastGettext.locale = old_fgt_locale end end - if !text.empty? - text += ' <span class="close-button">X</span>'.html_safe - end render :text => text, :content_type => "text/plain" # XXX workaround the HTML validation in test suite end diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index 8df28f350..405886a85 100755 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -121,24 +121,37 @@ module LinkToHelper end def user_link_absolute(user) - link_to h(user.name), user_url(user) + link_to user.name, user_url(user) end def user_link(user) - link_to h(user.name), user_path(user) + link_to user.name, user_path(user) end - def request_user_link_absolute(request) + def external_user_link(request, absolute, text) + if request.external_user_name + request.external_user_name + else + if absolute + url = help_privacy_url(:anchor => 'anonymous') + else + url = help_privacy_path(:anchor => 'anonymous') + end + link_to(text, url) + end + end + + def request_user_link_absolute(request, anonymous_text=_("Anonymous user")) if request.is_external? - request.external_user_name || _("Anonymous user") + external_user_link(request, absolute=true, anonymous_text) else user_link_absolute(request.user) end end - def request_user_link(request) + def request_user_link(request, anonymous_text=_("Anonymous user")) if request.is_external? - request.external_user_name || _("Anonymous user") + external_user_link(request, absolute=false, anonymous_text) else user_link(request.user) end diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index bcf0b6ec9..59e61952e 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -385,6 +385,10 @@ class IncomingMessage < ActiveRecord::Base multiline_original_message = '(' + '''>>>.* \d\d/\d\d/\d\d\d\d\s+\d\d:\d\d(?::\d\d)?\s*>>>''' + ')' text.gsub!(/^(#{multiline_original_message}\n.*)$/m, replacement) + # On Thu, Nov 28, 2013 at 9:08 AM, A User + # <[1]request-7-skm40s2ls@xxx.xxxx> wrote: + text.gsub!(/^( On [^\n]+\n\s*\<[^>\n]+\> (wrote|said):\s*\n.*)$/m, replacement) + # Single line sections text.gsub!(/^(>.*\n)/, replacement) text.gsub!(/^(On .+ (wrote|said):\n)/, replacement) diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 4624cefaf..eadb66d54 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -113,8 +113,12 @@ class InfoRequest < ActiveRecord::Base # Possible reasons that a request could be reported for administrator attention def report_reasons - ["Contains defamatory material", "Not a valid request", "Request for personal information", - "Contains personal information", "Vexatious", "Other"] + [_("Contains defamatory material"), + _("Not a valid request"), + _("Request for personal information"), + _("Contains personal information"), + _("Vexatious"), + _("Other")] end def must_be_valid_state diff --git a/app/models/profile_photo.rb b/app/models/profile_photo.rb index 322ebe53c..6c3b2cfa0 100644 --- a/app/models/profile_photo.rb +++ b/app/models/profile_photo.rb @@ -70,21 +70,25 @@ class ProfilePhoto < ActiveRecord::Base def data_and_draft_checks if self.data.nil? - errors.add(:data, N_("Please choose a file containing your photo.")) + errors.add(:data, _("Please choose a file containing your photo.")) return end if self.image.nil? - errors.add(:data, N_("Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported.")) + errors.add(:data, _("Couldn't understand the image file that you uploaded. PNG, JPEG, GIF and many other common image file formats are supported.")) return end if self.image.format != 'PNG' - errors.add(:data, N_("Failed to convert image to a PNG")) + errors.add(:data, _("Failed to convert image to a PNG")) end if !self.draft && (self.image.columns != WIDTH || self.image.rows != HEIGHT) - errors.add(:data, N_("Failed to convert image to the correct size: at {{cols}}x{{rows}}, need {{width}}x{{height}}", :cols => self.image.columns, :rows => self.image.rows, :width => WIDTH, :height => HEIGHT)) + errors.add(:data, _("Failed to convert image to the correct size: at {{cols}}x{{rows}}, need {{width}}x{{height}}", + :cols => self.image.columns, + :rows => self.image.rows, + :width => WIDTH, + :height => HEIGHT)) end if self.draft && self.user_id diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 933825d2a..a78a6677e 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -346,22 +346,26 @@ class PublicBody < ActiveRecord::Base # The "internal admin" is a special body for internal use. def PublicBody.internal_admin_body - I18n.with_locale(I18n.default_locale) do - pb = PublicBody.find_by_url_name("internal_admin_authority") - if pb.nil? - pb = PublicBody.new( - :name => 'Internal admin authority', - :short_name => "", - :request_email => AlaveteliConfiguration::contact_email, - :home_page => "", - :notes => "", - :publication_scheme => "", - :last_edit_editor => "internal_admin", - :last_edit_comment => "Made by PublicBody.internal_admin_body" - ) - pb.save! + # Use find_by_sql to avoid the search being specific to a + # locale, since url_name is a translated field: + sql = "SELECT * FROM public_bodies WHERE url_name = 'internal_admin_authority'" + matching_pbs = PublicBody.find_by_sql sql + case + when matching_pbs.empty? then + I18n.with_locale(I18n.default_locale) do + PublicBody.create!(:name => 'Internal admin authority', + :short_name => "", + :request_email => AlaveteliConfiguration::contact_email, + :home_page => "", + :notes => "", + :publication_scheme => "", + :last_edit_editor => "internal_admin", + :last_edit_comment => "Made by PublicBody.internal_admin_body") end - return pb + when matching_pbs.length == 1 then + matching_pbs[0] + else + raise "Multiple public bodies (#{matching_pbs.length}) found with url_name 'internal_admin_authority'" end end diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index 8262287d5..f8161db26 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -67,7 +67,10 @@ </div> <% if i == versions.length - 1 %> <div class="span6"> - <%=_("This is the first version.")%> + <p>“<%= h(historic_public_body.last_edit_comment) %>”</p> + <ul> + <li><%=_("This is the first version.")%></li> + </ul> </div> <% else %> <div class="span6"> diff --git a/app/views/admin_request/_some_annotations.html.erb b/app/views/admin_request/_some_annotations.html.erb new file mode 100644 index 000000000..dfd46f828 --- /dev/null +++ b/app/views/admin_request/_some_annotations.html.erb @@ -0,0 +1,48 @@ +<% 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)%> + <% 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 |%> + <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> + <% end %> + </div> +<% else %> + <p>None yet.</p> +<% end %> + diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index 83d9c3764..2589e52b4 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -325,53 +325,8 @@ <hr> <h2>Annotations</h2> -<% if @info_request.comments.size > 0 %> - <div class="accordion" id="comments"> - <% for comment in @info_request.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)%> - <% 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 |%> - <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> - <% end %> - </div> -<% else %> - <p>None yet.</p> -<% end %> +<%= render :partial => 'admin_request/some_annotations' , :locals => { :comments => @info_request.comments } %> + <hr> <h2>Mail server delivery logs</h2> diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb index c93c08e50..6d12aeff5 100644 --- a/app/views/admin_user/show.html.erb +++ b/app/views/admin_user/show.html.erb @@ -91,6 +91,12 @@ <hr> +<h2>Annotations</h2> + +<%= render :partial => 'admin_request/some_annotations' , :locals => { :comments => @admin_user.comments } %> + +<hr> + <h2>Censor rules</h2> <%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @admin_user.censor_rules, :user => @admin_user } %> diff --git a/app/views/contact_mailer/from_admin_message.text.erb b/app/views/contact_mailer/from_admin_message.text.erb index 4169d8d3a..3af759c5d 100644 --- a/app/views/contact_mailer/from_admin_message.text.erb +++ b/app/views/contact_mailer/from_admin_message.text.erb @@ -1,2 +1 @@ <%= raw @message %> - diff --git a/app/views/general/_localised_datepicker.html.erb b/app/views/general/_localised_datepicker.html.erb index ec6593ea0..ee3206957 100644 --- a/app/views/general/_localised_datepicker.html.erb +++ b/app/views/general/_localised_datepicker.html.erb @@ -1,16 +1,16 @@ <script type="text/javascript"> $(function() { $(".use-datepicker").datepicker( - {closeText: '<%= _("Done") %>', - prevText: '<%= _("Prev") %>', - nextText: '<%= _("Next") %>', - currentText: '<%= _("Today") %>', + {closeText: '<%= j _("Done") %>', + prevText: '<%= j _("Prev") %>', + nextText: '<%= j _("Next") %>', + currentText: '<%= j _("Today") %>', monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>, monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>, dayNames: <%= raw I18n.translate('date.day_names').to_json %>, dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>, dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>, - weekHeader: '<%= _("Wk") %>', + weekHeader: '<%= j _("Wk") %>', dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'} ); }); diff --git a/app/views/help/api.html.erb b/app/views/help/api.html.erb index df7bb30b6..c6488f93e 100644 --- a/app/views/help/api.html.erb +++ b/app/views/help/api.html.erb @@ -71,7 +71,15 @@ </p> </dd> - </dl> + + + <dt> 5. Write API </dt> + <dd> + <p> + The write API is designed to be used by authorities to create their own requests in the system. The API is currently used by mySociety's <a href="https://github.com/mysociety/foi-register">FOI Register software</a> to support using Alaveteli as a disclosure log for all FOI activity at a particular public body. More technical information about the write API is available on the <a href="https://github.com/mysociety/alaveteli/wiki/API#write-api">Alaveteli wiki</a>. + </p> + </dd> +</dl> <p>Please <a href="<%= help_contact_path %>">contact us</a> if you need an API feature that isn't there yet. It's very much a work in progress, and we do add things when people ask us to.</p> diff --git a/app/views/help/privacy.html.erb b/app/views/help/privacy.html.erb index 8e5293892..8ee7da385 100644 --- a/app/views/help/privacy.html.erb +++ b/app/views/help/privacy.html.erb @@ -84,6 +84,11 @@ ask a friend to. We don't have the resources to do this for everyone. </dd> +<dt id="anonymous">Why are there anonymous requests on the site? <a href="#anonymous">#</a> </dt> +<dd> +Some public authorities are using mySociety's <a href="https://github.com/mysociety/foi-register">FOI Register</a> software in order to use WhatDoTheyKnow as a disclosure log for all their FOI activity. When people make requests to the authority their names will usually be withheld from publication just as they would in an authority disclosure log on an authority website. +</dd> + <dt id="full_address">They've asked for my postal address! <a href="#full_address">#</a> </dt> <dd> diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 8d69b2a08..52b718be8 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -66,16 +66,22 @@ <% if is_admin? %> <%= render :partial => 'admin_general/admin_navbar' %> <% end %> -<% popup_banner = render(:partial => "general/popup_banner").strip %> -<% if popup_banner.present? %> -<div id="everypage" class="jshide"> - <p class="popup-close"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p> - <%= raw popup_banner %> - <p class="popup-close"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p> -</div> -<% end %> <div class="entirebody"> + <% popup_banner = render(:partial => "general/popup_banner").strip %> + <% if popup_banner.present? and ! @render_to_file %> + <div id="everypage" class="popup"> + <span class="popup-content"> + <%= raw popup_banner %> + </span> + <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span> + </div> + <% end %> + <div id="other-country-notice" class="popup"> + <span class="popup-content"> + </span> + <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span> + </div> <%= render :partial => 'general/header' %> <div id="wrapper"> <div id="content"> @@ -96,7 +102,6 @@ <%= render :partial => 'general/footer' %> </div> -<div id="other-country-notice"></div> <div id="link_box"><span class="close-button">X</span> <%= _("Paste this link into emails, tweets, and anywhere else:") %> <br /> diff --git a/app/views/reports/new.html.erb b/app/views/reports/new.html.erb index 7d558ab4e..1197b2255 100644 --- a/app/views/reports/new.html.erb +++ b/app/views/reports/new.html.erb @@ -4,17 +4,17 @@ <p><%= _("This request has already been reported for administrator attention") %></p> <% else %> <p> - Reporting a request notifies the site administrators. They will respond as soon as possible. + <%= _("Reporting a request notifies the site administrators. They will respond as soon as possible.") %> </p> - <p>Why specifically do you consider this request unsuitable?</p> + <p><%= _("Why specifically do you consider this request unsuitable?") %></p> <%= form_tag request_report_path(:request_id => @info_request.url_title) do %> <p> <label class="form_label" for="reason">Reason:</label> - <%= select_tag :reason, options_for_select(@info_request.report_reasons, @reason), :prompt => "Choose a reason" %> + <%= select_tag :reason, options_for_select(@info_request.report_reasons, @reason), :prompt => _("Choose a reason") %> </p> <p> - <label class="form_label" for="message">Please tell us more:</label> + <label class="form_label" for="message"><%= _("Please tell us more:") %></label> <%= text_area_tag :message, @message, :rows => 10, :cols => 60 %> </p> diff --git a/app/views/request/_view_html_prefix.html.erb b/app/views/request/_view_html_prefix.html.erb index 63caa98d4..63fac7c6d 100644 --- a/app/views/request/_view_html_prefix.html.erb +++ b/app/views/request/_view_html_prefix.html.erb @@ -1,9 +1,9 @@ <div class="view_html_prefix"> <div class="view_html_logo"> - <a href="/"><%= image_tag "navimg/logo-trans-small.png", :alt => site_name %></a> + <a href="/"><img src="/assets/navimg/logo-trans-small.png" alt="<%= site_name %>"></a> </div> <div class="view_html_download_link"> - <%=link_to _("Download original attachment"), @attachment_url %> + <%=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')%> diff --git a/app/views/request/_view_html_stylesheet.html.erb b/app/views/request/_view_html_stylesheet.html.erb index d6cb932a8..125ce66ec 100644 --- a/app/views/request/_view_html_stylesheet.html.erb +++ b/app/views/request/_view_html_stylesheet.html.erb @@ -1 +1 @@ -<%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %> +<link type="text/css" title="Main" rel="stylesheet" media="screen" href="/assets/application.css"> diff --git a/app/views/request/show.html.erb b/app/views/request/show.html.erb index c520ce40c..153b0b861 100644 --- a/app/views/request/show.html.erb +++ b/app/views/request/show.html.erb @@ -34,14 +34,16 @@ <p class="subtitle"> <% if !@user.nil? && @user.admin_page_links? %> <%= _('{{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), + :user => request_user_link(@info_request, _('An anonymous user')), :law_used_full => h(@info_request.law_used_full), :user_admin_link => user_admin_link_for_request(@info_request, _('external'), _('admin')), :request_admin_url => admin_request_show_url(@info_request), :public_body_link => public_body_link(@info_request.public_body), :public_body_admin_url => admin_body_show_url(@info_request.public_body)) %> <% else %> - <%= _('{{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)) %> + <%= _('{{user}} made this {{law_used_full}} request', + :user=>request_user_link(@info_request, _('An anonymous user')), + :law_used_full=>h(@info_request.law_used_full)) %> <%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %> <% end %> </p> diff --git a/app/views/user/sign.html.erb b/app/views/user/sign.html.erb index 8291cdace..e8c5d5a58 100644 --- a/app/views/user/sign.html.erb +++ b/app/views/user/sign.html.erb @@ -13,7 +13,7 @@ </p> <% if @post_redirect.post_params["controller"] == "admin_general" %> <% unless AlaveteliConfiguration::disable_emergency_user %> - <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> + <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 %> <% end %> diff --git a/app/views/user/wall.html.erb b/app/views/user/wall.html.erb index 190cc0a6d..6699c55fa 100644 --- a/app/views/user/wall.html.erb +++ b/app/views/user/wall.html.erb @@ -1,16 +1,19 @@ <% @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' %> + <% if @is_you %> + <h2><%= _("My wall") %></h2> + <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) %></p> + <%= render :partial => 'change_receive_email' %> + <% else %> + <h2><%= _("This is <a href=\"{{profile_url}}\">{{user_name}}'s</a> wall", :profile_url => show_user_profile_path, :user_name => h(@display_user.name)) %></h2> + <% end %> </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 %> - - + <% if !@feed_results.nil? and !@feed_results.empty? %> + <% for result in @feed_results %> + <%= render :partial => 'request/wall_listing', :locals => { :event => result, :info_request => result.info_request } %> + <% end %> + <% else %> + <p><%= _("There is nothing to display yet.") %></p> + <% end %> </div> |