aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-04-13 14:29:56 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-04-13 14:35:58 +0100
commit112ab20142f7f79d4ffff557b95c53406ad79bd9 (patch)
tree20f32e6faa1449c6345a8ffeb428dfc440cfddee /templates
parentcfe97d706f5cb7b3f3ca6d9227a872a7e50d97b2 (diff)
Fix issue with categories with regex characters.
As the templates were using `grep`, they failed to match on a category such as "Footpaths (right of way)". Changing the stash variables to be hashes instead of lists makes checking for a key simpler. Fixes #1688.
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/admin/report-category.html2
-rw-r--r--templates/web/base/reports/_list-filters.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html
index ecb5f66f4..1e39236d7 100644
--- a/templates/web/base/admin/report-category.html
+++ b/templates/web/base/admin/report-category.html
@@ -1,5 +1,5 @@
<select class="form-control" name="category" id="category">
- [% IF NOT problem.category OR NOT categories.grep(problem.category).size %]
+ [% IF NOT problem.category OR NOT categories_hash.${problem.category} %]
<optgroup label="[% loc('Existing category') %]">
<option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option>
</optgroup>
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index ce4666156..e657e0375 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -19,7 +19,7 @@
[% IF filter_categories.size %]
<select class="form-control js-multiple" name="filter_category" id="filter_categories" multiple data-all="[% loc('Everything') %]">
[% FOR cat IN filter_categories %]
- <option value="[% cat | html %]"[% ' selected' IF filter_category.grep(cat).size %]>
+ <option value="[% cat | html %]"[% ' selected' IF filter_category.$cat %]>
[% cat | html %]
</option>
[% END %]