aboutsummaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm5
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm6
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
-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
-rw-r--r--web/cobrands/bromley/layout.scss4
-rw-r--r--web/cobrands/greenwich/layout.scss2
-rw-r--r--web/cobrands/oxfordshire/layout.scss2
-rw-r--r--web/cobrands/sass/_base.scss8
-rw-r--r--web/cobrands/sass/_report_list.scss129
-rw-r--r--web/cobrands/sass/_report_list_pins.scss111
-rw-r--r--web/js/map-OpenLayers.js5
31 files changed, 216 insertions, 391 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index 640a8c063..4aa695ae5 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -302,15 +302,10 @@ sub ajax : Path('/ajax') {
'around/on_map_list_items.html',
{ on_map => $on_map, around_map => $around_map }
);
- my $around_map_list_html = $c->render_fragment(
- 'around/around_map_list_items.html',
- { on_map => $on_map, around_map => $around_map }
- );
# JSON encode the response
my $json = { pins => $pins };
$json->{current} = $on_map_list_html if $on_map_list_html;
- $json->{current_near} = $around_map_list_html if $around_map_list_html;
my $body = JSON->new->utf8(1)->encode($json);
$c->res->body($body);
}
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index 9db9386f5..3c4ce2cf7 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -31,7 +31,7 @@ sub my : Path : Args(0) {
$c->forward( '/reports/stash_report_filter_status' );
my $pins = [];
- my $problems = {};
+ my $problems = [];
my $states = $c->stash->{filter_problem_states};
my $params = {
@@ -60,9 +60,7 @@ sub my : Path : Args(0) {
id => $problem->id,
title => $problem->title,
};
- my $state = $problem->is_fixed ? 'fixed' : $problem->is_closed ? 'closed' : 'confirmed';
- push @{ $problems->{$state} }, $problem;
- push @{ $problems->{all} }, $problem;
+ push @$problems, $problem;
}
$c->stash->{problems_pager} = $rs->pager;
$c->stash->{problems} = $problems;
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 3bd7e592b..407fc625e 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -492,6 +492,9 @@ sub stash_report_filter_status : Private {
} elsif ( $status eq 'open' ) {
$c->stash->{filter_status} = 'open';
$c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->open_states();
+ } elsif ( $status eq 'closed' ) {
+ $c->stash->{filter_status} = 'closed';
+ $c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->closed_states();
} elsif ( $status eq 'fixed' ) {
$c->stash->{filter_status} = 'fixed';
$c->stash->{filter_problem_states} = FixMyStreet::DB::Result::Problem->fixed_states();
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>
diff --git a/web/cobrands/bromley/layout.scss b/web/cobrands/bromley/layout.scss
index 3fe542695..cd6c174db 100644
--- a/web/cobrands/bromley/layout.scss
+++ b/web/cobrands/bromley/layout.scss
@@ -1,8 +1,6 @@
@import "_colours";
@import "../sass/layout";
-
-// Import the new filters/list styling
-@import "../sass/_report_list.scss";
+@import "../sass/report_list_pins";
// Alter the logo and the header on every page *but* the map page. On the map
// page it stays small like in base.css
diff --git a/web/cobrands/greenwich/layout.scss b/web/cobrands/greenwich/layout.scss
index df5437968..894b82a33 100644
--- a/web/cobrands/greenwich/layout.scss
+++ b/web/cobrands/greenwich/layout.scss
@@ -1,7 +1,7 @@
@import "_colours";
@import "_fonts";
@import "../sass/layout";
-@import "../sass/report_list";
+@import "../sass/report_list_pins";
$fixed_page_width: 990px;
diff --git a/web/cobrands/oxfordshire/layout.scss b/web/cobrands/oxfordshire/layout.scss
index 4dc3efe4e..04890b1aa 100644
--- a/web/cobrands/oxfordshire/layout.scss
+++ b/web/cobrands/oxfordshire/layout.scss
@@ -1,6 +1,6 @@
@import "_colours";
@import "../sass/layout";
-@import "../sass/report_list";
+@import "../sass/report_list_pins";
body, body a {
font-family:"Trebuchet MS",Arial, Helvetica, sans-serif;
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index 0df8ad01b..301f6fdce 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -7,6 +7,7 @@ $image-sprite: '/cobrands/fixmystreet/images/sprite.png' !default;
$menu-image: 'menu-white' !default;
@import "_mixins";
+@import "_report_list";
body {
font-family: $body-font;
@@ -865,9 +866,8 @@ input.final-submit {
padding: 0;
border-bottom: 0.25em solid $primary;
li {
- list-style: none;
- margin:0;
- padding:0;
+ list-style: none;
+ padding: 0;
margin: 0.25em 0 0;
/* see note below about this */
display:table;
@@ -882,7 +882,7 @@ input.final-submit {
a {
color:#222222;
}
- a:hover {
+ a:hover, a:focus {
color:#222222;
background-color:#e6e6e6;
text-decoration: none;
diff --git a/web/cobrands/sass/_report_list.scss b/web/cobrands/sass/_report_list.scss
index 442072083..8d34bfd77 100644
--- a/web/cobrands/sass/_report_list.scss
+++ b/web/cobrands/sass/_report_list.scss
@@ -1,6 +1,3 @@
-// You should @import this file in a cobrand's layout.scss if it's using
-// the new-style combined report list with category/status filters.
-
.report-list-filters {
padding: 1em 1em 0;
margin-bottom: 0.5em;
@@ -33,129 +30,3 @@
max-width: 13em;
}
}
-
-.issue-list-a {
- margin-#{$left}: 0;
-
- li {
- list-style: none;
- position: relative;
- margin: 0;
- background: none;
-
- a {
- display: block;
- padding: 1em;
- padding-#{$left}: 4em;
- border-#{$left}: solid 1em transparent;
- background: transparent url(/i/pin-yellow-small.png) no-repeat $left center;
-
- &:hover, &:focus {
- text-decoration: none;
- }
- }
-
- &.yellow a {
- background-image: url(/i/pin-yellow-small.png);
- }
- &.green a {
- background-image: url(/i/pin-green-small.png);
- }
- &.red a {
- background-image: url(/i/pin-red-small.png);
- }
- &.grey a {
- background-image: url(/i/pin-grey-small.png);
- }
-
- &.empty p {
- display: block;
- padding: 1em;
- font-size: 1em;
- text-align: center;
- }
-
- &:after {
- content: "";
- display: block;
- height: 1px;
- position: absolute;
- #{$left}: 4em;
- #{$right}: 0;
- bottom: 0;
- background-color: #e5e5e5;
- }
-
- &.empty:after {
- #{$left}: 0;
- }
- }
-
- h3, p {
- margin: 0;
- }
-
- h3 {
- color: $primary;
- margin-bottom: 0.2em;
- }
-
- p {
- font-size: 0.8em;
- color: #777;
- }
-}
-
-// On the /my page, we use a .issue-list with an extra full-width modifier
-// which removes the left padding. However, our new reports list still needs
-// it:
-.issue-list-a.full-width {
- margin-#{$left}: -1em;
-}
-
-.big-green-banner {
- display: none; // hide the empty banner by default
-
- &.mobile-map-banner {
- display: block; // show it again once the mobile javascript adds this class
- }
-}
-
-.click-the-map {
- color: #000;
- margin: -10px -1em 0; // overlap padding on parents
- padding: 18px;
- border-bottom: 1px solid #e5e5e5;
- // TODO This is not right-to-left enabled yet
- background: #fff url('/i/click-map-chevron-big.gif') 90% 12px no-repeat;
-
- h2 {
- font-family: inherit;
- margin: 0 0 5px;
- }
-
- p {
- margin: 0;
- font-size: 18px;
- line-height: 20px;
- color: $primary;
- padding-#{$right}: 20px;
- // TODO This is not right-to-left enabled yet, image wise
- background: transparent url('/i/click-map-chevron-small.gif') $right center no-repeat;
- display: inline-block;
- }
-
- img {
- // the little chevron icon
- vertical-align: -1px;
- margin-#{$left}: 0.2em;
- }
-}
-
-body.frontpage {
- .issue-list-a {
- li .text {
- padding-#{$left}: 3em;
- }
- }
-}
diff --git a/web/cobrands/sass/_report_list_pins.scss b/web/cobrands/sass/_report_list_pins.scss
new file mode 100644
index 000000000..f1948775b
--- /dev/null
+++ b/web/cobrands/sass/_report_list_pins.scss
@@ -0,0 +1,111 @@
+.issue-list-a {
+ li {
+ position: relative;
+ margin: 0;
+ background: none;
+
+ a {
+ display: block;
+ padding: 1em;
+ padding-#{$left}: 4em;
+ border-#{$left}: solid 1em transparent;
+ background: transparent url(/i/pin-yellow-small.png) no-repeat $left center;
+ }
+
+ &.yellow a {
+ background-image: url(/i/pin-yellow-small.png);
+ }
+ &.green a {
+ background-image: url(/i/pin-green-small.png);
+ }
+ &.red a {
+ background-image: url(/i/pin-red-small.png);
+ }
+ &.grey a {
+ background-image: url(/i/pin-grey-small.png);
+ }
+
+ &.empty p {
+ display: block;
+ padding: 1em;
+ font-size: 1em;
+ text-align: center;
+ }
+
+ &:after {
+ content: "";
+ display: block;
+ height: 1px;
+ position: absolute;
+ #{$left}: 4em;
+ #{$right}: 0;
+ bottom: 0;
+ background-color: #e5e5e5;
+ }
+
+ &.empty:after {
+ #{$left}: 0;
+ }
+ }
+
+ h3, p {
+ margin: 0;
+ }
+
+ h3 {
+ color: $primary;
+ margin-bottom: 0.2em;
+ }
+
+ p {
+ font-size: 0.8em;
+ color: #777;
+ }
+}
+
+.big-green-banner {
+ display: none; // hide the empty banner by default
+
+ &.mobile-map-banner {
+ display: block; // show it again once the mobile javascript adds this class
+ }
+}
+
+.click-the-map {
+ color: #000;
+ margin: -10px -1em 0; // overlap padding on parents
+ padding: 18px;
+ border-bottom: 1px solid #e5e5e5;
+ // TODO This is not right-to-left enabled yet
+ background: #fff url('/i/click-map-chevron-big.gif') 90% 12px no-repeat;
+
+ h2 {
+ font-family: inherit;
+ margin: 0 0 5px;
+ }
+
+ p {
+ margin: 0;
+ font-size: 18px;
+ line-height: 20px;
+ color: $primary;
+ padding-#{$right}: 20px;
+ // TODO This is not right-to-left enabled yet, image wise
+ background: transparent url('/i/click-map-chevron-small.gif') $right center no-repeat;
+ display: inline-block;
+ }
+
+ img {
+ // the little chevron icon
+ vertical-align: -1px;
+ margin-#{$left}: 0.2em;
+ }
+}
+
+body.frontpage {
+ .issue-list-a {
+ li .text {
+ padding-#{$left}: 3em;
+ }
+ }
+}
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 63ef7324d..3cd54bc23 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -552,13 +552,10 @@ OpenLayers.Format.FixMyStreet = OpenLayers.Class(OpenLayers.Format.JSON, {
} else {
obj = json;
}
- var current, current_near;
+ var current;
if (typeof(obj.current) != 'undefined' && (current = document.getElementById('current'))) {
current.innerHTML = obj.current;
}
- if (typeof(obj.current_near) != 'undefined' && (current_near = document.getElementById('current_near'))) {
- current_near.innerHTML = obj.current_near;
- }
return fms_markers_list( obj.pins, false );
},
CLASS_NAME: "OpenLayers.Format.FixMyStreet"