diff options
Diffstat (limited to 'templates/web')
-rw-r--r-- | templates/web/base/admin/report-category.html | 14 | ||||
-rw-r--r-- | templates/web/base/admin/report_edit.html | 16 | ||||
-rw-r--r-- | templates/web/base/report/_inspect.html | 16 |
3 files changed, 17 insertions, 29 deletions
diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html new file mode 100644 index 000000000..ecb5f66f4 --- /dev/null +++ b/templates/web/base/admin/report-category.html @@ -0,0 +1,14 @@ +<select class="form-control" name="category" id="category"> + [% IF NOT problem.category OR NOT categories.grep(problem.category).size %] + <optgroup label="[% loc('Existing category') %]"> + <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option> + </optgroup> + [% END %] + [% IF categories.size %] + <optgroup label="[% loc('Available categories') %]"> + [% FOREACH cat IN categories %] + <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option> + [% END %] + </optgroup> + [% END %] +</select> diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index 911b1995a..3c8134b80 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -117,20 +117,8 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> [% INCLUDE 'admin/state_groups_select.html' %] </li> <li><label class="inline-text" for="category">[% loc('Category:') %]</label> -<select class="form-control" name="category" id="category"> - [% IF NOT problem.category OR NOT categories.grep(problem.category).size %] - <optgroup label="[% loc('Existing category') %]"> - <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option> - </optgroup> - [% END %] - [% IF categories.size %] - <optgroup label="[% loc('Available categories') %]"> - [% FOREACH cat IN categories %] - <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option> - [% END %] - </optgroup> - [% END %] -</select></li> + [% INCLUDE 'admin/report-category.html' %] +</li> <li><label class="inline-text" for="anonymous">[% loc('Anonymous:') %]</label> <select class="form-control" name="anonymous" id="anonymous"> <option [% 'selected ' IF problem.anonymous %]value="1">[% loc('Yes') %]</option> diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index d2ba1cc88..b75394abd 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -36,21 +36,7 @@ <div class="inspect-section"> <p> <label for="category">[% loc('Category') %]</label> - [%# XXX this is duplicated from admin/report_edit.html, should be refactored %] - <select name="category" id="category" class="form-control"> - [% IF NOT problem.category OR NOT categories.grep(problem.category).size %] - <optgroup label="[% loc('Existing category') %]"> - <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option> - </optgroup> - [% END %] - [% IF categories.size %] - <optgroup label="[% loc('Available categories') %]"> - [% FOREACH cat IN categories %] - <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option> - [% END %] - </optgroup> - [% END %] - </select> + [% INCLUDE 'admin/report-category.html' %] </p> [% FOREACH category IN categories %] |