diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-10 18:25:55 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-10 18:25:55 +0100 |
commit | b819cc63339f4f4b93a3595db8a29a1a8b1922d0 (patch) | |
tree | 4c1580a12239a078cf4221ab068456c6f3a2522f | |
parent | faf4ff882ff0ebd709f25ecb363d418c2f955b9a (diff) |
change example data on category or ward selection
-rw-r--r-- | data/dashboard.json | 56 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 7 |
2 files changed, 61 insertions, 2 deletions
diff --git a/data/dashboard.json b/data/dashboard.json index 008c92388..c921950be 100644 --- a/data/dashboard.json +++ b/data/dashboard.json @@ -1,5 +1,13 @@ { - "counts": { + "category_options": [ + "Abandoned vehicles", + "Grafitti", + "Potholes", + "Street lighting", + "Trees", + "Other" + ], + "counts_all": { "wtd": { "total": 10, "planned": 2, @@ -45,6 +53,52 @@ "not_marked": 1 } }, + "counts_some": { + "wtd": { + "total": 5, + "planned": 0, + "in progress": 1, + "investigating": 1, + "fixed - council": 2, + "fixed_user": 1, + "time_to_fix": 2, + "time_to_mark": 2, + "not_marked": 0 + }, + "week": { + "total": 7, + "planned": 1, + "in progress": 2, + "investigating": 1, + "fixed - council": 2, + "fixed_user": 1, + "time_to_fix": 3, + "time_to_mark": 2, + "not_marked": 0 + }, + "weeks": { + "total": 57, + "planned": 5, + "in progress": 16, + "investigating": 4, + "fixed - council": 23, + "fixed_user": 9, + "time_to_fix": 2, + "time_to_mark": 2, + "not_marked": 1 + }, + "ytd": { + "total": 57, + "planned": 5, + "in progress": 16, + "investigating": 4, + "fixed - council": 23, + "fixed_user": 9, + "time_to_fix": 2, + "time_to_mark": 2, + "not_marked": 1 + } + }, "lists": { "all": { "1": [ diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 1f723f52b..f2dddaea0 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -41,7 +41,12 @@ sub example : Local : Args(0) { FixMyStreet->path_to( 'data/dashboard.json' )->stringify ); my $j = JSON->new->utf8->decode($data); - $c->stash->{problems} = $j->{counts}; + if ( !$c->stash->{ward} && !$c->stash->{category} ) { + $c->stash->{problems} = $j->{counts_all}; + } else { + $c->stash->{problems} = $j->{counts_some}; + } + $c->stash->{category_options} = $j->{category_options}; if ( lc($c->stash->{q_state}) eq 'all' or !$c->stash->{q_state} ) { $c->stash->{lists} = $j->{lists}->{all}; } else { |