diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 23 | ||||
-rw-r--r-- | templates/web/default/dashboard/index.html | 16 |
2 files changed, 25 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 90e793bc7..d1e8da01d 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -90,7 +90,6 @@ sub index : Path : Args(0) { $c->stash->{ward} = $c->req->param('ward'); $c->stash->{category} = $c->req->param('category'); - $c->stash->{q_state} = $c->req->param('state') || ''; my %where = ( council => $council, # XXX This will break in a two tier council. Restriction needs looking at... @@ -100,11 +99,6 @@ sub index : Path : Args(0) { if $c->stash->{ward}; $where{category} = $c->stash->{category} if $c->stash->{category}; - if ( $c->stash->{q_state} eq 'fixed' ) { - $where{'problem.state'} = [ FixMyStreet::DB::Result::Problem->fixed_states() ]; - } elsif ( $c->stash->{q_state} ) { - $where{'problem.state'} = $c->stash->{q_state} - } $c->stash->{where} = \%where; my $prob_where = { %where }; $prob_where->{state} = $prob_where->{'problem.state'}; @@ -119,6 +113,15 @@ sub index : Path : Args(0) { $counts{ytd} = $c->forward( 'updates_search', [ DateTime->today->set( day => 1, month => 1 ) ] ); $c->stash->{problems} = \%counts; + + # List of reports underneath summary table + + #$c->stash->{q_state} = $c->req->param('state') || ''; + #if ( $c->stash->{q_state} eq 'fixed' ) { + # $where{'problem.state'} = [ FixMyStreet::DB::Result::Problem->fixed_states() ]; + #} elsif ( $c->stash->{q_state} ) { + # $where{'problem.state'} = $c->stash->{q_state} + #} } sub updates_search : Private { @@ -181,6 +184,14 @@ sub updates_search : Private { }; $counts{total} = $c->cobrand->problems->search( $params )->count; + $params = { + %{$c->stash->{prob_where}}, + 'me.confirmed' => { '>=', $time }, + state => 'confirmed', + '(select min(id) from comment where me.id=problem_id and problem_state is not null)' => undef, + }; + $counts{not_marked} = $c->cobrand->problems->search( $params )->count; + return \%counts; } diff --git a/templates/web/default/dashboard/index.html b/templates/web/default/dashboard/index.html index 931415fe7..1f733c8c5 100644 --- a/templates/web/default/dashboard/index.html +++ b/templates/web/default/dashboard/index.html @@ -18,16 +18,16 @@ <option value="[% w.id %]"[% ' selected' IF w.id == ward %]>[% w.name %]</option> [% END %] </select> -<input type="submit" value="Look up"> - -<h2>Performance Overview</h2> <p>Report category: <select name="category"><option value=''>All</option> [% FOR cat_op IN category_options %] <option value='[% cat_op | html %]'[% ' selected' IF category == cat_op %]>[% cat_op | html %]</option> [% END %] </select> -<input type="submit" value="Look up"> + +<p><input type="submit" value="Look up"> + +<h2>Performance Overview</h2> <table width="100%" id="overview"> <tr> @@ -105,10 +105,10 @@ <tr class='subtotal'> <th scope="row">Total not marked</th> - <td>-</td> - <td>-</td> - <td>-</td> - <td>-</td> + <td>[% problems.wtd.not_marked %]</td> + <td>[% problems.week.not_marked %]</td> + <td>[% problems.weeks.not_marked %]</td> + <td>[% problems.ytd.not_marked %]</td> </tr> </table> |