diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rw-r--r-- | app/models/exim_log.rb | 6 | ||||
-rw-r--r-- | app/models/info_request.rb | 20 | ||||
-rw-r--r-- | app/models/request_mailer.rb | 14 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 2 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 12 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 6 | ||||
-rw-r--r-- | app/views/outgoing_mailer/initial_request.rhtml | 1 | ||||
-rw-r--r-- | app/views/request/_sidebar.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/list.rhtml | 2 | ||||
-rw-r--r-- | app/views/user/show.rhtml | 5 |
12 files changed, 39 insertions, 34 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 0bfbcd3d1..adb506b91 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -53,6 +53,7 @@ class AdminController < ApplicationController authenticate_or_request_with_http_basic do |user_name, password| if user_name == config_username && password == config_password session[:using_admin] = 1 + request.env['REMOTE_USER'] = user_name else request_http_basic_authentication end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 4b7884065..1801648ca 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -774,7 +774,7 @@ class RequestController < ApplicationController :email => _("Then you can download a zip file of {{info_request_title}}.",:info_request_title=>info_request.title), :email_subject => _("Log in to download a zip file of {{info_request_title}}",:info_request_title=>info_request.title) ) - updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_s + info_request.updated_at.to_s) + updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_i.to_s + info_request.updated_at.to_i.to_s) @url_path = "/download/#{updated[0..1]}/#{updated}/#{params[:url_title]}.zip" file_path = File.join(File.dirname(__FILE__), '../../cache/zips', @url_path) if !File.exists?(file_path) diff --git a/app/models/exim_log.rb b/app/models/exim_log.rb index 80535ab41..83f031a92 100644 --- a/app/models/exim_log.rb +++ b/app/models/exim_log.rb @@ -108,10 +108,10 @@ class EximLog < ActiveRecord::Base # be sure we are parsing the exim line right) envelope_from = " from <" + ir.incoming_email + "> " if !exim_log.line.include?(envelope_from) - raise "unexpected parsing of exim line" + $stderr.puts("unexpected parsing of exim line: [#{exim_log.line.chomp}]") + else + found = true end - - found = true end end if !found diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 92322f74f..f482ca700 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -240,9 +240,9 @@ public # into some sort of separate jurisdiction dependent file if self.public_body.url_name == 'general_register_office' # without GQ in the subject, you just get an auto response - self.law_used_full + ' request GQ - ' + self.title + _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title) else - self.law_used_full + ' request - ' + self.title + _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title) end end def email_subject_followup(incoming_message = nil) @@ -260,36 +260,36 @@ public # Two sorts of laws for requests, FOI or EIR def law_used_full if self.law_used == 'foi' - return "Freedom of Information" + return _("Freedom of Information") elsif self.law_used == 'eir' - return "Environmental Information Regulations" + return _("Environmental Information Regulations") else raise "Unknown law used '" + self.law_used + "'" end end def law_used_short if self.law_used == 'foi' - return "FOI" + return _("FOI") elsif self.law_used == 'eir' - return "EIR" + return _("EIR") else raise "Unknown law used '" + self.law_used + "'" end end def law_used_act if self.law_used == 'foi' - return "Freedom of Information Act" + return _("Freedom of Information Act") elsif self.law_used == 'eir' - return "Environmental Information Regulations" + return _("Environmental Information Regulations") else raise "Unknown law used '" + self.law_used + "'" end end def law_used_with_a if self.law_used == 'foi' - return "A Freedom of Information request" + return _("A Freedom of Information request") elsif self.law_used == 'eir' - return "An Environmental Information Regulations request" + return _("An Environmental Information Regulations request") else raise "Unknown law used '" + self.law_used + "'" end diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb index f46ce33c5..75dc58447 100644 --- a/app/models/request_mailer.rb +++ b/app/models/request_mailer.rb @@ -47,7 +47,7 @@ class RequestMailer < ApplicationMailer def requires_admin(info_request) @from = info_request.user.name_and_email @recipients = contact_from_name_and_email - @subject = "FOI response requires admin - " + info_request.title + @subject = _("FOI response requires admin - ") + info_request.title url = main_url(request_url(info_request)) admin_url = request_admin_url(info_request) @body = {:info_request => info_request, :url => url, :admin_url => admin_url } @@ -64,7 +64,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "New response to your FOI request - " + info_request.title + @subject = _("New response to your FOI request - ") + info_request.title @body = { :incoming_message => incoming_message, :info_request => info_request, :url => url } end @@ -83,7 +83,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = user.name_and_email - @subject = "Delayed response to your FOI request - " + info_request.title + @subject = _("Delayed response to your FOI request - ") + info_request.title @body = { :info_request => info_request, :url => url } end @@ -102,7 +102,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = user.name_and_email - @subject = "You're long overdue a response to your FOI request - " + info_request.title + @subject = _("You're long overdue a response to your FOI request - ") + info_request.title @body = { :info_request => info_request, :url => url } end @@ -122,7 +122,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Was the response you got to your FOI request any good?" + @subject = _("Was the response you got to your FOI request any good?") @body = { :incoming_message => incoming_message, :info_request => info_request, :url => url } end @@ -165,7 +165,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Somebody added a note to your FOI request - " + info_request.title + @subject = _("Somebody added a note to your FOI request - ") + info_request.title @body = { :comment => comment, :info_request => info_request, :url => main_url(comment_url(comment)) } end def comment_on_alert_plural(info_request, count, earliest_unalerted_comment) @@ -174,7 +174,7 @@ class RequestMailer < ApplicationMailer 'Auto-Submitted' => 'auto-generated', # http://tools.ietf.org/html/rfc3834 'X-Auto-Response-Suppress' => 'OOF' @recipients = info_request.user.name_and_email - @subject = "Some notes have been added to your FOI request - " + info_request.title + @subject = _("Some notes have been added to your FOI request - ") + info_request.title @body = { :count => count, :info_request => info_request, :url => main_url(comment_url(earliest_unalerted_comment)) } end diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index f71980302..35751b6a4 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -1,4 +1,4 @@ -<% view_cache :ttl => 5.minutes, :tag => I18n.locale do %> +<% view_cache :ttl => 5.minutes.to_i, :tag => I18n.locale do %> <div id="frontpage_splash"> <div id="left_column"> <h1> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 735ceda86..87a6ab446 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -14,9 +14,9 @@ <div id="header_left"> <% if @query.nil? %> - <h1>Search</h1> + <h1><%= _("Search") %></h1> <% else %> - <h1>Search results</h1> + <h1><%= _("Search results") %></h1> <% end%> <% if @advanced %> @@ -109,16 +109,16 @@ </div> <div id="date_range"> - <label class="form_label title" for="query">Made between</label> + <label class="form_label title" for="query"><%= _("Made between") %></label> <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %> - <label class="form_label" for="query"> and</label> + <label class="form_label" for="query"> <%= _("and") %></label> <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %> </div> </div> <% end %> <div> - <%= submit_tag("Filter") if @variety_postfix == "requests"%> + <%= submit_tag _("Filter") if @variety_postfix == "requests"%> </div> <% end # Search form%> @@ -138,7 +138,7 @@ <% if @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%> <div id="header_right"> - <h2>Track this search</h2> + <h2><%= _('Track this search')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> </div> <% end %> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 2af13f342..4008760a1 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -12,7 +12,6 @@ <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 'theme', :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" %> @@ -35,11 +34,12 @@ <!--[if LT IE 8]> <style type="text/css">@import url("/stylesheets/ie7.css");</style> <![endif]--> - <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> + <!-- 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]%>"> diff --git a/app/views/outgoing_mailer/initial_request.rhtml b/app/views/outgoing_mailer/initial_request.rhtml index 83e5b794b..d537a20bc 100644 --- a/app/views/outgoing_mailer/initial_request.rhtml +++ b/app/views/outgoing_mailer/initial_request.rhtml @@ -6,6 +6,7 @@ <%= @info_request.incoming_email %> <%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%> +<%= help_contact_url %> <%= render :partial => 'followup_footer' %> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 2a9b5a73f..758387b09 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -19,7 +19,7 @@ <%= render :partial => 'request/next_actions' %> - <% view_cache :ttl => 1.day, :tag => ['similar', @info_request.id, I18n.locale] do %> + <% view_cache :ttl => 1.day.to_i, :tag => ['similar', @info_request.id, I18n.locale] do %> <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %> <h2><%= _('Similar requests')%></h2> <% for result in @xapian_similar.results %> diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index 0137cb6dd..3890fa28b 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -14,7 +14,7 @@ <div style="clear:both"></div> <div class="results_section"> - <% view_cache :ttl => 5.minutes, :tag => [@view, @page, I18n.locale] do %> + <% view_cache :ttl => 5.minutes.to_i, :tag => [@view, @page, I18n.locale] do %> <% if @list_results.empty? %> <p> <%= _('No requests of this sort yet.')%></p> <% else %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 2ae6e5ed5..baf6621df 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -24,7 +24,7 @@ </div> <% end %> -<div> +<div id="user_profile_header"> <div id="header_right"> <h2><%= _('Track this person')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> @@ -116,6 +116,8 @@ </div> </div> <div style="clear:both"></div> + +<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]) %> @@ -230,3 +232,4 @@ <% end %> <% end %> <% end %> +</div>
\ No newline at end of file |