diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 9 | ||||
-rw-r--r-- | templates/web/default/admin/list_updates.html | 2 | ||||
-rw-r--r-- | templates/web/default/admin/reports.html | 9 | ||||
-rw-r--r-- | templates/web/zurich/admin/list_updates.html | 2 | ||||
-rw-r--r-- | templates/web/zurich/admin/reports.html | 6 |
5 files changed, 21 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 121aa2562..faad88f1f 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -584,6 +584,15 @@ sub reports : Path('reports') { # Switch quoting back off. See above for explanation of this. $c->model('DB')->schema->storage->sql_maker->quote_char( '' ); + } else { + + my $page = $c->req->params->{p} || 1; + my $problems = $c->cobrand->problems->search( + { }, + { order_by => 'created desc' } + )->page( $page ); + $c->stash->{problems} = [ $problems->all ]; + $c->stash->{pager} = $problems->pager; } } diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html index ff0ec2f31..681337844 100644 --- a/templates/web/default/admin/list_updates.html +++ b/templates/web/default/admin/list_updates.html @@ -1,3 +1,4 @@ +[% IF updates.size %] <h2>[% loc('Updates') %]</h2> <table cellspacing="0" cellpadding="2" border="1"> @@ -36,3 +37,4 @@ </tr> [% END -%] </table> +[% END %] diff --git a/templates/web/default/admin/reports.html b/templates/web/default/admin/reports.html index 600f2b436..415d94cac 100644 --- a/templates/web/default/admin/reports.html +++ b/templates/web/default/admin/reports.html @@ -2,11 +2,10 @@ [% PROCESS 'admin/report_blocks.html' %] <form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> + <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search" value="[% searched | html %]"> </form> - -[% IF searched %] +[% IF problems.size %] <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> @@ -25,8 +24,8 @@ [% INCLUDE 'admin/problem_row.html' %] </table> -[% INCLUDE 'admin/list_updates.html' %] - [% END %] +[% INCLUDE 'admin/list_updates.html' %] + [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/zurich/admin/list_updates.html b/templates/web/zurich/admin/list_updates.html index 7a78d4c63..c475d839e 100644 --- a/templates/web/zurich/admin/list_updates.html +++ b/templates/web/zurich/admin/list_updates.html @@ -1,3 +1,4 @@ +[% IF updates.size %] <h2>[% loc('Updates') %]</h2> <table cellspacing="0" cellpadding="2" border="1"> @@ -14,3 +15,4 @@ </tr> [% END -%] </table> +[% END %] diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html index f8c022630..e78383334 100644 --- a/templates/web/zurich/admin/reports.html +++ b/templates/web/zurich/admin/reports.html @@ -6,7 +6,7 @@ </form> -[% IF searched %] +[% IF problems.size %] <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> @@ -20,8 +20,10 @@ [% INCLUDE 'admin/problem_row.html', page = 'search' %] </table> -[% INCLUDE 'admin/list_updates.html' %] +[% INCLUDE 'pagination.html', param = 'p' IF pager %] [% END %] +[% INCLUDE 'admin/list_updates.html' %] + [% INCLUDE 'admin/footer.html' %] |