aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--templates/web/base/report/new/category.html10
2 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6cadc9bee..0f6afb5a6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@
- Stop filter category overriding chosen category.
- Allow things to reset if "Pick a category" picked.
- Stop category_change firing more than it should.
+ - Fix extra question display when only one category.
- Development improvements:
- Make front page cache time configurable.
- Better working of /fakemapit/ under https.
diff --git a/templates/web/base/report/new/category.html b/templates/web/base/report/new/category.html
index e537c8f1f..ec53263ca 100644
--- a/templates/web/base/report/new/category.html
+++ b/templates/web/base/report/new/category.html
@@ -1,7 +1,15 @@
+[%
+# If only one option, pre-select that as if it were already selected. This
+# carries through to the category_extras template because this template is
+# included with PROCESS.
+IF category_options.size == 2;
+ category = category_options.1.category;
+END
+~%]
[% IF category_options.size OR category_groups.size ~%]
[%~ BLOCK category_option ~%]
[% cat_op_lc = cat_op.category | lower =%]
- <option value='[% cat_op.category | html %]'[% ' selected' IF report.category == cat_op.category || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%]
+ <option value='[% cat_op.category | html %]'[% ' selected' IF report.category == cat_op.category || category_lc == cat_op_lc ~%]
>[% IF loop.first %][% cat_op.category_display %][% ELSE %][% cat_op.category_display | html %][% END %]
[%~ IF cat_op.get_extra_metadata('help_text') %] ([% cat_op.get_extra_metadata('help_text') %])[% END ~%]
</option>