aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-09 15:33:32 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-09 15:33:32 +0100
commit7e413c6c76e6e4dc3496d6b434d8315589330f8f (patch)
tree7ce2f10938af9785e5fd4e66fc9ca5e9d4ab7637
parentbb53df5252e5718245547899fb79c8cd317652e4 (diff)
Initial example page.
-rw-r--r--perllib/FixMyStreet/App/Controller/Dashboard.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm
index 3de050cf9..90e793bc7 100644
--- a/perllib/FixMyStreet/App/Controller/Dashboard.pm
+++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm
@@ -18,6 +18,35 @@ Catalyst Controller.
=cut
+sub example : Local : Args(0) {
+ my ( $self, $c ) = @_;
+ $c->stash->{template} = 'dashboard/index.html';
+
+ $c->stash->{children} = {};
+ for my $i (1..3) {
+ $c->stash->{children}{$i} = { id => $i, name => "Ward $i" };
+ }
+
+ # TODO Set up manual version of what the below would do
+ #$c->forward( '/report/new/setup_categories_and_councils' );
+
+ # See if we've had anything from the dropdowns - perhaps vary results if so
+ $c->stash->{ward} = $c->req->param('ward');
+ $c->stash->{category} = $c->req->param('category');
+ #$c->stash->{q_state} = $c->req->param('state');
+
+ my %counts;
+ $counts{wtd} = {
+ total => 10,
+ 'planned' => 2, 'in progress' => 1, investigating => 1,
+ 'fixed - council' => 3, fixed_user => 2,
+ time_to_fix => 8, time_to_mark => 2,
+ };
+ # TODO Repeat for week/weeks/ytd? Or another way?
+
+ $c->stash->{problems} = \%counts;
+}
+
=head2 check_page_allowed
Checks if we can view this page, and if not redirect to 404.