aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/alert
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/alert')
-rw-r--r--templates/web/base/alert/_index_text.html25
-rw-r--r--templates/web/base/alert/_list.html21
-rw-r--r--templates/web/base/alert/_list_rss_local.html10
-rw-r--r--templates/web/base/alert/index.html30
-rw-r--r--templates/web/base/alert/list.html2
-rw-r--r--templates/web/base/alert/updates.html16
6 files changed, 62 insertions, 42 deletions
diff --git a/templates/web/base/alert/_index_text.html b/templates/web/base/alert/_index_text.html
new file mode 100644
index 000000000..80ed142d1
--- /dev/null
+++ b/templates/web/base/alert/_index_text.html
@@ -0,0 +1,25 @@
+<p>
+[% IF c.cobrand.is_council %]
+[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local
+problems, including alerts for all problems within a particular ward, or all
+problems within a certain distance of a particular location.', "%s is the site name"), site_name) %]
+[% ELSE %]
+[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local problems, including
+alerts for all problems within a particular ward or council, or all problems
+within a certain distance of a particular location.', "%s is the site name"), site_name) %]
+[% END %]
+</p>
+
+[% IF location_error %]
+ <div class="error">[% location_error | safe %]</div>
+[% ELSE %]
+ [% INCLUDE 'errors.html' %]
+[% END %]
+
+<p>
+[% IF c.cobrand.is_council %]
+[% tprintf(loc('To find out what local alerts we have for you, please enter your %s postcode or street name and area:'), c.cobrand.council_area) %]
+[% ELSE %]
+[% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %]
+[% END %]
+</p>
diff --git a/templates/web/base/alert/_list.html b/templates/web/base/alert/_list.html
index d997a5abb..782989a5c 100644
--- a/templates/web/base/alert/_list.html
+++ b/templates/web/base/alert/_list.html
@@ -22,24 +22,18 @@
<h3>[% loc('Problems in an area') %]</h3>
[% END %]
- <p id="rss_local">
- <a href="[% rss_feed_uri %]"><img src='/i/feed.png' width='16' height='16' title='[% loc('RSS feed of nearby problems') %]' alt='[% loc('RSS feed') %]' border='0'></a>
- <label class="label-containing-checkbox" for="[% rss_feed_id %]">
- <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]>
- [% tprintf( loc('Problems within %.1fkm of %s'), population_radius, name_of_location ) %]
- [% loc('(covers roughly 200,000 people)') %]
- </label>
- </p>
+ [% PROCESS 'alert/_list_rss_local.html' %]
<p id="rss_local_alt">
[% SET distance_options = '<a href="' _ rss_feed_2k _ ' ">2km</a> / <a href="' _ rss_feed_5k _ ' ">5km</a> / <a href="' _ rss_feed_10k _ '">10km</a> / <a href="' _ rss_feed_20k _ '">20km</a>' %]
- [% tprintf(loc('(we also have RSS feeds for problems within %s)', "%s is a list of distance links, e.g. [2km] / [5km] / [10km] / [20km]"), distance_options) %]
+ [% tprintf(loc('(we also have RSS feeds for problems within %s)', "%s is a list of distance links, e.g. [2km] / [5km] / [10km] / [20km]"), mark_safe(distance_options)) %]
</p>
[% FOREACH option IN options %]
<p>
- <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16"
-title="[% option.rss_text %]" alt="RSS feed" border="0"></a>
+ <a href="[% option.uri %]" class="alerts-rss-link">
+ <img src="/i/feed.png" width="16" height="16" title="[% option.rss_text %]" alt="[% loc('RSS feed') %]">
+ </a>
<label class="label-containing-checkbox" for="[% option.id %]">
<input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]>
[% option.text %]
@@ -55,8 +49,9 @@ title="[% option.rss_text %]" alt="RSS feed" border="0"></a>
[% FOREACH option IN reported_to_options %]
<p>
- <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16"
- title="[% option.rss_text %]" alt="RSS feed" border="0"></a>
+ <a href="[% option.uri %]" class="alerts-rss-link">
+ <img src="/i/feed.png" width="16" height="16" title="[% option.rss_text %]" alt="[% loc('RSS feed') %]">
+ </a>
<label class="label-containing-checkbox" for="[% option.id %]">
<input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]>
[% option.text %]
diff --git a/templates/web/base/alert/_list_rss_local.html b/templates/web/base/alert/_list_rss_local.html
new file mode 100644
index 000000000..a7fd82ca2
--- /dev/null
+++ b/templates/web/base/alert/_list_rss_local.html
@@ -0,0 +1,10 @@
+ <p id="rss_local">
+ <a href="[% rss_feed_uri %]" class="alerts-rss-link">
+ <img src="/i/feed.png" width="16" height="16" title="[% loc('RSS feed of nearby problems') %]" alt="[% loc('RSS feed') %]">
+ </a>
+ <label class="label-containing-checkbox" for="[% rss_feed_id %]">
+ <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]>
+ [% tprintf( loc('Problems within %.1fkm of %s'), population_radius, name_of_location ) %]
+ [% loc('(covers roughly 200,000 people)') %]
+ </label>
+ </p>
diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html
index fa6e01fad..80186ded7 100644
--- a/templates/web/base/alert/index.html
+++ b/templates/web/base/alert/index.html
@@ -3,41 +3,19 @@
<h1>[% loc('Local RSS feeds and email alerts') %]</h1>
-<p>
-[% IF c.cobrand.is_council %]
-[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local
-problems, including alerts for all problems within a particular ward, or all
-problems within a certain distance of a particular location.', "%s is the site name"), site_name) %]
-[% ELSE %]
-[% tprintf(loc('%s has a variety of RSS feeds and email alerts for local problems, including
-alerts for all problems within a particular ward or council, or all problems
-within a certain distance of a particular location.', "%s is the site name"), site_name) %]
-[% END %]
-</p>
-
-[% IF location_error %]
- <div class="error">[% location_error %]</div>
-[% ELSE %]
- [% INCLUDE 'errors.html' %]
-[% END %]
+[% PROCESS 'alert/_index_text.html' %]
-<p>
-[% IF c.cobrand.is_council %]
-[% tprintf(loc('To find out what local alerts we have for you, please enter your %s postcode or street name and area:'), c.cobrand.council_area) %]
-[% ELSE %]
-[% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %]
-[% END %]
-</p>
<form method="get" action="/alert/list" class="form-box js-geolocate">
<fieldset>
+ <legend class="visuallyhidden">[% loc('Search for location of email alert or RSS feed') %]</legend>
<label for="pc">[% loc('Postcode or street name and area') %]</label>
<p class="form-hint" id="pc-hint">[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]</p>
<div class="form-txt-submit-box">
<input class="form-control" type="text" id="pc" name="pc" value="[% pc | html %]" aria-describedby="pc-hint">
- <input class="green-btn" type="submit" value="[% loc('Go') %]">
+ [% INCLUDE 'around/_postcode_submit_button.html' attr='class="green-btn"' %]
</div>
</fieldset>
- <a href="/alert/list" id="geolocate_link">&hellip; [% loc('or locate me automatically') %]</a>
+ <a href="/alert/list" id="geolocate_link">&hellip; [% loc('or use my location') %]</a>
</form>
[% IF photos.size %]
diff --git a/templates/web/base/alert/list.html b/templates/web/base/alert/list.html
index 14215b65d..dbc877a69 100644
--- a/templates/web/base/alert/list.html
+++ b/templates/web/base/alert/list.html
@@ -10,7 +10,7 @@
[% IF pretty_pc %]
[%
- pretty_pc = pretty_pc | html | replace(' ', '&nbsp;');
+ pretty_pc = pretty_pc | replace(' ', ' '); # Non-breaking space
title = tprintf( loc("Local RSS feeds and email alerts for ‘%s’"), pretty_pc );
%]
[% END %]
diff --git a/templates/web/base/alert/updates.html b/templates/web/base/alert/updates.html
index a77f8d0f9..0fbed2254 100644
--- a/templates/web/base/alert/updates.html
+++ b/templates/web/base/alert/updates.html
@@ -5,7 +5,7 @@
[% INCLUDE 'errors.html' %]
-<p><a href="[% c.uri_for( '/rss', problem_id ) %]">
+<p><a href="[% c.uri_for( '/rss', problem.id ) %]">
<img src="/i/feed.png" width="16" height="16" title="[% loc('RSS feed') %]" alt="[% loc('RSS feed of updates to this problem' ) %]" border="0" style="float:right">
</a>
</p>
@@ -16,15 +16,27 @@
<form action="/alert/subscribe" method="post">
<fieldset>
+ [% IF c.user_exists %]
+ [% IF c.user.has_permission_to("contribute_as_another_user", problem.bodies_str_ids) %]
+ <label class="hidden n" for="alert_rznvy">[% loc('Email') %]</label>
+ <div class="form-txt-submit-box">
+ <input class="form-control" type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]">
+ <input class="green-btn" type="submit" value="[% loc('Subscribe') %]">
+ </div>
+ [% ELSE %]
+ <input class="green-btn" type="submit" name="alert" value="[% loc('Subscribe') %]">
+ [% END %]
+ [% ELSE %]
<label class="hidden n" for="alert_rznvy">[% loc('Your email') %]</label>
<div class="form-txt-submit-box">
<input class="form-control" type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]">
<input class="green-btn" type="submit" value="[% loc('Subscribe') %]">
</div>
+ [% END %]
<input type="hidden" name="token" value="[% csrf_token %]">
- <input type="hidden" name="id" value="[% problem_id | html %]">
+ <input type="hidden" name="id" value="[% problem.id | html %]">
<input type="hidden" name="type" value="updates">
</fieldset>
</form>