aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base')
-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
6 files changed, 82 insertions, 72 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 %]