aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-08-08 13:38:42 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-08-08 14:28:06 +0100
commitbf53b8ef979e35e18b28c924b61ccade999833d7 (patch)
tree61b4836e154d7072f19a2a743d25d6af6e10b56c
parent025274d4b79c56432b0abf99983c940a6c2bd08c (diff)
Factor out HTML email sidebar to own template.
-rw-r--r--templates/email/default/_email_sidebar.html10
-rw-r--r--templates/email/default/alert-update.html10
-rw-r--r--templates/email/default/problem-confirm-not-sending.html10
-rw-r--r--templates/email/default/problem-confirm.html10
-rw-r--r--templates/email/default/problem-moderated.html10
-rw-r--r--templates/email/default/questionnaire.html10
-rw-r--r--templates/email/default/submit.html10
-rw-r--r--templates/email/default/update-confirm.html12
-rw-r--r--templates/email/fixmystreet.com/submit.html10
9 files changed, 28 insertions, 64 deletions
diff --git a/templates/email/default/_email_sidebar.html b/templates/email/default/_email_sidebar.html
new file mode 100644
index 000000000..291584195
--- /dev/null
+++ b/templates/email/default/_email_sidebar.html
@@ -0,0 +1,10 @@
+[% DEFAULT report = object ~%]
+<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
+ <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
+ [% start_padded_box %]
+ [%~ IF object.photo %]
+ <img style="[% preview_photo_style %]" src="[% inline_image(object.get_first_image_fp) %]" alt="" align="right">
+ [%~ END %]
+ [%~ content %]
+ [% end_padded_box %]
+</th>
diff --git a/templates/email/default/alert-update.html b/templates/email/default/alert-update.html
index ea24930b8..8c392685d 100644
--- a/templates/email/default/alert-update.html
+++ b/templates/email/default/alert-update.html
@@ -17,15 +17,9 @@ INCLUDE '_email_top.html';
<p style="[% p_style %]"><a href="[% unsubscribe_url %]">Unsubscribe from alerts about this report</a></p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% title | html %]</h2>
<p style="[% secondary_p_style %]">[% detail | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/problem-confirm-not-sending.html b/templates/email/default/problem-confirm-not-sending.html
index f1092b9a4..dad5b64bc 100644
--- a/templates/email/default/problem-confirm-not-sending.html
+++ b/templates/email/default/problem-confirm-not-sending.html
@@ -22,15 +22,9 @@ council.</p>
<p style="[% p_style %]">If you no longer wish to publish this report, please take no further action.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF report.photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% report.title | html %]</h2>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/problem-confirm.html b/templates/email/default/problem-confirm.html
index 72f27decb..f69449b52 100644
--- a/templates/email/default/problem-confirm.html
+++ b/templates/email/default/problem-confirm.html
@@ -25,15 +25,9 @@ of problem, so it will instead be sent to [% report.body %].
<p style="[% p_style %]">If you no longer wish to send this report, please take no further action.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF report.photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% report.title | html %]</h2>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/problem-moderated.html b/templates/email/default/problem-moderated.html
index 9adaa6421..1a12446d0 100644
--- a/templates/email/default/problem-moderated.html
+++ b/templates/email/default/problem-moderated.html
@@ -24,15 +24,9 @@ INCLUDE '_email_top.html';
the team at <a href="[% report_complain_uri %]">[% report_complain_uri %]</a></p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(problem.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF problem.photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(problem.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = problem %]
<h2 style="[% h2_style %]">[% problem.moderation_original_data.title | html %]</h2>
<p style="[% secondary_p_style %]">[% problem.moderation_original_data.detail | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/questionnaire.html b/templates/email/default/questionnaire.html
index 05cfed0f2..ab5783d17 100644
--- a/templates/email/default/questionnaire.html
+++ b/templates/email/default/questionnaire.html
@@ -22,15 +22,9 @@ INCLUDE '_email_top.html';
<p style="[% p_style %]">Thank you! Your feedback is really valuable.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF report.photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% title %]</h2>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/submit.html b/templates/email/default/submit.html
index 7d0178938..85511b2e4 100644
--- a/templates/email/default/submit.html
+++ b/templates/email/default/submit.html
@@ -39,12 +39,7 @@ of a local problem that they believe might require your attention.</p>
<p style="[% p_style %] margin-top: 0.5em;">Replies to this message will go directly to [% name | html %], the user who reported the problem.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF has_photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% title | html %]</h2>
[%~ IF category_line %]
<p style="[% secondary_p_style %]">[% category | html %]</p>
@@ -57,7 +52,6 @@ of a local problem that they believe might require your attention.</p>
</a>
[% IF closest_address %]<br>[% closest_address | trim | replace("\n\n", "<br>") %][% END %]
</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/update-confirm.html b/templates/email/default/update-confirm.html
index 019bc9e0d..c2a39c0e5 100644
--- a/templates/email/default/update-confirm.html
+++ b/templates/email/default/update-confirm.html
@@ -20,14 +20,10 @@ INCLUDE '_email_top.html';
<p style="[% p_style %]">If you no longer wish to confirm this update, please take no further action.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(problem.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF update.photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(update.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html'
+ object = update
+ report = problem %]
<p style="[% secondary_p_style %]">[% update.text | html %]</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/fixmystreet.com/submit.html b/templates/email/fixmystreet.com/submit.html
index 13e852f38..fc2b6c095 100644
--- a/templates/email/fixmystreet.com/submit.html
+++ b/templates/email/fixmystreet.com/submit.html
@@ -39,12 +39,7 @@ of a local problem that they believe might require your attention.</p>
<p style="[% p_style %] margin-top: 0.5em;">Replies to this message will go directly to [% name | html %], the user who reported the problem.</p>
[% end_padded_box %]
</th>
-<th style="[% td_style %][% secondary_column_style %]" id="secondary_column">
- <img style="[% map_image_style %]" src="[% inline_image(report.static_map, 'map.jpeg') %]" width="310" height="200" alt="">
- [% start_padded_box %]
- [%~ IF has_photo %]
- <img style="[% preview_photo_style %]" src="[% inline_image(report.get_first_image_fp) %]" alt="" align="right">
- [%~ END %]
+[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% title | html %]</h2>
[%~ IF category_line %]
<p style="[% secondary_p_style %]">[% category | html %]</p>
@@ -63,7 +58,6 @@ of a local problem that they believe might require your attention.</p>
</a>)
[% IF closest_address %]<br>[% closest_address | trim | replace("\n\n", "<br>") %][% END %]
</p>
- [% end_padded_box %]
-</th>
+[% END %]
[% INCLUDE '_email_bottom.html' %]