aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web')
-rw-r--r--templates/web/base/admin/report_edit.html14
-rw-r--r--templates/web/base/admin/response_templates_select.html2
-rw-r--r--templates/web/base/admin/state_groups_select.html14
-rw-r--r--templates/web/base/admin/template_edit.html10
-rw-r--r--templates/web/base/report/_inspect.html12
5 files changed, 30 insertions, 22 deletions
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html
index 02e75563c..911b1995a 100644
--- a/templates/web/base/admin/report_edit.html
+++ b/templates/web/base/admin/report_edit.html
@@ -112,16 +112,10 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a>
<li><label for='detail'>[% loc('Details:') %]</label>
<textarea class="form-control" name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li>
-<li><label class="inline-text" for="state">[% loc('State:') %]</label>
-<select class="form-control" name="state" id="state">
-[% FOREACH group IN state_groups %]
- <optgroup label="[% group.0 %]">
- [% FOREACH state IN group.1 %]
- <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option>
- [% END %]
- </optgroup>
-[% END %]
-</select></li>
+<li>
+ <label class="inline-text" for="state">[% loc('State:') %]</label>
+ [% 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 %]
diff --git a/templates/web/base/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html
index 417be9add..e10460e48 100644
--- a/templates/web/base/admin/response_templates_select.html
+++ b/templates/web/base/admin/response_templates_select.html
@@ -3,7 +3,7 @@
<select id="templates_for_[% for %]" class="form-control js-template-name" data-for="[% for %]" name="response_template">
<option value="">[% loc('--Choose a template--') %]</option>
[% FOR t IN problem.response_templates %]
- <option value="[% t.text | html %]"> [% t.title | html %] </option>
+ <option value="[% t.text | html %]" data-problem-state="[% t.state | html %]"> [% t.title | html %] </option>
[% END %]
</select>
</div>
diff --git a/templates/web/base/admin/state_groups_select.html b/templates/web/base/admin/state_groups_select.html
new file mode 100644
index 000000000..229d181ab
--- /dev/null
+++ b/templates/web/base/admin/state_groups_select.html
@@ -0,0 +1,14 @@
+[% PROCESS 'admin/report_blocks.html'; # For state_groups %]
+[% DEFAULT current_state = problem.state %]
+<select class="form-control" name="state" id="state">
+[% IF include_empty %]
+ <option value="">---</option>
+[% END %]
+[% FOREACH group IN state_groups %]
+ <optgroup label="[% group.0 %]">
+ [% FOREACH state IN group.1 %]
+ <option [% 'selected ' IF state == current_state %] value="[% state %]">[% state_pretty.$state %]</option>
+ [% END %]
+ </optgroup>
+[% END %]
+</select>
diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html
index b2e734756..76de70dcc 100644
--- a/templates/web/base/admin/template_edit.html
+++ b/templates/web/base/admin/template_edit.html
@@ -31,6 +31,16 @@
</div>
[% INCLUDE 'admin/category-checkboxes.html' %]
+ <div class="admin-hint">
+ <p>
+ [% loc('If you want to use this template to prefill the update field when changing a report&rsquo;s state, select the state here.') %]
+ </p>
+ </div>
+ <p>
+ <label for="state">[% loc('State') %]</label>
+ [% INCLUDE 'admin/state_groups_select.html' current_state=rt.state include_empty=1 %]
+ </p>
+
<p>
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="submit" class="btn" name="Edit templates" value="[% rt.id ? loc('Save changes') : loc('Create template') %]" >
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index 84170a38c..43e86cb47 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -1,4 +1,3 @@
-[% PROCESS 'admin/report_blocks.html'; # For the report state dropdown %]
[% permissions = c.user.permissions(c, problem.bodies_str) %]
[% second_column = BLOCK -%]
<div id="side-inspect">
@@ -65,16 +64,7 @@
[% IF permissions.report_inspect %]
<p>
<label for="state">[% loc('State') %]</label>
- [%# XXX this is duplicated from admin/report_edit.html, should be refactored %]
- <select name="state" id="state" class="form-control">
- [% FOREACH group IN state_groups %]
- <optgroup label="[% group.0 %]">
- [% FOREACH state IN group.1 %]
- <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option>
- [% END %]
- </optgroup>
- [% END %]
- </select>
+ [% INCLUDE 'admin/state_groups_select.html' %]
</p>
<div id="js-duplicate-reports" class="[% "hidden" UNLESS problem.duplicate_of %]">
<input type="hidden" name="duplicate_of" value="[% problem.duplicate_of.id %]">