diff options
author | Struan Donald <struan@exo.org.uk> | 2017-08-14 15:56:20 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-08-14 16:16:01 +0100 |
commit | 55ce7d174aa2638f9f8b0053ca823368149a9105 (patch) | |
tree | 713874c31129accb19e33f26de913dc1ef4709a4 | |
parent | caf8c95af8d2faed142eb50662ec926137db434f (diff) |
translate report template category names in controller
We can't translate them in the template as we're just passing in the
category name and not the object.
Fixes mysociety/fixmystreetforcouncils#216
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 2 | ||||
-rw-r--r-- | templates/web/base/admin/category-checkboxes.html | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 87773a31b..0b1720982 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -1099,7 +1099,7 @@ sub template_edit : Path('templates') : Args(2) { my %active_contacts = map { $_->id => 1 } @contacts; my @all_contacts = map { { id => $_->id, - category => $_->category, + category => $_->category_display, active => $active_contacts{$_->id}, } } @live_contacts; $c->stash->{contacts} = \@all_contacts; diff --git a/templates/web/base/admin/category-checkboxes.html b/templates/web/base/admin/category-checkboxes.html index 9d5ab17ea..63acd4112 100644 --- a/templates/web/base/admin/category-checkboxes.html +++ b/templates/web/base/admin/category-checkboxes.html @@ -11,7 +11,7 @@ <li> <label> <input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/> - [% contact.category_display %] + [% contact.category %] </label> </li> [% END %] |