From ca6fd3700c7c439d6ea969afcba2d2656d5b123f Mon Sep 17 00:00:00 2001 From: David Cabo Date: Wed, 24 Aug 2011 13:02:40 +0200 Subject: Remove hardcoded status list from InfoRequestEvent, use InfoRequest one instead --- app/models/info_request.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index c667e1499..67ebd01b0 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -779,8 +779,7 @@ public # Display version of status - def display_status - status = self.calculate_status + def InfoRequest.get_status_description(status) if status == 'waiting_classification' _("Awaiting classification.") elsif status == 'waiting_response' @@ -818,6 +817,10 @@ public end end + def display_status + InfoRequest.get_status_description(self.calculate_status) + end + # Completely delete this request and all objects depending on it def fully_destroy self.track_things.each do |track_thing| -- cgit v1.2.3 From 284808d259b3ba8ba1e6c106d949fffeb110a5a7 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 24 Aug 2011 11:50:10 +0100 Subject: First stab at filtering on the "View requests" page --- app/models/info_request.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index c667e1499..9b0f1047b 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -451,7 +451,7 @@ public self.log_event("response", params) self.save! end - + self.info_request_events.each { |event| event.xapian_mark_needs_index } # for the "waiting_classification" index RequestMailer.deliver_new_response(self, incoming_message) end @@ -564,6 +564,7 @@ public def calculate_event_states curr_state = nil for event in self.info_request_events.reverse + event.xapian_mark_needs_index # we need to reindex all events in order to update their latest_* terms if curr_state.nil? if !event.described_state.nil? curr_state = event.described_state -- cgit v1.2.3 From f443b36ed4819bbc6766e7089d035f5d071fe2a1 Mon Sep 17 00:00:00 2001 From: Faton Selishta Date: Mon, 5 Sep 2011 10:56:36 +0200 Subject: I18n'ize some strings --- app/models/info_request.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 978e2cd08..88a02cc2c 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -117,13 +117,13 @@ class InfoRequest < ActiveRecord::Base # only check on create, so existing models with mixed case are allowed def validate_on_create if !self.title.nil? && !MySociety::Validate.uses_mixed_capitals(self.title, 10) - errors.add(:title, N_('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.')) + errors.add(:title, _('Please write the summary using a mixture of capital and lower case letters. This makes it easier for others to read.')) end if !self.title.nil? && title.size > 200 - errors.add(:title, N_('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.')) + errors.add(:title, _('Please keep the summary short, like in the subject of an email. You can use a phrase, rather than a full sentence.')) end if !self.title.nil? && self.title =~ /^(FOI|Freedom of Information)\s*requests?$/i - errors.add(:title, N_('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.')) + errors.add(:title, _('Please describe more what the request is about in the subject. There is no need to say it is an FOI request, we add that on anyway.')) end end -- cgit v1.2.3 From 0f0854cd60aebde1b4a69e455ee40686c4ab0353 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 15 Sep 2011 11:50:21 +0100 Subject: Simplify the "Send follow up" / "Reply" UI: only offer singe "Write a reply" option, and on the next page, give the user the opportunity to change the recipient from the default (the last valid sender of a message) to any other valid recipient. Closes #35. --- app/models/info_request.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 88a02cc2c..92322f74f 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -922,10 +922,13 @@ public end # List of incoming messages to followup, by unique email - def who_can_followup_to + def who_can_followup_to(skip_message = nil) ret = [] done = {} for incoming_message in self.incoming_messages.reverse + if incoming_message == skip_message + next + end incoming_message.safe_mail_from email = OutgoingMailer.email_for_followup(self, incoming_message) -- cgit v1.2.3