aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2013-03-12 14:14:43 +0000
committerMatthew Somerville <matthew@mysociety.org>2013-03-12 14:14:43 +0000
commit62b6d1a2c4b3fa57fe63b31dcc939312fa34ee65 (patch)
tree55ab584cbaebdf228d7e14eb62bd310eb3789538 /templates
parent1711bc48480812448032780a37450530e7e3ffbf (diff)
Don't show subdivision option if no subdivisions.
Diffstat (limited to 'templates')
-rw-r--r--templates/web/zurich/admin/report_edit.html27
1 files changed, 17 insertions, 10 deletions
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index 6036fb7b9..464fbe9ee 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -98,15 +98,19 @@
[% IF problem.state == 'unconfirmed' OR problem.state == 'confirmed' %]
<ul class="no-bullets">
-<li class="assignation">
-<label for="body_subdivision">[% loc('Assign to subdivision:') %]</label>
+[% list = FOR body IN bodies %]
+ [%- NEXT UNLESS body.parent.id == c.user.from_body.id %]
+ <option value="[% body.id %]"[% IF body.id == problem.bodies_str %] selected[% END %]>[% body.name %]</option>
+[% END %]
+ [% IF list %]
+ <li class="assignation">
+ <label for="body_subdivision">[% loc('Assign to subdivision:') %]</label>
<select name="body_subdivision" id="body_subdivision">
<option value="">--</option>
- [% FOR body IN bodies %]
- [% NEXT UNLESS body.parent.id == c.user.from_body.id %]
- <option value="[% body.id %]"[% IF body.id == problem.bodies_str %] selected[% END %]>[% body.name %]</option>
- [% END %]
+ [% list %]
</select>
+ </li>
+ [% END %]
<li class="assignation">
<label for="category">
@@ -151,16 +155,19 @@ $(function(){
[% ELSIF problem.state == 'planned' %]
<ul class="no-bullets">
+[% list = FOR body IN bodies %]
+ [%- NEXT UNLESS body.parent.id == c.user.from_body.id %]
+ <option value="[% body.id %]">[% body.name %]</option>
+[% END %]
+ [% IF list %]
<li class="assignation">
<label for="body_subdivision">[% loc('Assign to subdivision:') %]</label>
<select name="body_subdivision" id="body_subdivision">
<option value="" selected>--</option>
- [% FOR body IN bodies %]
- [% NEXT UNLESS body.parent.id == c.user.from_body.id %]
- <option value="[% body.id %]">[% body.name %]</option>
- [% END %]
+ [% list %]
</select>
</li>
+ [% END %]
<li><label for="status_update">[% loc('Public response:') %]</label>