diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-02-06 16:46:03 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-02-06 16:46:03 +0000 |
commit | 71dbeae85dbef28b9af1954086bc5026de0fb3dd (patch) | |
tree | 7cb1eb15142e3787607495f090608d954ce38651 | |
parent | 8b835c38168228641666c1cf920fe94ce07be329 (diff) |
Start of Zurich admin table sort ordering (DM).
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 10 | ||||
-rw-r--r-- | templates/web/zurich/admin/index-dm.html | 10 | ||||
-rw-r--r-- | web/cobrands/zurich/layout.scss | 3 |
3 files changed, 17 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 4091bf4b0..578d077b2 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -195,18 +195,24 @@ sub admin { my @children = map { $_->id } $body->bodies->all; my @all = (@children, $body->id); + my $order = $c->req->params->{o} || 'created'; + my $dir = $c->req->params->{d} || 1; + $c->stash->{order} = $order; + $c->stash->{dir} = $dir; + $order .= ' desc' if $dir; + # XXX No multiples or missing bodies $c->stash->{unconfirmed} = $c->cobrand->problems->search({ state => [ 'unconfirmed', 'confirmed' ], bodies_str => $c->stash->{body}->id, }, { - order_by => 'created' + order_by => $order, }); $c->stash->{approval} = $c->cobrand->problems->search({ state => 'planned', bodies_str => $c->stash->{body}->id, }, { - order_by => 'created' + order_by => $order, }); my $page = $c->req->params->{p} || 1; diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html index 76ed30aed..71458dab9 100644 --- a/templates/web/zurich/admin/index-dm.html +++ b/templates/web/zurich/admin/index-dm.html @@ -15,15 +15,17 @@ [% INCLUDE 'admin/footer.html' %] +[% BLOCK sort_link %][% IF order == choice %][% c.uri_with( d => 1 - c.req.params.d ) %][% ELSE %][% c.uri_with( { o => choice } ) %][% END %][% END %] + [% BLOCK list %] <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> <th>[% loc('Description') %]</th> - <th>[% loc('Category') %]</th> - <th>[% loc('Submitted') %]</th> - <th>[% loc('Updated') %]</th> - <th>[% loc('Status') %]</th> + <th><a href="[% INCLUDE sort_link choice = 'category' %]">[% loc('Category') %]</a></th> + <th><a href="[% INCLUDE sort_link choice = 'created' %]">[% loc('Submitted') %]</a></th> + <th><a href="[% INCLUDE sort_link choice = 'lastupdate' %]">[% loc('Updated') %]</a></th> + <th><a href="[% INCLUDE sort_link choice = 'state' %]">[% loc('Status') %]</a></th> [% IF include_subdiv %] <th>[% loc('Subdivision/Body') %]</th> [% END %] diff --git a/web/cobrands/zurich/layout.scss b/web/cobrands/zurich/layout.scss index b791ba28a..47748343e 100644 --- a/web/cobrands/zurich/layout.scss +++ b/web/cobrands/zurich/layout.scss @@ -257,6 +257,9 @@ body.mappage.admin .content { border-bottom: 2px solid $table_heading_underline_col; border-left: 1px solid $table_heading_border_col; border-right: 1px solid $table_heading_border_col; + a:link, a:visited { + color: white; + } } td.record-id { text-align: center; |