diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/info_request_event.rb | 8 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 16 | ||||
-rw-r--r-- | app/models/request_mailer.rb | 4 |
3 files changed, 8 insertions, 20 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 8558ab676..024ed75f1 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.93 2009-09-20 12:17:14 francis Exp $ +# $Id: info_request_event.rb,v 1.94 2009-10-04 21:42:07 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -227,9 +227,9 @@ class InfoRequestEvent < ActiveRecord::Base if old_value != new_value: ret = ret + "<em>" + CGI.escapeHTML(key) + ":</em> " ret = ret + - CGI.escapeHTML(MySociety::Format.wrap_email_body(old_value).strip).gsub(/\n/, '<br>') + + CGI.escapeHTML(MySociety::Format.wrap_email_body_by_lines(old_value).strip).gsub(/\n/, '<br>') + " => " + - CGI.escapeHTML(MySociety::Format.wrap_email_body(new_value).strip).gsub(/\n/, '<br>') + CGI.escapeHTML(MySociety::Format.wrap_email_body_by_lines(new_value).strip).gsub(/\n/, '<br>') ret = ret + "<br>" end end @@ -238,8 +238,6 @@ class InfoRequestEvent < ActiveRecord::Base ret = ret + CGI.escapeHTML(value.to_s.strip) ret = ret + "<br>" end - # ret = ret + CGI.escapeHTML(a.to_s) + ":" + CGI.escapeHTML(b.to_s) + "<br>" - # ret = ret + self.params.to_yaml return ret end diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 77e4a596c..7de70fc17 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: outgoing_message.rb,v 1.93 2009-10-03 10:05:55 francis Exp $ +# $Id: outgoing_message.rb,v 1.94 2009-10-04 21:42:07 francis Exp $ class OutgoingMessage < ActiveRecord::Base strip_attributes! @@ -214,25 +214,13 @@ class OutgoingMessage < ActiveRecord::Base def get_body_for_html_display text = self.body.strip self.remove_privacy_sensitive_things!(text) - text = MySociety::Format.wrap_email_body(text) # reparagraph and wrap it so is good preview of emails + text = MySociety::Format.wrap_email_body_by_lines(text) # reparagraph and wrap it so is good preview of emails text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text, :contract => 1) text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/about#mobiles">\1</a>]') text = text.gsub(/\n/, '<br>') return text end - # Testing whether we can just wrap lines rather than between blank line separated paragraphs - def new_get_body_for_html_display - text = self.body.strip - self.remove_privacy_sensitive_things!(text) - text = MySociety::Format.wrap_email_body(text, 67, " ", "\n") # reparagraph and wrap it so is good preview of emails - text = CGI.escapeHTML(text) - text = MySociety::Format.make_clickable(text, :contract => 1) - text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/about#mobiles">\1</a>]') - text = text.gsub(/\n/, '<br>') - return text - end - def fully_destroy ActiveRecord::Base.transaction do diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb index ad227c8d9..d2e25f268 100644 --- a/app/models/request_mailer.rb +++ b/app/models/request_mailer.rb @@ -4,12 +4,13 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_mailer.rb,v 1.87 2009-10-03 09:47:16 francis Exp $ +# $Id: request_mailer.rb,v 1.88 2009-10-04 21:42:07 francis Exp $ class RequestMailer < ApplicationMailer # Email to public body requesting info def initial_request(info_request, outgoing_message) + @wrap_lines_as_paragraphs = true @from = info_request.incoming_name_and_email @recipients = info_request.recipient_name_and_email @subject = info_request.email_subject_request @@ -19,6 +20,7 @@ class RequestMailer < ApplicationMailer # Later message to public body regarding existing request def followup(info_request, outgoing_message, incoming_message_followup) + @wrap_lines_as_paragraphs = true @from = info_request.incoming_name_and_email @recipients = RequestMailer.name_and_email_for_followup(info_request, incoming_message_followup) @subject = RequestMailer.subject_for_followup(info_request, outgoing_message) |