aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-09 15:34:24 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-09 15:34:24 +0100
commit42436d60599e1daabcac1390f328a8841f396d90 (patch)
tree31cb95e4e486031834c84c636e7220d5875ecb7e
parent7e413c6c76e6e4dc3496d6b434d8315589330f8f (diff)
Not marked statistic.
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm23
-rw-r--r--templates/web/default/dashboard/index.html16
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>