diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-08 16:33:47 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-10-12 13:38:07 +0100 |
commit | a3f5f5cf353074f9a1b97e28366f1f22cc57d3ce (patch) | |
tree | b23efcee3431a0af34240674d95d71e991512234 /templates | |
parent | f4a9c33b3deeab5b17721ff42b54cad6a4713317 (diff) |
[Oxfordshire] Construct extra details for defect.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/oxfordshire/report/inspect/_extra_details_field.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/web/oxfordshire/report/inspect/_extra_details_field.html b/templates/web/oxfordshire/report/inspect/_extra_details_field.html new file mode 100644 index 000000000..5fc7b0086 --- /dev/null +++ b/templates/web/oxfordshire/report/inspect/_extra_details_field.html @@ -0,0 +1,35 @@ +<p> + <label for="detailed_information">[% loc('Extra details') %]</label> + [% IF max_detailed_info_length %] + <span id="detailed_information_length"> + [% tprintf(loc('%d characters maximum'), max_detailed_info_length) %] + </span> + [% END %] + <span class="js-inspect-defect-yes hidden-js"> + <br>[% c.user.email %] <span id="js-defect-prefix"></span> … + </span> + <textarea rows="2" name="detailed_information" id="detailed_information" class="form-control" + [% IF max_detailed_info_length %]data-max-length="[% max_detailed_info_length %]"[% END %]>[% problem.get_extra_metadata('detailed_information') | html %]</textarea> +</p> + +<script nonce="[% csp_nonce %]"> +(function(){ + function update_prefix() { + var prefix = document.getElementById('js-defect-prefix'); + var text = ''; + var traffic = document.getElementById('traffic_information'); + if (traffic.selectedIndex) { + text += 'TM' + traffic.selectedIndex + ' '; + } + var type = document.getElementById('defect_item_type'); + type = type.options[type.selectedIndex].value; + type = type.split(' ')[0]; + text += (type == 'Sweep') ? 'S&F' : type; + text += ' '; + prefix.textContent = text; + } + + document.getElementById('traffic_information').addEventListener('change', update_prefix); + document.getElementById('defect_item_type').addEventListener('change', update_prefix); +})(); +</script> |