aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm3
-rwxr-xr-xtemplates/web/fixmystreet/reports/council.html13
-rw-r--r--web/cobrands/fixmystreet/base.scss4
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js23
4 files changed, 34 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index f8302f93e..815debe14 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -343,6 +343,7 @@ sub load_and_group_problems : Private {
'id', 'council', 'state', 'areas', 'latitude', 'longitude', 'title', 'cobrand',
{ duration => { extract => "epoch from current_timestamp-lastupdate" } },
{ age => { extract => "epoch from current_timestamp-confirmed" } },
+ { confirmed => { extract => 'epoch from confirmed' } },
{ photo => 'photo is not null' },
],
order_by => { -desc => 'lastupdate' },
@@ -354,7 +355,7 @@ sub load_and_group_problems : Private {
my ( %fixed, %open, @pins );
my $re_councils = join('|', keys %{$c->stash->{areas_info}});
- my @cols = ( 'id', 'council', 'state', 'areas', 'latitude', 'longitude', 'title', 'cobrand', 'duration', 'age' );
+ my @cols = ( 'id', 'council', 'state', 'areas', 'latitude', 'longitude', 'title', 'cobrand', 'duration', 'age', 'confirmed', 'photo' );
while ( my @problem = $problems->next ) {
my %problem = zip @cols, @problem;
$c->log->debug( $problem{'cobrand'} . ', cobrand is ' . $c->cobrand->moniker );
diff --git a/templates/web/fixmystreet/reports/council.html b/templates/web/fixmystreet/reports/council.html
index 264e2f67a..6b71eb4f9 100755
--- a/templates/web/fixmystreet/reports/council.html
+++ b/templates/web/fixmystreet/reports/council.html
@@ -49,8 +49,11 @@
</p>
[% ELSE %]
<div class="shadow-wrap">
- <ul id="key-tools" class="singleton">
+ <ul id="key-tools"[% IF NOT children.size %] class="singleton"[% END %]>
<li><a rel="nofollow" id="email_alert" class="feed" href="[% rss_url %]">[% tprintf(loc('Get updates of problems in this %s'), thing) %]</a></li>
+ [% IF children.size %]
+ <li><a href="#council_wards" id="council_wards_link" class="chevron">[% loc('Wards of this council') %]</a>
+ [% END %]
</ul>
</div>
[% END %]
@@ -74,15 +77,12 @@
[% IF children.size %]
-
-<a href="#council_wards" class="button-right hidden-nojs hideshow-trigger">[% loc('Wards of this council') %]</a>
-
<section id="council_wards" class="hidden-js">
<h2>[% loc('Wards of this council') %]</h2>
<p>[% loc('Follow a ward link to view only reports within that ward.') %]</p>
- <ul class="list-a full-width">
+ <ul class="issue-list-a">
[% FOR child IN children.values.sort('name') %]
- <li><a href="[% child.url %]">[% child.name %]</a></li>
+ <li><a href="[% child.url %]"><span class="text">[% child.name %]</span></a></li>
[% END %]
</ul>
</section>
@@ -148,6 +148,7 @@
<a href="[% c.uri_for('/report/' _ problem.id) %]">
<div class="text">
<h4>[% problem.title | html %]</h4>
+ <small>[% prettify_epoch( problem.confirmed, 1 ) %]</small>
[% IF problem.councils > 1 %] <small>[% loc('(sent to both)') %]</small> [% END %]
[% IF c.cobrand.moniker != 'emptyhomes' %]
[% IF problem.councils == 0 %] <small>[% loc('(not sent to council)') %]</small> [% END %]
diff --git a/web/cobrands/fixmystreet/base.scss b/web/cobrands/fixmystreet/base.scss
index 9614c2ce9..8b49d2c6a 100644
--- a/web/cobrands/fixmystreet/base.scss
+++ b/web/cobrands/fixmystreet/base.scss
@@ -571,7 +571,7 @@ p.label-valid {
size:0.6875em;
family: 'helvetica', 'arial', sans-serif;
}
- &:hover {
+ &:hover, &.hover {
text-decoration:none;
background-color:#333;
color:#fff;
@@ -872,7 +872,7 @@ a:hover.button-left {
}
}
.text {
- padding:0.5em 1em 0 1em;
+ padding:0.5em 1em;
h4 {
margin:0;
}
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 7d9e73aa3..fdcbb9669 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -369,6 +369,29 @@ $(function(){
$('<p id="sub_map_links" />').insertAfter($('#map'));
}
+ // Open list of wards on council page
+ // TODO Change chevron when open to point down
+ $('#council_wards_link').toggle(function(e){
+ var $this = $(this), d = $('#council_wards');
+ if (!$this.addClass('hover').data('setup')) {
+ d.css({
+ backgroundColor: 'white',
+ height: $(window).height() - $('.content').offset().top - $('.shadow-wrap').height(),
+ display: 'none',
+ overflow: 'auto',
+ padding: '1em'
+ }).removeClass('hidden-js');
+ d.find('h2').css({ marginTop: 0 });
+ $('.shadow-wrap').append(d);
+ $this.data('setup', true);
+ }
+ d.animate( { height: 'show' } );
+ }, function(e){
+ var $this = $(this), d = $('#council_wards');
+ $this.removeClass('hover');
+ d.animate( { height: 'hide' } );
+ });
+
//add permalink on desktop, force hide on mobile
$('#sub_map_links').append('<a href="#" id="map_permalink">Permalink</a>');
if($('.mobile').length){