diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/request_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | app/models/info_request.rb | 4 | ||||
-rw-r--r-- | app/models/request_mailer.rb | 8 | ||||
-rw-r--r-- | app/models/track_thing.rb | 4 | ||||
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | app/views/request_mailer/new_response_reminder_alert.rhtml | 2 |
7 files changed, 16 insertions, 10 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index bd2bfc974..f87efbcb0 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -663,7 +663,7 @@ class RequestController < ApplicationController ) if !info_request.attention_requested - info_request.set_described_state('attention_requested') + info_request.set_described_state('attention_requested', @user) info_request.attention_requested = true # tells us if attention has ever been requested info_request.save! flash[:notice] = _("This request has been reported for administrator attention") diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index df016a249..cb6615199 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -127,7 +127,9 @@ module ApplicationHelper end def admin_date(date) - "#{I18n.l(date, :format => "%e %B %Y %H:%M:%S")} (#{_('{{length_of_time}} ago', :length_of_time => time_ago_in_words(date))})" + ago_text = _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(date)) + exact_date = I18n.l(date, :format => "%e %B %Y %H:%M:%S") + return "#{exact_date} (#{ago_text})" end end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 095a1b1af..45819bfe7 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -519,7 +519,7 @@ public end # change status, including for last event for later historical purposes - def set_described_state(new_state) + def set_described_state(new_state, set_by = nil) ActiveRecord::Base.transaction do self.awaiting_description = false last_event = self.get_last_event @@ -532,7 +532,7 @@ public self.calculate_event_states if self.requires_admin? - RequestMailer.deliver_requires_admin(self) + RequestMailer.deliver_requires_admin(self, set_by) end end diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb index 8e6e65a26..c208923f3 100644 --- a/app/models/request_mailer.rb +++ b/app/models/request_mailer.rb @@ -45,8 +45,12 @@ class RequestMailer < ApplicationMailer end # An FOI response is outside the scope of the system, and needs admin attention - def requires_admin(info_request) - @from = info_request.user.name_and_email + def requires_admin(info_request, set_by = nil) + if !set_by.nil? + @from = set_by.name_and_email + else + @from = info_request.user.name_and_email + end @recipients = contact_from_name_and_email @subject = _("FOI response requires admin ({{reason}}) - {{title}}", :reason => info_request.described_state, :title => info_request.title) url = main_url(request_url(info_request)) diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 7f6bc9a7e..d0fc62e12 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -218,8 +218,8 @@ class TrackThing < ActiveRecord::Base :title_in_email => _("New Freedom of Information requests"), :title_in_rss => _("New Freedom of Information requests"), # Authentication - :web => _("To be follow new requests"), - :email => _("Then you will be following all new FOI request."), + :web => _("To follow new requests"), + :email => _("Then you will be following all new FOI requests."), :email_subject => _("Confirm you want to follow new requests"), # RSS sorting :feed_sortby => 'newest' diff --git a/app/models/user.rb b/app/models/user.rb index 57fce429c..573649b8f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -409,7 +409,7 @@ class User < ActiveRecord::Base columns = self.class.content_columns.map{|c| c if %w(created_at updated_at admin_level email_confirmed).include?(c.name) }.compact end columns.each do |column| - yield(column.human_name, self.send(column.name), column.type.to_s) + yield(column.human_name, self.send(column.name), column.type.to_s, column.name) end end diff --git a/app/views/request_mailer/new_response_reminder_alert.rhtml b/app/views/request_mailer/new_response_reminder_alert.rhtml index 86fc71de7..5f07e8559 100644 --- a/app/views/request_mailer/new_response_reminder_alert.rhtml +++ b/app/views/request_mailer/new_response_reminder_alert.rhtml @@ -1,4 +1,4 @@ -<%=_('To let everyone know, follow this link and then select the appropriate box.')%> +<%=_('To let us know, follow this link and then select the appropriate box.')%> <%=@url%> |