aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-03-01 15:56:14 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-01 15:56:14 +0000
commite20bfd7940775a8826e42934e7a714b1ee84f100 (patch)
tree80913ae8d0b37520bf7959cb17382b8a22ff8deb
parent8ed2f5d17ab6c80f977439a7fcf3013545e5433d (diff)
parent04de4f97ff05e5662965d71e1bdae6c639f7d039 (diff)
Merge branch 'email-previewing'
-rw-r--r--CHANGELOG.md2
-rw-r--r--perllib/FixMyStreet/App.pm30
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Develop.pm136
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm8
-rw-r--r--t/app/controller/develop.t33
-rw-r--r--templates/email/default/alert-update.html4
-rw-r--r--templates/email/default/alert-update.txt6
-rw-r--r--templates/email/default/submit.html22
-rw-r--r--templates/email/default/submit.txt18
-rw-r--r--templates/email/fiksgatami/nn/submit.txt18
-rw-r--r--templates/email/fiksgatami/submit.txt18
-rw-r--r--templates/email/fixamingata/submit.html20
-rw-r--r--templates/email/fixamingata/submit.txt20
-rw-r--r--templates/email/fixmystreet.com/submit.html22
-rw-r--r--templates/email/fixmystreet.com/submit.txt18
-rw-r--r--templates/email/zurich/submit-external-personal.txt8
-rw-r--r--templates/email/zurich/submit-external-wish.txt10
-rw-r--r--templates/email/zurich/submit-external.txt2
-rw-r--r--templates/email/zurich/submit-feedback-pending.txt2
-rw-r--r--templates/email/zurich/submit-in-progress.txt2
-rw-r--r--templates/email/zurich/submit.txt2
-rwxr-xr-xtemplates/web/base/develop/email_list.html11
22 files changed, 299 insertions, 113 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 45f6e3269..c6bced606 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,8 @@
- Fix text layout issues in /reports/…/summary dashboard charts.
- Admin improvements:
- Inspectors can set non_public status of reports. #1992
+ - Development improvements:
+ - Add HTML email previewer.
* v2.3.1 (12th February 2018)
- Front end improvements:
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 008aea595..e23bc7622 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -344,6 +344,24 @@ sub send_email {
my $extra_stash_values = shift || {};
my $sender = $c->config->{DO_NOT_REPLY_EMAIL};
+ my $email = $c->construct_email($template, $extra_stash_values) or return;
+
+ my $result = 0;
+ try {
+ FixMyStreet::Email::Sender->send($email, { from => $sender });
+ $result = $email;
+ } catch {
+ my $error = $_ || 'unknown error';
+ $c->log->error("$error");
+ };
+ return $result;
+}
+
+sub construct_email {
+ my ($c, $template, $extra_stash_values) = @_;
+ $extra_stash_values //= {};
+
+ my $sender = $c->config->{DO_NOT_REPLY_EMAIL};
my $sender_name = $c->cobrand->contact_name;
# create the vars to pass to the email template
@@ -378,17 +396,7 @@ sub send_email {
$data->{_html_} = $html_compiled if $html_compiled;
$data->{_html_images_} = \@inline_images if @inline_images;
- my $email = mySociety::Locale::in_gb_locale { FixMyStreet::Email::construct_email($data) };
-
- my $result = 0;
- try {
- FixMyStreet::Email::Sender->send($email, { from => $sender });
- $result = $email;
- } catch {
- my $error = $_ || 'unknown error';
- $c->log->error("$error");
- };
- return $result;
+ return mySociety::Locale::in_gb_locale { FixMyStreet::Email::construct_email($data) };
}
=head2 uri_with
diff --git a/perllib/FixMyStreet/App/Controller/Develop.pm b/perllib/FixMyStreet/App/Controller/Develop.pm
new file mode 100755
index 000000000..0bc52883f
--- /dev/null
+++ b/perllib/FixMyStreet/App/Controller/Develop.pm
@@ -0,0 +1,136 @@
+package FixMyStreet::App::Controller::Develop;
+use Moose;
+use namespace::autoclean;
+
+use File::Basename;
+
+BEGIN { extends 'Catalyst::Controller'; }
+
+=head1 NAME
+
+FixMyStreet::App::Controller::Develop - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Developer-helping Catalyst Controller.
+
+=head1 METHODS
+
+=over 4
+
+=item auto
+
+Makes sure this controller is only available when run in development.
+
+=cut
+
+sub auto : Private {
+ my ($self, $c) = @_;
+ $c->detach( '/page_error_404_not_found' ) unless $c->config->{STAGING_SITE};
+ return 1;
+}
+
+=item email_list
+
+Shows a list of links to preview HTML emails.
+
+=cut
+
+sub email_list : Path('/_dev/email') : Args(0) {
+ my ( $self, $c ) = @_;
+
+ my @include_path = @{ $c->cobrand->path_to_email_templates($c->stash->{lang_code}) };
+ push @include_path, $c->view('Email')->config->{INCLUDE_PATH}->[0];
+ my %templates;
+ foreach (@include_path) {
+ $templates{$_} = 1 for grep { /^[^_]/ } map { s/\.html$//; basename $_ } glob "$_/*.html";
+ }
+
+ my %with_update = ('update-confirm' => 1, 'other-updated' => 1);
+ my %with_problem = ('alert-update' => 1, 'other-reported' => 1,
+ 'problem-confirm' => 1, 'problem-confirm-not-sending' => 1,
+ 'problem-moderated' => 1, 'questionnaire' => 1, 'submit' => 1);
+
+ my $update = $c->model('DB::Comment')->first;
+ my $problem = $c->model('DB::Problem')->first;
+
+ $c->stash->{templates} = [];
+ foreach (sort keys %templates) {
+ my $url = $c->uri_for('/_dev/email', $_);
+ $url .= "?problem=" . $problem->id if $problem && $with_problem{$_};
+ $url .= "?update=" . $update->id if $update && $with_update{$_};
+ push @{$c->stash->{templates}}, { name => $_, url => $url };
+ }
+}
+
+=item email_previewer
+
+Previews an HTML email template. A problem or update ID can be provided as a
+query parameter, and other data is taken from the database.
+
+=back
+
+=cut
+
+sub email_previewer : Path('/_dev/email') : Args(1) {
+ my ( $self, $c, $template ) = @_;
+
+ my $vars = {};
+ if (my $id = $c->get_param('update')) {
+ $vars->{update} = $c->model('DB::Comment')->find($id);
+ $vars->{problem} = $vars->{report} = $vars->{update}->problem;
+ } elsif ($id = $c->get_param('problem')) {
+ $vars->{problem} = $vars->{report} = $c->model('DB::Problem')->find($id);
+ }
+
+ # Special case needed variables
+ if ($template =~ /^alert-problem/) {
+ $vars->{area_name} = 'Area Name';
+ $vars->{ward_name} = 'Ward Name';
+ $vars->{data} = [ $c->model('DB::Problem')->search({}, { rows => 5 })->all ];
+ } elsif ($template eq 'alert-update') {
+ $vars->{data} = [];
+ my $q = $c->model('DB::Comment')->search({}, { rows => 5 });
+ while (my $u = $q->next) {
+ my $fn = sub {
+ return FixMyStreet::App::Model::PhotoSet->new({
+ db_data => $u->photo,
+ })->get_image_data( num => 0, size => 'fp' );
+ };
+ push @{$vars->{data}}, {
+ item_photo => $u->photo, get_first_image_fp => $fn, item_text => $u->text,
+ item_name => $u->name, item_anonymous => $u->anonymous, confirmed => $u->confirmed };
+ }
+ } elsif ($template eq 'questionnaire') {
+ $vars->{created} = 'N weeks';
+ }
+
+ my $email = $c->construct_email("$template.txt", $vars);
+
+ # Look through the Email::MIME email for the text/html part, and any inline
+ # images. Turn the images into data: URIs.
+ my $html = '';
+ my %images;
+ $email->walk_parts(sub {
+ my ($part) = @_;
+ return if $part->subparts;
+ if ($part->content_type =~ m[^image/]i) {
+ (my $cid = $part->header('Content-ID')) =~ s/[<>]//g;
+ (my $ct = $part->content_type) =~ s/;.*//;
+ $images{$cid} = "$ct;base64," . $part->body_raw;
+ } elsif ($part->content_type =~ m[text/html]i) {
+ $html = $part->body_str;
+ }
+ });
+
+ foreach (keys %images) {
+ $html =~ s/cid:([^"]*)/data:$images{$1}/g;
+ }
+
+ $c->response->body($html);
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index 8e4a4aec1..be3c4c69a 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -178,16 +178,8 @@ sub send(;$) {
if ($h{category} eq _('Other')) {
$h{category_footer} = _('this type of local problem');
- $h{category_line} = '';
} else {
$h{category_footer} = "'" . $h{category} . "'";
- $h{category_line} = sprintf(_("Category: %s"), $h{category}) . "\n\n";
- }
-
- if ( $row->subcategory ) {
- $h{subcategory_line} = sprintf(_("Subcategory: %s"), $row->subcategory) . "\n\n";
- } else {
- $h{subcategory_line} = "\n\n";
}
$h{bodies_name} = join(_(' and '), @dear);
diff --git a/t/app/controller/develop.t b/t/app/controller/develop.t
new file mode 100644
index 000000000..92aa86721
--- /dev/null
+++ b/t/app/controller/develop.t
@@ -0,0 +1,33 @@
+use FixMyStreet::TestMech;
+
+ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
+
+my ($problem) = $mech->create_problems_for_body(1, 2504, 'title');
+my $update = $mech->create_comment_for_problem($problem, $problem->user, 'Name', 'Text', 'f', 'confirmed', 'confirmed');
+
+subtest 'not visible on live site' => sub {
+ FixMyStreet::override_config {
+ STAGING_SITE => 0
+ }, sub {
+ $mech->get('/_dev/email/');
+ is $mech->res->code, 404;
+ $mech->get('/_dev/email/login');
+ is $mech->res->code, 404;
+ };
+};
+
+subtest 'dev email index page' => sub {
+ $mech->get_ok('/_dev/email/');
+ $mech->content_contains('login">login</a></li>');
+ $mech->content_contains('questionnaire?problem=' . $problem->id . '">questionnaire</a></li>');
+ $mech->content_contains('update-confirm?update=' . $update->id . '">update-confirm</a></li>');
+};
+
+subtest 'individual email previews' => sub {
+ $mech->get_ok('/_dev/email/alert-problem-area');
+ $mech->get_ok('/_dev/email/alert-update?problem=' . $problem->id);
+ $mech->get_ok('/_dev/email/questionnaire?problem=' . $problem->id);
+ $mech->get_ok('/_dev/email/update-confirm?update=' . $update->id);
+};
+
+done_testing();
diff --git a/templates/email/default/alert-update.html b/templates/email/default/alert-update.html
index 8c392685d..c1a7562cd 100644
--- a/templates/email/default/alert-update.html
+++ b/templates/email/default/alert-update.html
@@ -1,6 +1,6 @@
[%
-title = title | html;
+title = report.title | html;
email_summary = "New updates on &ldquo;" _ title _ "&rdquo;";
email_columns = 2;
@@ -19,7 +19,7 @@ INCLUDE '_email_top.html';
</th>
[% WRAPPER '_email_sidebar.html' object = report %]
<h2 style="[% h2_style %]">[% title | html %]</h2>
- <p style="[% secondary_p_style %]">[% detail | html %]</p>
+ <p style="[% secondary_p_style %]">[% report.detail | html %]</p>
[% END %]
[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/default/alert-update.txt b/templates/email/default/alert-update.txt
index 3bf9e4377..2883fee5e 100644
--- a/templates/email/default/alert-update.txt
+++ b/templates/email/default/alert-update.txt
@@ -1,7 +1,7 @@
-Subject: New [% site_name %] updates on report: '[% title %]'
+Subject: New [% site_name %] updates on report: '[% report.title %]'
You asked us to send you an email every time an update was made to the
-[% site_name %] report: [% title %].
+[% site_name %] report: [% report.title %].
The following updates have been left on this report:
@@ -22,7 +22,7 @@ please do not reply to it.
Unsubscribe?
We currently email you whenever someone leaves an update on the
-[% site_name %] report: [% title %].
+[% site_name %] report: [% report.title %].
If you no longer wish to receive an email whenever this report is updated,
please follow this link: [% unsubscribe_url %]
diff --git a/templates/email/default/submit.html b/templates/email/default/submit.html
index 582670f98..8dc06041e 100644
--- a/templates/email/default/submit.html
+++ b/templates/email/default/submit.html
@@ -23,38 +23,36 @@ of a local problem that they believe might require your attention.</p>
<table [% table_reset %]>
<tr>
<th style="[% contact_th_style %]">Name</th>
- <td style="[% contact_td_style %]">[% name | html %]</td>
+ <td style="[% contact_td_style %]">[% report.name | html %]</td>
</tr>
<tr>
<th style="[% contact_th_style %]">Email</th>
<td style="[% contact_td_style %]">
- [%~ IF email ~%]
- <a href="mailto:[% email | html %]">[% email | html %]</a>
+ [%~ IF report.user.email ~%]
+ <a href="mailto:[% report.user.email | html %]">[% report.user.email | html %]</a>
[%~ ELSE ~%]
<strong>No email address provided, only phone number</strong>
[%~ END ~%]
</td>
</tr>
- [%~ IF phone %]
+ [%~ IF report.user.phone %]
<tr>
<th style="[% contact_th_style %]">Phone</th>
- <td style="[% contact_td_style %]"><a href="tel:[% phone | html %]">[% phone | html %]</a></td>
+ <td style="[% contact_td_style %]"><a href="tel:[% report.user.phone | html %]">[% report.user.phone | html %]</a></td>
</tr>
[%~ END %]
</table>
- <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>
+ <p style="[% p_style %] margin-top: 0.5em;">Replies to this message will go directly to [% report.name | html %], the user who reported the problem.</p>
[% end_padded_box %]
</th>
[% WRAPPER '_email_sidebar.html' object = report %]
- <h2 style="[% h2_style %]">[% title | html %]</h2>
- [%~ IF category_line %]
- <p style="[% secondary_p_style %]">[% category | html %]</p>
- [%~ END %]
- <p style="[% secondary_p_style %]">[% detail | html %]</p>
+ <h2 style="[% h2_style %]">[% report.title | html %]</h2>
+ <p style="[% secondary_p_style %]">[% report.category | html %]</p>
+ <p style="[% secondary_p_style %]">[% report.detail | html %]</p>
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<a href="[% osm_url %]" title="View OpenStreetMap of this location">
- [%~ latitude %], [% longitude ~%]
+ [%~ report.latitude %], [% report.longitude ~%]
</a>
[% IF closest_address %]<br>[% closest_address | trim | replace("\n\n", "<br>") %][% END %]
</p>
diff --git a/templates/email/default/submit.txt b/templates/email/default/submit.txt
index 8c88a17f8..f08e723a8 100644
--- a/templates/email/default/submit.txt
+++ b/templates/email/default/submit.txt
@@ -1,4 +1,4 @@
-Subject: Problem Report: [% title %]
+Subject: Problem Report: [% report.title %]
Dear [% bodies_name %],
@@ -13,19 +13,21 @@ please visit the following link:
[% has_photo %]----------
-Name: [% name %]
+Name: [% report.name %]
-Email: [% email OR "None provided" %]
+Email: [% report.user.email OR "None provided" %]
-Phone: [% phone OR "None provided" %]
+Phone: [% report.user.phone OR "None provided" %]
-[% category_line %]Subject: [% title %]
+Category: [% report.category %]
-Details: [% detail %]
+Subject: [% report.title %]
-Latitude: [% latitude %]
+Details: [% report.detail %]
-Longitude: [% longitude %]
+Latitude: [% report.latitude %]
+
+Longitude: [% report.longitude %]
View OpenStreetMap of this location: [% osm_url %]
diff --git a/templates/email/fiksgatami/nn/submit.txt b/templates/email/fiksgatami/nn/submit.txt
index dfbdd9457..0e3f453ba 100644
--- a/templates/email/fiksgatami/nn/submit.txt
+++ b/templates/email/fiksgatami/nn/submit.txt
@@ -1,4 +1,4 @@
-Subject: Problemrapport: [% title %]
+Subject: Problemrapport: [% report.title %]
Til [% bodies_name %],
@@ -13,19 +13,21 @@ problemet, ver venleg og besøk følgjande lenkje:
[% has_photo %]----------
-Namn: [% name %]
+Namn: [% report.name %]
-E-post: [% email OR '-' %]
+E-post: [% report.user.email OR '-' %]
-Telefon: [% phone OR '-' %]
+Telefon: [% report.user.phone OR '-' %]
-[% category_line %]Tema: [% title %]
+Kategori: [% report.category %]
-Detaljer: [% detail %]
+Tema: [% report.title %]
-Breiddegrad: [% latitude %]
+Detaljer: [% report.detail %]
-Lengdegrad: [% longitude %]
+Breiddegrad: [% report.latitude %]
+
+Lengdegrad: [% report.longitude %]
[% closest_address %]----------
diff --git a/templates/email/fiksgatami/submit.txt b/templates/email/fiksgatami/submit.txt
index 165b804f1..114f4cf50 100644
--- a/templates/email/fiksgatami/submit.txt
+++ b/templates/email/fiksgatami/submit.txt
@@ -1,4 +1,4 @@
-Subject: Problemrapport: [% title %]
+Subject: Problemrapport: [% report.title %]
Til [% bodies_name %],
@@ -13,19 +13,21 @@ vennligst besøk følgende lenke:
[% has_photo %]----------
-Navn: [% name %]
+Navn: [% report.name %]
-E-post: [% email OR '-' %]
+E-post: [% report.user.email OR '-' %]
-Telefon: [% phone OR '-' %]
+Telefon: [% report.user.phone OR '-' %]
-[% category_line %]Tema: [% title %]
+Kategori: [% report.category %]
-Detajer: [% detail %]
+Tema: [% report.title %]
-Breddegrad: [% latitude %]
+Detajer: [% report.detail %]
-Lengegrad: [% longitude %]
+Breddegrad: [% report.latitude %]
+
+Lengegrad: [% report.longitude %]
[% closest_address %]----------
diff --git a/templates/email/fixamingata/submit.html b/templates/email/fixamingata/submit.html
index 65a692058..6a1208982 100644
--- a/templates/email/fixamingata/submit.html
+++ b/templates/email/fixamingata/submit.html
@@ -23,21 +23,21 @@ tror medborgaren behöver er uppmärksamhet.</p>
<table [% table_reset %]>
<tr>
<th style="[% contact_th_style %]">Namn</th>
- <td style="[% contact_td_style %]">[% name | html %]</td>
+ <td style="[% contact_td_style %]">[% report.name | html %]</td>
</tr>
<tr>
<th style="[% contact_th_style %]">Epost</th>
<td style="[% contact_td_style %]">
- [%~ IF email ~%]
- <a href="mailto:[% email | html %]">[% email | html %]</a>
+ [%~ IF report.user.email ~%]
+ <a href="mailto:[% report.user.email | html %]">[% report.user.email | html %]</a>
[%~ ELSE ~%]
[%~ END ~%]
</td>
</tr>
- [%~ IF phone %]
+ [%~ IF report.user.phone %]
<tr>
<th style="[% contact_th_style %]">Telefon</th>
- <td style="[% contact_td_style %]"><a href="tel:[% phone | html %]">[% phone | html %]</a></td>
+ <td style="[% contact_td_style %]"><a href="tel:[% report.user.phone | html %]">[% report.user.phone | html %]</a></td>
</tr>
[%~ END %]
</table>
@@ -45,15 +45,13 @@ tror medborgaren behöver er uppmärksamhet.</p>
[% end_padded_box %]
</th>
[% WRAPPER '_email_sidebar.html' object = report %]
- <h2 style="[% h2_style %]">[% title | html %]</h2>
- [%~ IF category_line %]
- <p style="[% secondary_p_style %]">[% category | html %]</p>
- [%~ END %]
- <p style="[% secondary_p_style %]">[% detail | html %]</p>
+ <h2 style="[% h2_style %]">[% report.title | html %]</h2>
+ <p style="[% secondary_p_style %]">[% report.category | html %]</p>
+ <p style="[% secondary_p_style %]">[% report.detail | html %]</p>
<p style="[% secondary_p_style %]">
<strong>Plats:</strong>
<a href="[% osm_url %]" title="Se den här platsen på OpenStreetMap">
- [%~ latitude %], [% longitude ~%]
+ [%~ report.latitude %], [% report.longitude ~%]
</a>
[% IF closest_address %]<br>[% closest_address | trim | replace("\n\n", "<br>") %][% END %]
</p>
diff --git a/templates/email/fixamingata/submit.txt b/templates/email/fixamingata/submit.txt
index fc8b65886..d2e7399b4 100644
--- a/templates/email/fixamingata/submit.txt
+++ b/templates/email/fixamingata/submit.txt
@@ -1,4 +1,4 @@
-Subject: Ny rapport: [% title %]
+Subject: Ny rapport: [% report.title %]
Till [% bodies_name %],
@@ -14,25 +14,27 @@ tror medborgaren behöver er uppmärksamhet.
** Uppgiftslämnare
-Namn: [% name %]
+Namn: [% report.name %]
-Epost: [% email OR '-' %]
+Epost: [% report.user.email OR '-' %]
-Telefonnummer: [% phone OR '-' %]
+Telefonnummer: [% report.user.phone OR '-' %]
** Information om ärendet
-ID: [% id %]
+ID: [% report.id %]
-[% category_line %]Ärende: [% title %]
+Kategori: [% report.category %]
-[% detail %]
+Ärende: [% report.title %]
+
+[% report.detail %]
** Geografisk position
-Latitude: [% latitude %]
+Latitude: [% report.latitude %]
-Longitude: [% longitude %]
+Longitude: [% report.longitude %]
** Övrigt
diff --git a/templates/email/fixmystreet.com/submit.html b/templates/email/fixmystreet.com/submit.html
index 24bb5f86f..2742c4b44 100644
--- a/templates/email/fixmystreet.com/submit.html
+++ b/templates/email/fixmystreet.com/submit.html
@@ -23,34 +23,32 @@ of a local problem that they believe might require your attention.</p>
<table [% table_reset %]>
<tr>
<th style="[% contact_th_style %]">Name</th>
- <td style="[% contact_td_style %]">[% name | html %]</td>
+ <td style="[% contact_td_style %]">[% report.name | html %]</td>
</tr>
<tr>
<th style="[% contact_th_style %]">Email</th>
<td style="[% contact_td_style %]">
- [%~ IF email ~%]
- <a href="mailto:[% email | html %]">[% email | html %]</a>
+ [%~ IF report.user.email ~%]
+ <a href="mailto:[% report.user.email | html %]">[% report.user.email | html %]</a>
[%~ ELSE ~%]
<strong>No email address provided, only phone number</strong>
[%~ END ~%]
</td>
</tr>
- [%~ IF phone %]
+ [%~ IF report.user.phone %]
<tr>
<th style="[% contact_th_style %]">Phone</th>
- <td style="[% contact_td_style %]"><a href="tel:[% phone | html %]">[% phone | html %]</a></td>
+ <td style="[% contact_td_style %]"><a href="tel:[% report.user.phone | html %]">[% report.user.phone | html %]</a></td>
</tr>
[%~ END %]
</table>
- <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>
+ <p style="[% p_style %] margin-top: 0.5em;">Replies to this message will go directly to [% report.name | html %], the user who reported the problem.</p>
[% end_padded_box %]
</th>
[% WRAPPER '_email_sidebar.html' object = report %]
- <h2 style="[% h2_style %]">[% title | html %]</h2>
- [%~ IF category_line %]
- <p style="[% secondary_p_style %]"><strong>Category:</strong> [% category | html %]</p>
- [%~ END %]
- <p style="[% secondary_p_style %]">[% detail | html %]</p>
+ <h2 style="[% h2_style %]">[% report.title | html %]</h2>
+ <p style="[% secondary_p_style %]"><strong>Category:</strong> [% report.category | html %]</p>
+ <p style="[% secondary_p_style %]">[% report.detail | html %]</p>
[%~ IF additional_information %]
<p style="[% secondary_p_style %]">[% additional_information %]</p>
[%~ END %]
@@ -60,7 +58,7 @@ of a local problem that they believe might require your attention.</p>
[%~ " (IE)" IF coordsyst == "I" ~%]
: [% easting %]/[% northing %]
(<a href="[% osm_url %]" title="View OpenStreetMap of this location">
- [%~ latitude %], [% longitude ~%]
+ [%~ report.latitude %], [% report.longitude ~%]
</a>)
[% IF closest_address %]<br>[% closest_address | trim | replace("\n\n", "<br>") %][% END %]
</p>
diff --git a/templates/email/fixmystreet.com/submit.txt b/templates/email/fixmystreet.com/submit.txt
index 5bcbef87b..3eaf400a2 100644
--- a/templates/email/fixmystreet.com/submit.txt
+++ b/templates/email/fixmystreet.com/submit.txt
@@ -1,4 +1,4 @@
-Subject: Problem Report: [% title %]
+Subject: Problem Report: [% report.title %]
Dear [% bodies_name %],
@@ -13,15 +13,17 @@ please visit the following link:
[% has_photo %]----------
-Name: [% name %]
+Name: [% report.name %]
-Email: [% email OR 'None provided' %]
+Email: [% report.user.email OR 'None provided' %]
-Phone: [% phone OR 'None provided' %]
+Phone: [% report.user.phone OR 'None provided' %]
-[% category_line %]Subject: [% title %]
+Category: [% report.category %]
-Details: [% detail %]
+Subject: [% report.title %]
+
+Details: [% report.detail %]
[% additional_information %]
@@ -29,9 +31,9 @@ Easting/Northing
[%- " (IE)" IF coordsyst == "I" -%]
: [% easting %]/[% northing %]
-Latitude: [% latitude %]
+Latitude: [% report.latitude %]
-Longitude: [% longitude %]
+Longitude: [% report.longitude %]
View OpenStreetMap of this location: [% osm_url %]
diff --git a/templates/email/zurich/submit-external-personal.txt b/templates/email/zurich/submit-external-personal.txt
index 820ccfb70..701d7eaab 100644
--- a/templates/email/zurich/submit-external-personal.txt
+++ b/templates/email/zurich/submit-external-personal.txt
@@ -1,4 +1,4 @@
-Subject: Züri wie neu: Weitergeleitete Meldung #[% id %]
+Subject: Züri wie neu: Weitergeleitete Meldung #[% report.id %]
Grüezi [% bodies_name %],
@@ -7,11 +7,11 @@ Grüezi [% bodies_name %],
Öffentliche URL: [% url %]
-Name des Meldenden: [% name %]
+Name des Meldenden: [% report.name %]
-Email des Meldenden: [% email %]
+Email des Meldenden: [% report.user.email %]
-Telefonnummer des Meldenden: [% phone %]
+Telefonnummer des Meldenden: [% report.user.phone %]
Bei Fragen zu "Züri wie neu" wenden Sie sich bitte an gis-zentrum@zuerich.ch.
diff --git a/templates/email/zurich/submit-external-wish.txt b/templates/email/zurich/submit-external-wish.txt
index a81d13893..3ac0ea58c 100644
--- a/templates/email/zurich/submit-external-wish.txt
+++ b/templates/email/zurich/submit-external-wish.txt
@@ -1,17 +1,17 @@
-Subject: Züri wie neu: Weitergeleitete Meldung #[% id %]
+Subject: Züri wie neu: Weitergeleitete Meldung #[% report.id %]
Grüezi [% bodies_name %],
[% external_message %]
-Name des Meldenden: [% name %]
+Name des Meldenden: [% report.name %]
-Email des Meldenden: [% email %]
+Email des Meldenden: [% report.user.email %]
-Telefonnummer des Meldenden: [% phone %]
+Telefonnummer des Meldenden: [% report.user.phone %]
-Meldung: [% detail %]
+Meldung: [% report.detail %]
Standort in AV-Online anzeigen:
http://webgis.intra.stzh.ch/AV_Online/Direct.asp?Map=AV&Search=Koord&West=[% west %]&Nord=[% nord %]&B=300
diff --git a/templates/email/zurich/submit-external.txt b/templates/email/zurich/submit-external.txt
index a747a001c..ec2053f35 100644
--- a/templates/email/zurich/submit-external.txt
+++ b/templates/email/zurich/submit-external.txt
@@ -1,4 +1,4 @@
-Subject: Züri wie neu: Weitergeleitete Meldung #[% id %]
+Subject: Züri wie neu: Weitergeleitete Meldung #[% report.id %]
Grüezi [% bodies_name %],
diff --git a/templates/email/zurich/submit-feedback-pending.txt b/templates/email/zurich/submit-feedback-pending.txt
index bd95e3812..58d35ed36 100644
--- a/templates/email/zurich/submit-feedback-pending.txt
+++ b/templates/email/zurich/submit-feedback-pending.txt
@@ -1,4 +1,4 @@
-Subject: Züri wie neu: Meldung #[% id %] bereit für Feedback
+Subject: Züri wie neu: Meldung #[% report.id %] bereit für Feedback
Guten Tag [% bodies_name %],
diff --git a/templates/email/zurich/submit-in-progress.txt b/templates/email/zurich/submit-in-progress.txt
index 7be06cf13..3c3ac65ff 100644
--- a/templates/email/zurich/submit-in-progress.txt
+++ b/templates/email/zurich/submit-in-progress.txt
@@ -1,4 +1,4 @@
-Subject: Züri wie neu: Neue Meldung #[% id %]
+Subject: Züri wie neu: Neue Meldung #[% report.id %]
Guten Tag [% bodies_name %],
diff --git a/templates/email/zurich/submit.txt b/templates/email/zurich/submit.txt
index ef4acaafe..c9c84f90c 100644
--- a/templates/email/zurich/submit.txt
+++ b/templates/email/zurich/submit.txt
@@ -1,4 +1,4 @@
-Subject: Züri wie neu: Neue Meldung #[% id %]
+Subject: Züri wie neu: Neue Meldung #[% report.id %]
Guten Tag [% bodies_name %],
diff --git a/templates/web/base/develop/email_list.html b/templates/web/base/develop/email_list.html
new file mode 100755
index 000000000..5b4298522
--- /dev/null
+++ b/templates/web/base/develop/email_list.html
@@ -0,0 +1,11 @@
+[% INCLUDE 'header.html' %]
+
+<h1>[% loc('Templates') %]</h1>
+
+<ul>
+[% FOR template IN templates %]
+<li><a href="[% template.url %]">[% template.name %]</a></li>
+[% END %]
+</ul>
+
+[% INCLUDE 'footer.html' %]