aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/outgoing_message.rb16
-rw-r--r--app/views/request/preview.rhtml22
2 files changed, 17 insertions, 21 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index 3e441eacb..a4cb510bb 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.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: outgoing_message.rb,v 1.61 2008-08-31 12:46:52 francis Exp $
+# $Id: outgoing_message.rb,v 1.62 2008-08-31 15:10:16 francis Exp $
class OutgoingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -156,25 +156,13 @@ class OutgoingMessage < ActiveRecord::Base
# Return body for display as HTML
def get_body_for_html_display
text = self.body.strip
+ text = MySociety::Format.wrap_email_body(text) # reparagraph and wrap it so is good preview of emails
text = CGI.escapeHTML(text)
text = MySociety::Format.make_clickable(text, :contract => 1)
text = text.gsub(/\n/, '<br>')
return text
end
- # Return body for display as HTML
- # XXX this is repeating code in a combination of
- # views/layouts/request_mailer.rhtml and views/request_mailer/initial_request.rhtml
- def get_body_for_html_preview
- text = self.body.strip
- text = MySociety::Format.wrap_email_body(self.body.strip)
- text = CGI.escapeHTML(text)
- text = MySociety::Format.make_clickable(text, :contract => 1)
- text = text.gsub(/\n/, '<br>')
-
- return text
- end
-
end
diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml
index a53492701..427d036d9 100644
--- a/app/views/request/preview.rhtml
+++ b/app/views/request/preview.rhtml
@@ -11,13 +11,21 @@
</ul>
<% fields_for :outgoing_message do |o| %>
- <p class="outgoing_message_preview">
- <strong>To:</strong> <%=h @info_request.public_body.name %>
- <br><strong>Subject:</strong> <%=h @info_request.email_subject_request %>
- <br><br>
- <%= @outgoing_message.get_body_for_html_preview %>
- <%= o.hidden_field(:body) %>
- </p>
+
+ <div class="correspondence" id="outgoing-0">
+ <p class="preview_subject">
+ <strong>To:</strong> <%=h @info_request.public_body.name %>
+ <br><strong>Subject:</strong> <%=h @info_request.email_subject_request %>
+ </p>
+
+ <div class="correspondence_text">
+ <p><%= @outgoing_message.get_body_for_html_display %></p>
+ <%= o.hidden_field(:body) %>
+ </div>
+
+ <p class="event_actions">
+ </p>
+ </div>
<% end %>
<p><strong>Privacy note:</strong> If you want to request private information about