Skip to content

Commit

Permalink
fixup! [Northumberland] Being able to filter on only one category in …
Browse files Browse the repository at this point in the history
…multiple parent categories
  • Loading branch information
MorayMySoc committed Jul 30, 2024
1 parent c0d675b commit 9aef9f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/App/Controller/Dashboard.pm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ sub index : Path : Args(0) {

$c->stash->{category} = \@categories;
$c->stash->{groups_selected_from} = \@groups_selected_from;
$c->stash->{display_categories} = { reverse %display_categories };
$c->stash->{display_categories} = \%display_categories;
$c->stash->{ward} = [ $c->get_param_list('ward') ];

if ($c->user_exists) {
Expand Down
4 changes: 2 additions & 2 deletions t/app/controller/dashboard.t
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ FixMyStreet::override_config {
$sub_pothole_road->update;
$mech->get_ok("/dashboard?category=group-Road+%26+more&category=Litter-group-");
test_table($mech->content, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 0, 4, 6, 1, 0, 0, 1, 4, 1, 4, 9);
$sub_pothole_pavement->delete; $sub_pothole_pavement->update;
$sub_pothole_road->delete; $sub_pothole_road->update;
$sub_pothole_pavement->delete;
$sub_pothole_road->delete;
};

subtest 'test grouping' => sub {
Expand Down
4 changes: 2 additions & 2 deletions templates/web/base/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ <h1>[% loc('Summary statistics') %]</h1>
<label for="category">[% loc('Category:') %]</label>
<select class="form-control js-multiple" multiple name="category" id="category">
[% BLOCK category_option %]
[% SET category_safe = mark_safe(cat.category) %]
<option value='[% cat.category | html %]-[% group.group_id | html %]'[% ' selected' IF display_categories.$category_safe %]>[% cat.category_display | html %]</option>
[% SET category_built = mark_safe(cat.category) _ '-' _ mark_safe(group.group_id) %]
<option value='[% cat.category | html %]-[% group.group_id | html %]'[% ' selected' IF display_categories.$category_built %]>[% cat.category_display | html %]</option>
[% END %]
[%~ INCLUDE 'report/new/_category_select.html' include_group_option=1 ~%]
</select>
Expand Down

0 comments on commit 9aef9f4

Please sign in to comment.