aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-10-05 11:42:20 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-10-07 14:57:12 +0100
commitef0c07ba692b8046fe865d9849104324d4f40977 (patch)
tree0bf10401c1465c84b7a32d263b4dbe13710451d4 /templates
parent300b6d5942c4c8726febd9681b47e2134e8efbf0 (diff)
Add state/category filters to base cobrand.
This removes the on map/nearby tabs, replacing them with one combined list. The styling is moved to the base, so that it is used on mobile too. A closed option is added to the existing dropdown, and the base/fixmystreet my templates are also combined. Fixes #1141.
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/around/around_map_list_items.html18
-rw-r--r--templates/web/base/around/on_map_list_items.html13
-rwxr-xr-xtemplates/web/base/around/tabbed_lists.html13
-rw-r--r--templates/web/base/my/_problem-list.html25
-rw-r--r--templates/web/base/my/my.html51
-rw-r--r--templates/web/base/reports/_list-filters.html34
-rw-r--r--templates/web/bromley/around/around_map_list_items.html0
-rw-r--r--templates/web/bromley/around/tabbed_lists.html5
l---------templates/web/bromley/reports/_list-filters.html1
-rw-r--r--templates/web/fixmystreet/around/around_map_list_items.html9
-rw-r--r--templates/web/fixmystreet/my/_problem-list.html27
-rw-r--r--templates/web/fixmystreet/my/my.html60
-rw-r--r--templates/web/greenwich/around/around_map_list_items.html0
-rw-r--r--templates/web/greenwich/around/tabbed_lists.html5
l---------templates/web/greenwich/reports/_list-filters.html1
-rw-r--r--templates/web/oxfordshire/around/around_map_list_items.html0
-rw-r--r--templates/web/oxfordshire/around/tabbed_lists.html5
-rw-r--r--templates/web/oxfordshire/reports/_list-filters.html32
-rw-r--r--templates/web/zerotb/around/around_map_list_items.html9
-rw-r--r--templates/web/zerotb/around/on_map_list_items.html13
-rw-r--r--templates/web/zerotb/around/tabbed_lists.html11
21 files changed, 92 insertions, 240 deletions
diff --git a/templates/web/base/around/around_map_list_items.html b/templates/web/base/around/around_map_list_items.html
deleted file mode 100644
index da75561b5..000000000
--- a/templates/web/base/around/around_map_list_items.html
+++ /dev/null
@@ -1,18 +0,0 @@
-[% IF around_map.size %]
- [% FOREACH p IN around_map %]
-
- [% dist = tprintf("%.1f", (p.distance || 0) ) %]
-
- <li>
- <a href="[% c.uri_for('/report', p.problem.id ) %]">[% p.problem.title | html %]</a>
- <small>[% prettify_dt( p.problem.confirmed, 1 ) %], [% dist %]km</small>
- [% IF p.problem.is_fixed %]
- <small>[% loc('(fixed)') %]</small>
- [% ELSIF p.problem.is_closed %]
- <small>[% loc('(closed)') %]</small>
- [% END %]
- </li>
- [% END %]
-[% ELSE %]
- <li>[% loc('No problems found.') %]</li>
-[% END %]
diff --git a/templates/web/base/around/on_map_list_items.html b/templates/web/base/around/on_map_list_items.html
index 7b66d4267..5de0f9216 100644
--- a/templates/web/base/around/on_map_list_items.html
+++ b/templates/web/base/around/on_map_list_items.html
@@ -1,7 +1,14 @@
-[% IF on_map.size %]
- [% FOREACH problem IN on_map %]
+[% all_reports = on_map.merge(around_map) %]
+[% IF all_reports.size %]
+ [% FOREACH problem IN all_reports %]
+ [% UNLESS problem.title;
+ dist = tprintf("%.1f", (problem.distance || 0) );
+ problem = problem.problem;
+ END %]
[% INCLUDE 'report/_item.html' %]
[% END %]
[% ELSE %]
- <li><p>[% loc('No problems have been reported yet.') %]</p></li>
+ <li class="empty">
+ <p>[% loc('There are no reports to show.') %]</p>
+ </li>
[% END %]
diff --git a/templates/web/base/around/tabbed_lists.html b/templates/web/base/around/tabbed_lists.html
index 40048f6b2..2828027e2 100755
--- a/templates/web/base/around/tabbed_lists.html
+++ b/templates/web/base/around/tabbed_lists.html
@@ -1,14 +1,5 @@
-<menu id="problems-nav" class="tab-nav">
- <ul>
- <li><a href="#current">[% loc('Problems on the map') %]</a></li>
- <li><a href="#current_near">[% loc( 'Problems nearby' ) %]</a></li>
- </ul>
-</menu>
+[% INCLUDE "reports/_list-filters.html" %]
-<ul id="current" class="issue-list-a tab">
+<ul id="current" class="issue-list-a">
[% INCLUDE "around/on_map_list_items.html" %]
</ul>
-
-<ul id="current_near" class="issue-list-a tab">
- [% INCLUDE "around/around_map_list_items.html" %]
-</ul>
diff --git a/templates/web/base/my/_problem-list.html b/templates/web/base/my/_problem-list.html
new file mode 100644
index 000000000..b8a3f07a2
--- /dev/null
+++ b/templates/web/base/my/_problem-list.html
@@ -0,0 +1,25 @@
+<ul class='issue-list-a full-width'>
+ [% IF problems.size %]
+ [% FOREACH p = problems %]
+ [% INCLUDE 'report/_item.html', problem = p, no_fixed = 1 %]
+ [% END %]
+ [% ELSE %]
+ <li class="empty">
+ <p>[% loc('There are no reports to show.') %]</p>
+ </li>
+ [% END %]
+</ul>
+
+[% IF ! problems.size %]
+<!-- Preserve behaviour of map filters despite map not being shown -->
+<script type="text/javascript">
+ (function($) {
+ $(function() {
+ $(".report-list-filters [type=submit]").hide();
+ $(".report-list-filters select").change(function() {
+ $(this).closest("form").submit();
+ });
+ })
+ })(window.jQuery);
+</script>
+[% END %]
diff --git a/templates/web/base/my/my.html b/templates/web/base/my/my.html
index f3ad3f2fe..91cf40b68 100644
--- a/templates/web/base/my/my.html
+++ b/templates/web/base/my/my.html
@@ -21,32 +21,20 @@
c.uri_for('/') ) %]
[% END %]
+[% IF c.cobrand.moniker == 'fixmybarangay' %]
+ [% INCLUDE '_barangay_buttons.html' %]
+[% ELSIF c.cobrand.moniker == 'hart' %]
+ [% INCLUDE '_hart_hants_note.html' %]
+[% END %]
+
+[% INCLUDE "reports/_list-filters.html", use_section_wrapper = 1 %]
+
[% INCLUDE 'pagination.html',
pager = problems_pager,
param = 'p'
%]
-[% FOREACH p = problems.confirmed %]
- [% IF loop.first %]<h2>[% loc('Open reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[% FOREACH p = problems.fixed %]
- [% IF loop.first %]<h2>[% loc('Fixed reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[% FOREACH p = problems.closed %]
- [% IF loop.first %]<h2>[% loc('Closed reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[%# FOREACH p = problems.unconfirmed;
- IF loop.first;
- '<h2>' _ loc('Unconfirmed reports') _ '</h2>';
- END;
- INCLUDE problem;
-END %]
+[% INCLUDE 'my/_problem-list.html' %]
[% FOREACH u IN updates %]
[% IF loop.first %]
@@ -60,9 +48,9 @@ END %]
<li>&ldquo;[% u.text | html %]&rdquo;
&ndash; <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>.
- <em class="council_sent_info">
+ <p><small class="council_sent_info">
[% tprintf( loc("Added %s"), prettify_dt( u.confirmed, 'date' ) ) %]
- </em>
+ </small></p>
</li>
[% "</ul>" IF loop.last %]
[% END %]
@@ -70,20 +58,3 @@ END %]
</div>
[% INCLUDE 'footer.html' %]
-
-[% BLOCK problem %]
- [% "<ul class='issue-list-a full-width'>" IF loop.first %]
-
- <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a>
- <em class="council_sent_info"> &ndash;
- [% IF p.whensent %]
- [% tprintf( loc("Reported %s, to %s"), prettify_dt( p.confirmed, 'date' ), p.body(c) ) %]
- [% ELSE %]
- [% tprintf( loc("Reported %s"), prettify_dt( p.confirmed, 'date' ) ) %]
- [% END %]
- </em>
- </li>
-
- [% "</ul>" IF loop.last %]
-[% END %]
-
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index e69de29bb..4dd270dc6 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -0,0 +1,34 @@
+[% select_status = BLOCK %]
+ <select name="status" id="statuses">
+ <option value="all"[% ' selected' IF filter_status == 'all' %]>[% loc('all reports') %]</option>
+ <option value="open"[% ' selected' IF filter_status == 'open' %]>[% loc('unfixed reports') %]</option>
+ <option value="closed"[% ' selected' IF filter_status == 'closed' %]>[% loc('closed reports') %]</option>
+ <option value="fixed"[% ' selected' IF filter_status == 'fixed' %]>[% loc('fixed reports') %]</option>
+ </select>
+[% END %]
+
+[% select_category = BLOCK %]
+ <select name="filter_category" id="filter_categories">
+ <option value="">[% loc('Everything') %]</option>
+ [% FOR category IN filter_categories %]
+ <option value="[% category | html %]"[% ' selected' IF filter_category == category %]>
+ [% category | html %]
+ </option>
+ [% END %]
+ </select>
+[% END %]
+
+[% IF use_section_wrapper %]
+<section class="full-width">
+ <form method="get" action="">
+[% END %]
+
+ <p class="report-list-filters">
+ [% tprintf(loc('<label>Show %s</label> <label>about %s</label>', 'The first %s is a dropdown of all/fixed/etc, the second is a dropdown of categories'), select_status, select_category) %]
+ <input type="submit" value="[% loc('Go') %]">
+ </p>
+
+[% IF use_section_wrapper %]
+ </form>
+</section>
+[% END %]
diff --git a/templates/web/bromley/around/around_map_list_items.html b/templates/web/bromley/around/around_map_list_items.html
deleted file mode 100644
index e69de29bb..000000000
--- a/templates/web/bromley/around/around_map_list_items.html
+++ /dev/null
diff --git a/templates/web/bromley/around/tabbed_lists.html b/templates/web/bromley/around/tabbed_lists.html
deleted file mode 100644
index ab95ec828..000000000
--- a/templates/web/bromley/around/tabbed_lists.html
+++ /dev/null
@@ -1,5 +0,0 @@
-[% INCLUDE "reports/_list-filters.html" %]
-
-<ul class="issue-list-a" id="current">
- [% INCLUDE "around/on_map_list_items.html" %]
-</ul>
diff --git a/templates/web/bromley/reports/_list-filters.html b/templates/web/bromley/reports/_list-filters.html
deleted file mode 120000
index 0422239b4..000000000
--- a/templates/web/bromley/reports/_list-filters.html
+++ /dev/null
@@ -1 +0,0 @@
-../../oxfordshire/reports/_list-filters.html \ No newline at end of file
diff --git a/templates/web/fixmystreet/around/around_map_list_items.html b/templates/web/fixmystreet/around/around_map_list_items.html
deleted file mode 100644
index 612b37d00..000000000
--- a/templates/web/fixmystreet/around/around_map_list_items.html
+++ /dev/null
@@ -1,9 +0,0 @@
-[% IF around_map.size %]
- [% FOREACH p IN around_map %]
- [% INCLUDE 'report/_item.html'
- problem = p.problem,
- dist = tprintf("%.1f", (p.distance || 0) ) %]
- [% END %]
-[% ELSE %]
- <li><p>[% loc('No problems found.') %]</p></li>
-[% END %]
diff --git a/templates/web/fixmystreet/my/_problem-list.html b/templates/web/fixmystreet/my/_problem-list.html
deleted file mode 100644
index 1a891de80..000000000
--- a/templates/web/fixmystreet/my/_problem-list.html
+++ /dev/null
@@ -1,27 +0,0 @@
-[% FOREACH p = problems.confirmed %]
- [% IF loop.first %]<h2>[% loc('Open reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[% FOREACH p = problems.fixed %]
- [% IF loop.first %]<h2>[% loc('Fixed reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[% FOREACH p = problems.closed %]
- [% IF loop.first %]<h2>[% loc('Closed reports') %]</h2>[% END %]
- [% INCLUDE problem %]
-[% END %]
-
-[%# FOREACH p = problems.unconfirmed;
- IF loop.first;
- '<h2>' _ loc('Unconfirmed reports') _ '</h2>';
- END;
- INCLUDE problem;
-END %]
-
-[% BLOCK problem %]
- [% "<ul class='issue-list-a full-width'>" IF loop.first %]
- [% INCLUDE 'report/_item.html', problem = p, no_fixed =1 %]
- [% "</ul>" IF loop.last %]
-[% END %]
diff --git a/templates/web/fixmystreet/my/my.html b/templates/web/fixmystreet/my/my.html
deleted file mode 100644
index 16779e503..000000000
--- a/templates/web/fixmystreet/my/my.html
+++ /dev/null
@@ -1,60 +0,0 @@
-[%
- SET bodyclass = 'mappage';
- PROCESS "maps/${map.type}.html" IF problems.size;
- INCLUDE 'header.html', title = loc('Your Reports');
-%]
-
-[% IF problems.size %]
- [% map_html %]
- </div>
- <div id="side">
-[% ELSE %]
- <div id="skipped-map">
-[% END %]
-
-<h1>[% loc('Your Reports') %]</h1>
-
-<p><a href="/auth/change_password">[% loc('Change password') %]</a></p>
-
-[% IF ! has_content %]
-[% tprintf( loc('You haven&rsquo;t created any reports yet. <a href="%s">Report a problem now.</a>'),
- c.uri_for('/') ) %]
-[% END %]
-
-[% IF c.cobrand.moniker == 'fixmybarangay' %]
- [% INCLUDE '_barangay_buttons.html' %]
-[% ELSIF c.cobrand.moniker == 'hart' %]
- [% INCLUDE '_hart_hants_note.html' %]
-[% END %]
-
-[% INCLUDE "reports/_list-filters.html", use_section_wrapper = 1 %]
-
-[% INCLUDE 'pagination.html',
- pager = problems_pager,
- param = 'p'
-%]
-
-[% INCLUDE 'my/_problem-list.html' %]
-
-[% FOREACH u IN updates %]
- [% IF loop.first %]
- <h2>[% loc('Your updates') %]</h2>
- [% INCLUDE 'pagination.html',
- pager = updates_pager,
- param = 'u'
- %]
- <ul class="issue-list full-width">
- [% END %]
-
- <li>&ldquo;[% u.text | html %]&rdquo;
- &ndash; <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>.
- <p><small class="council_sent_info">
- [% tprintf( loc("Added %s"), prettify_dt( u.confirmed, 'date' ) ) %]
- </small></p>
- </li>
- [% "</ul>" IF loop.last %]
-[% END %]
-
-</div>
-
-[% INCLUDE 'footer.html' %]
diff --git a/templates/web/greenwich/around/around_map_list_items.html b/templates/web/greenwich/around/around_map_list_items.html
deleted file mode 100644
index e69de29bb..000000000
--- a/templates/web/greenwich/around/around_map_list_items.html
+++ /dev/null
diff --git a/templates/web/greenwich/around/tabbed_lists.html b/templates/web/greenwich/around/tabbed_lists.html
deleted file mode 100644
index ab95ec828..000000000
--- a/templates/web/greenwich/around/tabbed_lists.html
+++ /dev/null
@@ -1,5 +0,0 @@
-[% INCLUDE "reports/_list-filters.html" %]
-
-<ul class="issue-list-a" id="current">
- [% INCLUDE "around/on_map_list_items.html" %]
-</ul>
diff --git a/templates/web/greenwich/reports/_list-filters.html b/templates/web/greenwich/reports/_list-filters.html
deleted file mode 120000
index 0422239b4..000000000
--- a/templates/web/greenwich/reports/_list-filters.html
+++ /dev/null
@@ -1 +0,0 @@
-../../oxfordshire/reports/_list-filters.html \ No newline at end of file
diff --git a/templates/web/oxfordshire/around/around_map_list_items.html b/templates/web/oxfordshire/around/around_map_list_items.html
deleted file mode 100644
index e69de29bb..000000000
--- a/templates/web/oxfordshire/around/around_map_list_items.html
+++ /dev/null
diff --git a/templates/web/oxfordshire/around/tabbed_lists.html b/templates/web/oxfordshire/around/tabbed_lists.html
deleted file mode 100644
index ab95ec828..000000000
--- a/templates/web/oxfordshire/around/tabbed_lists.html
+++ /dev/null
@@ -1,5 +0,0 @@
-[% INCLUDE "reports/_list-filters.html" %]
-
-<ul class="issue-list-a" id="current">
- [% INCLUDE "around/on_map_list_items.html" %]
-</ul>
diff --git a/templates/web/oxfordshire/reports/_list-filters.html b/templates/web/oxfordshire/reports/_list-filters.html
deleted file mode 100644
index 5d610261b..000000000
--- a/templates/web/oxfordshire/reports/_list-filters.html
+++ /dev/null
@@ -1,32 +0,0 @@
-[% IF use_section_wrapper %]
-<section class="full-width">
- <form method="get" action="">
-[% END %]
-
- <p class="report-list-filters">
- <label>
- Show
- <select name="status" id="statuses">
- <option value="all"[% ' selected' IF filter_status == 'all' %]>all reports</option>
- <option value="open"[% ' selected' IF filter_status == 'open' %]>unfixed reports</option>
- <option value="fixed"[% ' selected' IF filter_status == 'fixed' %]>fixed reports</option>
- </select>
- </label>
- <label>
- about
- <select name="filter_category" id="filter_categories">
- <option value="">Everything</option>
- [% FOR category IN filter_categories %]
- <option value="[% category | html %]"[% ' selected' IF filter_category == category %]>
- [% category | html %]
- </option>
- [% END %]
- </select>
- </label>
- <input type=submit value="Go" />
- </p>
-
-[% IF use_section_wrapper %]
- </form>
-</section>
-[% END %]
diff --git a/templates/web/zerotb/around/around_map_list_items.html b/templates/web/zerotb/around/around_map_list_items.html
deleted file mode 100644
index 225ddde6e..000000000
--- a/templates/web/zerotb/around/around_map_list_items.html
+++ /dev/null
@@ -1,9 +0,0 @@
-[% IF around_map.size %]
- [% FOREACH p IN around_map %]
- [% INCLUDE 'report/_item.html'
- problem = p.problem,
- dist = tprintf("%.1f", (p.distance || 0) ) %]
- [% END %]
-[% ELSE %]
- <li><p>[% loc('No clinics found.') %]</p></li>
-[% END %]
diff --git a/templates/web/zerotb/around/on_map_list_items.html b/templates/web/zerotb/around/on_map_list_items.html
index 838e2e9fa..2cc7251e4 100644
--- a/templates/web/zerotb/around/on_map_list_items.html
+++ b/templates/web/zerotb/around/on_map_list_items.html
@@ -1,7 +1,14 @@
-[% IF on_map.size %]
- [% FOREACH problem IN on_map %]
+[% all_reports = on_map.merge(around_map) %]
+[% IF all_reports.size %]
+ [% FOREACH problem IN all_reports %]
+ [% UNLESS problem.title;
+ dist = tprintf("%.1f", (problem.distance || 0) );
+ problem = problem.problem;
+ END %]
[% INCLUDE 'report/_item.html' %]
[% END %]
[% ELSE %]
- <li><p>[% loc('No clinics found.') %]</p></li>
+ <li class="empty">
+ <p>[% loc('No clinics found.') %]</p>
+ </li>
[% END %]
diff --git a/templates/web/zerotb/around/tabbed_lists.html b/templates/web/zerotb/around/tabbed_lists.html
index 8b8e8753e..76c0f71f8 100644
--- a/templates/web/zerotb/around/tabbed_lists.html
+++ b/templates/web/zerotb/around/tabbed_lists.html
@@ -1,14 +1,3 @@
-<menu id="problems-nav" class="tab-nav">
- <ul>
- <li><a href="#current">[% loc('Clinics on the map') %]</a></li>
- <li><a href="#current_near">[% loc( 'Clinics nearby' ) %]</a></li>
- </ul>
-</menu>
-
<ul id="current" class="issue-list-a tab">
[% INCLUDE "around/on_map_list_items.html" %]
</ul>
-
-<ul id="current_near" class="issue-list-a tab">
- [% INCLUDE "around/around_map_list_items.html" %]
-</ul>