diff options
author | Struan Donald <struan@exo.org.uk> | 2012-05-14 18:06:32 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-05-14 18:06:32 +0100 |
commit | 4268024f74085b25a985fdfde431cd9b17e4cffb (patch) | |
tree | 56a7b69794c15e9311749b734e0c6841e81df151 | |
parent | dd16641400e49f94f480db8c3e62e0760065e6d8 (diff) |
add council name to dashboard
-rw-r--r-- | data/dashboard.json | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 4 | ||||
-rw-r--r-- | t/app/controller/dashboard.t | 3 | ||||
-rw-r--r-- | templates/web/default/dashboard/index.html | 2 |
4 files changed, 7 insertions, 3 deletions
diff --git a/data/dashboard.json b/data/dashboard.json index 31214ec8f..1da667356 100644 --- a/data/dashboard.json +++ b/data/dashboard.json @@ -1,4 +1,5 @@ { + "council": { "name": "South Borsetshire District Council" }, "wards": { "1": { "id": 1, "name": "West Ward" }, "2": { "id": 2, "name": "East Ward" }, diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 6a2b1c680..d6c037f5d 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -46,6 +46,7 @@ sub example : Local : Args(0) { } else { $c->stash->{problems} = $j->{counts_some}; } + $c->stash->{council} = $j->{council}; $c->stash->{children} = $j->{wards}; $c->stash->{category_options} = $j->{category_options}; if ( lc($c->stash->{q_state}) eq 'all' or !$c->stash->{q_state} ) { @@ -91,6 +92,9 @@ sub index : Path : Args(0) { # Set up the data for the dropdowns + my $council_detail = mySociety::MaPit::call('area', $council ); + $c->stash->{council} = $council_detail; + my $children = mySociety::MaPit::call('area/children', $council, type => $mySociety::VotingArea::council_child_types, ); diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index b96196d21..788b41dbe 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -36,7 +36,6 @@ $mech->submit_form_ok( { with_fields => { email => $test_user, password_sign_in => $test_pass } } ); -$mech->content_contains( 'Summary Statistics' ); -$mech->content_contains( 'Edinburgh' ); +$mech->content_contains( 'Summary Statistics for City of Edinburgh' ); done_testing; diff --git a/templates/web/default/dashboard/index.html b/templates/web/default/dashboard/index.html index f24797a8e..66cbef5c5 100644 --- a/templates/web/default/dashboard/index.html +++ b/templates/web/default/dashboard/index.html @@ -28,7 +28,7 @@ <p><input type="submit" value="Look up"> -<h2>Summary Statistics</h2> +<h2>Summary Statistics for [% council.name %]</h2> <table width="100%" id="overview"> <tr> |