diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 9 | ||||
-rw-r--r-- | templates/web/default/report/new/category.html | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 670ca3d50..dfcea9f0a 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -94,6 +94,7 @@ sub report_new : Path : Args(0) { $c->stash->{template} = "report/new/fill_in_details.html"; $c->forward('setup_categories_and_councils'); $c->forward('generate_map'); + $c->forward('check_for_category'); # deal with the user and report and check both are happy return unless $c->forward('check_form_submitted'); @@ -1047,6 +1048,14 @@ sub generate_map : Private { return 1; } +sub check_for_category : Private { + my ( $self, $c ) = @_; + + $c->stash->{category} = $c->req->param('category'); + + return 1; +} + =head2 redirect_or_confirm_creation Now that the report has been created either redirect the user to its page if it diff --git a/templates/web/default/report/new/category.html b/templates/web/default/report/new/category.html index 095cd7c2e..8bff539c4 100644 --- a/templates/web/default/report/new/category.html +++ b/templates/web/default/report/new/category.html @@ -1,9 +1,13 @@ [% FILTER collapse %] [% IF category_options.size %] + [% IF category; + category = category | lower; + END; %] <label for='form_category'>[% category_label | html %]</label> <select name='category' id='form_category'[% ' onchange="form_category_onchange()"' IF category_extras.size %]> [% FOREACH cat_op IN category_options %] - <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op %]>[% cat_op | html %]</option> + [% cat_op_lc = cat_op | lower %] + <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc %]>[% cat_op | html %]</option> [% END %] </select> [% END %] |