diff options
Diffstat (limited to 'templates/web/base/admin')
21 files changed, 391 insertions, 102 deletions
diff --git a/templates/web/base/admin/_translations.html b/templates/web/base/admin/_translations.html new file mode 100644 index 000000000..d8f7d52fb --- /dev/null +++ b/templates/web/base/admin/_translations.html @@ -0,0 +1,19 @@ +[% IF languages.size > 1 %] +<h2>[% loc('Translations') %]</h2> + <input type="hidden" name="token" value="[% csrf_token %]" > +<table> + <tr> + <th>[% loc('Language') %]</th> + <th>[% loc('Translation') %]</th> + </tr> + [% FOREACH language IN languages.keys.sort %] + <tr> + <td> + <label for="translation_[% language %]">[% languages.$language.name %] ([% language %])</label> + <input type="hidden" name="translation_id_[% language %]" value="[% translations.$language.id %]"> + </td> + <td><input type="text" name="translation_[% language %]" id="translation_[% language %]" value="[% translations.$language.msgstr %]"></td> + </tr> + [% END %] +</table> +[% END %] diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html index 6c750bcaf..55d0e500c 100644 --- a/templates/web/base/admin/body-form.html +++ b/templates/web/base/admin/body-form.html @@ -25,6 +25,8 @@ <input type="text" class="form-control" name="name" id="name" value="[% body.name | html %]" size="50"> </p> + [% INCLUDE 'admin/_translations.html' %] + <div class="admin-hint"> <p> [% loc( diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html index 5e8c6a164..7fa446f44 100644 --- a/templates/web/base/admin/body.html +++ b/templates/web/base/admin/body.html @@ -70,7 +70,7 @@ <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('Category') %]</th> - <th colspan=2>[% loc('State') %]</th> + <th>[% loc('State') %]</th> <th>[% loc('Last editor') %]</th> <th>[% loc('Note') %]</th> [% IF any_not_confirmed %] @@ -78,20 +78,20 @@ [% END %] </tr> [% WHILE ( cat = contacts.next ) %] - <tr [% IF cat.deleted %]class="is-deleted"[% END %]> - <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category | html %]</a> + <tr [% IF cat.state == 'deleted' %]class="is-deleted"[% END %]> + <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category_display | html %]</a> <br>[% cat.email | html %]</td> <td> - [% loc('Confirmed') %]: - [%- IF cat.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] - <br>[% loc('Deleted') %]: - [%- IF cat.deleted %]<strong>[% loc('Yes') %]</strong>[% ELSE %][% loc('No') %][% END %] - </td> - <td> - [% loc('Private') %]: - [%- cat.non_public ? loc('Yes') : loc('No') %] - <br>[% loc('Devolved') %]: - [%- IF body.can_be_devolved AND cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + [% cat.state %] + [% IF cat.non_public OR (body.can_be_devolved AND cat.send_method) %] + <br><small> + [% IF cat.non_public %][% loc('Private') %][% END %] + [% IF cat.non_public AND (body.can_be_devolved AND cat.send_method) %] + / + [% END %] + [% IF body.can_be_devolved AND cat.send_method %][% loc('Devolved') %][% END %] + </small> + [% END %] </td> <td>[% cat.editor | html %] <br><small>[% PROCESS format_time time=cat.whenedited %]</small></td> @@ -130,9 +130,10 @@ <div class="fms-admin-warning"> [% errors.values.join('<br>') %] </div> + [% INCLUDE 'admin/contact-form.html' translations=contact_translations %] + [% ELSE %] + [% INCLUDE 'admin/contact-form.html' translations={} %] [% END %] - - [% INCLUDE 'admin/contact-form.html' %] </div> [% IF NOT errors and c.user.is_superuser %] diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/category_edit.html index 5eb3c943e..7ae4e59b4 100644 --- a/templates/web/base/admin/category_edit.html +++ b/templates/web/base/admin/category_edit.html @@ -21,38 +21,12 @@ [% INCLUDE 'admin/contact-form.html' %] -[% IF contact.extra %] -<h2>[% loc('Extra data:') %] </h2> -<dl> - [% FOR pair IN contact.get_extra_metadata %] - <dt>[% pair.key %]</dt> <dd>[% pair.value %]</dd> - [% END %] -</dl> -<ul> - [% FOR meta IN contact.get_metadata_for_input %] - <li> - [% meta.order %], <code>[% meta.code %]</code>, [% meta.datatype %], - [% meta.required == 'true' ? loc('required') : loc('optional') %] - <br><small>[% meta.description %]</small> - [% IF meta.variable != 'false' AND meta.exists('values') %] - <ul> - [% FOR option IN meta.values %] - <li>[% option.name %] <small>([% option.key %])</small></li> - [% END %] - </ul> - [%- END %] - </li> - [%- END %] -</ul> -[% END %] - <h2>[% loc('History') %]</h2> <table border="1"> <tr> <th>[% loc('When edited') %]</th> <th>[% loc('Email') %]</th> - <th>[% loc('Confirmed') %]</th> - <th>[% loc('Deleted') %]</th> + <th>[% loc('State') %]</th> <th>[% loc('Editor') %]</th> <th>[% loc('Note') %]</th> </tr> @@ -61,8 +35,7 @@ <tr> <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> <td>[% PROCESS highlightchanged old=prev new=contact value='email' %]</td> - <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='confirmed' %]</td> - <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='deleted' %]</td> + <td>[% PROCESS highlightchanged old=prev new=contact value='state' %]</td> <td>[% contact.editor | html %]</td> <td>[% contact.note | html %]</td> </tr> diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html index f35cd6adb..87032b0b6 100644 --- a/templates/web/base/admin/config_page.html +++ b/templates/web/base/admin/config_page.html @@ -88,6 +88,9 @@ running version <strong>[% git_version || 'unknown' %]</strong>. [% INCLUDE subsection heading="MapIt" %] [% INCLUDE just_value value="MAPIT_URL" conf = "<a href='" _ c.config.MAPIT_URL _ "'>" _ c.config.MAPIT_URL _ "</a>" %] +[% IF c.config.MAPIT_API_KEY %] + [% INCLUDE just_value value="MAPIT_API_KEY" %] +[% END %] [% INCLUDE with_cobrand value="MAPIT_TYPES" cob = c.cobrand.area_types %] <tr> diff --git a/templates/web/base/admin/contact-form.html b/templates/web/base/admin/contact-form.html index 493d8020f..1157e781e 100644 --- a/templates/web/base/admin/contact-form.html +++ b/templates/web/base/admin/contact-form.html @@ -2,7 +2,7 @@ [% IF contact.in_storage %] <p> - <h1>[% contact.category | html %]</h2> + <h1>[% contact.category_display | html %]</h1> <input type="hidden" name="category" value="[% contact.category | html %]" > </p> [% ELSE %] @@ -20,6 +20,8 @@ </p> [% END %] + [% INCLUDE 'admin/_translations.html' %] + <div class="admin-hint"> <p> [% loc("The <strong>email address</strong> is the destination to which reports about this category will be sent. @@ -38,24 +40,23 @@ <div class="admin-hint"> <p> - [% loc("Check <strong>confirmed</strong> to indicate that this contact has been confirmed as correct. - If you are not sure of the origin or validity of the contact, leave this unchecked.") %] + [% +loc("Use <strong>confirmed</strong> to indicate that this contact has been +confirmed as correct. If you are not sure of the origin or validity of the +contact, use <strong>unconfirmed</strong>. <strong>inactive</strong> will +remove the category from use when reporting problems, but keep it available in +map filters, and <strong>deleted</strong> will remove the category from there +as well.") %] </p> </div> <p> - <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed OR contact.confirmed == "" %]> - <label for="confirmed" class="inline">[% loc('Confirmed') %]</label> - </p> - - <div class="admin-hint"> - <p> - [% loc("Check <strong>deleted</strong> to remove the category from use. - It will not appear as an available category in the drop-down menu on the report-a-problem page.") %] - </p> - </div> - <p> - <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]> - <label for="deleted" class="inline">[% loc('Deleted') %]</label> + <label for="state">[% loc('State') %]</label> + <select name="state" id="state"> + <option value="unconfirmed"[% ' selected' IF contact.state == 'unconfirmed' %]>[% loc('Unconfirmed') %] + <option value="confirmed"[% ' selected' IF contact.state == 'confirmed' || contact.state == "" %]>[% loc('Confirmed') %] + <option value="inactive"[% ' selected' IF contact.state == 'inactive' %]>[% loc('Inactive') %] + <option value="deleted"[% ' selected' IF contact.state == 'deleted' %]>[% loc('Deleted') %] + </select> </p> <div class="admin-hint"> @@ -136,4 +137,12 @@ <input type="hidden" name="token" value="[% csrf_token %]" > <input type="submit" class="btn" name="Create category" value="[% contact.in_storage ? loc('Save changes') : loc('Create category') %]" > </p> + + <h2>[% loc('Extra data:') %] </h2> + <dl> + [% FOR pair IN contact.get_extra_metadata %] + <dt>[% pair.key %]</dt> <dd>[% pair.value %]</dd> + [% END %] + </dl> + [% INCLUDE 'admin/extra-metadata-form.html' metas=(contact.get_metadata_for_input OR []) %] </form> diff --git a/templates/web/base/admin/council_contacts.txt b/templates/web/base/admin/council_contacts.txt index 2d1e04bfa..f11615789 100644 --- a/templates/web/base/admin/council_contacts.txt +++ b/templates/web/base/admin/council_contacts.txt @@ -1,4 +1,4 @@ [% WHILE ( contact = contacts.next ) -%] -[%- NEXT IF contact.deleted || ! contact.confirmed %] -[% contact.category %] [% contact.email %] +[%- NEXT IF contact.state != 'confirmed' %] +[% contact.category_display %] [% contact.email %] [%- END %] diff --git a/templates/web/base/admin/defecttypes/list.html b/templates/web/base/admin/defecttypes/list.html index 783bd085c..ffff89eff 100644 --- a/templates/web/base/admin/defecttypes/list.html +++ b/templates/web/base/admin/defecttypes/list.html @@ -20,7 +20,7 @@ <em>[% ('All categories') %]</em> [% ELSE %] [% FOR contact IN d.contacts %] - [% contact.category %][% ',' UNLESS loop.last %] + [% contact.category_display %][% ',' UNLESS loop.last %] [% END %] [% END %] </td> diff --git a/templates/web/base/admin/extra-metadata-form.html b/templates/web/base/admin/extra-metadata-form.html new file mode 100644 index 000000000..6a88a3c1e --- /dev/null +++ b/templates/web/base/admin/extra-metadata-form.html @@ -0,0 +1,81 @@ +<ul class="js-metadata-items"> + [% FOR meta IN metas.merge([{}]) %] + <li class="js-metadata-item [% IF loop.last %]hidden-js js-metadata-item-template[% END %]" data-index="[% loop.index %]"> + <button class="btn btn--small js-metadata-item-remove hidden-nojs">[% loc('Remove field') %]</button> + + <div class="admin-hint"><p>[% loc('The ordering of this field on the report page. Fields are shown in ascending order according to this value.') %]</p></div> + <label> + [% loc('Order') %] + <input name="metadata[[% loop.index %]].order" data-field-name="order" type=text value="[% meta.order | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('The code used to store this field value in the database. e.g. <code>address</code> would be available as <code>problem.extra.address</code> in the templates.') %]</p></div> + <label> + [% loc('Code') %] + <input name="metadata[[% loop.index %]].code" data-field-name="code" type=text value="[% meta.code | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('Whether the user is required to provide a value for this field.') %]</p></div> + <label> + [% loc('Required') %] + <input name="metadata[[% loop.index %]].required" data-field-name="required" type=checkbox [% meta.required == 'true' ? 'checked' : '' %]> + </label> + + <div class="admin-hint"><p>[% loc('If ticked the user won’t see an input field, just the ‘Description’ text.') %]</p></div> + <label> + [% loc('Notice') %] + <input name="metadata[[% loop.index %]].notice" data-field-name="notice" type=checkbox [% meta.variable == 'false' ? 'checked' : '' %]> + </label> + + <div class="admin-hint"><p>[% loc('The field name as shown to the user on the report form.') %]</p></div> + <label> + [% loc('Description') %] + <input name="metadata[[% loop.index %]].description" data-field-name="description" type=text value="[% meta.description | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('Can be used to display extra text to the user alongside the field. The default template does not show this (<code>meta.datatype_description</code>), you must add it in <code>category_extras_fields.html</code>') %]</p></div> + <label> + [% loc('Hint') %] + <input name="metadata[[% loop.index %]].datatype_description" data-field-name="datatype_description" type=text value="[% meta.datatype_description | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('The type of input field to show to the user. <strong>Text</strong> is a simple text field, <strong>List</strong> is a drop-down selection.') %]</p></div> + <label> + [% loc('Type') %] + <select name="metadata[[% loop.index %]].datatype" data-field-name="datatype" class="js-metadata-item-type"> + <option value="string" [% meta.datatype == 'string' ? 'selected' : '' %]>[% loc('String') %]</option> + <option value="singlevaluelist" [% meta.datatype == 'singlevaluelist' ? 'selected' : '' %]>[% loc('List') %]</option> + </select> + </label> + + <div class="js-metadata-options"> + <div class="admin-hint"><p>[% loc('For each option, <strong>Key</strong> is the value which is stored in the database for that option and <strong>Name</strong> is the value displayed to the user.') %]</p></div> + [% loc('Options') %]<span class="hidden-js"> [% loc('(ignored if type is "String")') %]</span> + <ul> + [% outer_loop = loop %] + [% values = meta.values OR [] %] + [% FOREACH option IN values.merge([{}]) %] + [%# the .merge() call is so there's an empty one on the end %] + <li class="js-metadata-option [% IF loop.last %]hidden-js js-metadata-option-template[% END %]"> + <label> + [% loc('Key') %] + <input class="js-metadata-option-key" name="metadata[[% outer_loop.index %]].values[[% loop.index %]].key" type="text" value="[% option.key | html %]"> + </label> + <label> + [% loc('Name') %] + <input class="js-metadata-option-name" name="metadata[[% outer_loop.index %]].values[[% loop.index %]].name" type="text" value="[% option.name | html %]"> + </label> + <button class="btn btn--small js-metadata-option-remove hidden-nojs">[% loc('Remove') %]</button> + </li> + [% END %] + <li class="hidden-nojs"> + <button class="btn btn--small js-metadata-option-add">[% loc('Add option') %]</button> + </li> + </ul> + </div> + </li> + [%- END %] + <li class="hidden-nojs"> + <button class="btn btn--small js-metadata-item-add">[% loc('Add field') %]</button> + </li> +</ul> diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html index 35f7adf66..d759a2354 100644 --- a/templates/web/base/admin/list_updates.html +++ b/templates/web/base/admin/list_updates.html @@ -34,7 +34,7 @@ <td>[% IF update.user.id == update.problem.user_id %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% IF update.user.belongs_to_body( update.problem.bodies_str ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td> - <td>[% state_pretty.${update.state} %]<br><small> + <td>[% prettify_state(update.state) %]<br><small> [% loc('Created:') %] [% PROCESS format_time time=update.created %] <br>[% loc('Confirmed:') %] [% PROCESS format_time time=update.confirmed %] </small></td> diff --git a/templates/web/base/admin/problem_row.html b/templates/web/base/admin/problem_row.html index 577e36992..446e94d66 100644 --- a/templates/web/base/admin/problem_row.html +++ b/templates/web/base/admin/problem_row.html @@ -20,7 +20,7 @@ <br>[% loc('Anonymous') %]: [% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] </td> <td> - [% PROCESS value_or_nbsp value=problem.category %] + [% PROCESS value_or_nbsp value=problem.category_display %] <br>[%- IF edit_body_contacts -%] [% FOR body IN problem.bodies.values %] <a href="[% c.uri_for('body', body.id ) %]">[% PROCESS value_or_nbsp value=body.name %]</a> @@ -30,12 +30,12 @@ [%- END -%] <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %] </td> - <td>[% state_pretty.${problem.state} %]<br><small> + <td>[% prettify_state(problem.state, 1) %]<br><small> [% loc('Created') %]: [% PROCESS format_time time=problem.created %] <br>[% loc('When sent') %]: [% PROCESS format_time time=problem.whensent %] [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %] [% PROCESS format_time time=problem.confirmed %][% END -%] - [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] - [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_fixed %]<br>[% prettify_state('fixed') %]: [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_closed %]<br>[% prettify_state('closed') %]: [% PROCESS format_time time=problem.lastupdate %][% END -%] [%- IF problem.is_open %]<br>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] </small></td> <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td> diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html index 1e39236d7..a2290089b 100644 --- a/templates/web/base/admin/report-category.html +++ b/templates/web/base/admin/report-category.html @@ -1,13 +1,13 @@ <select class="form-control" name="category" id="category"> [% IF NOT problem.category OR NOT categories_hash.${problem.category} %] <optgroup label="[% loc('Existing category') %]"> - <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option> + <option selected value="[% problem.category | html %]">[% (problem.category_display OR '-') | html %]</option> </optgroup> [% END %] - [% IF categories.size %] + [% IF category_options_copy.size %] <optgroup label="[% loc('Available categories') %]"> - [% FOREACH cat IN categories %] - <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option> + [% FOREACH cat IN category_options_copy %] + <option value="[% cat.name | html %]"[% ' selected' IF problem.category == cat.name %]>[% cat.value | html %]</option> [% END %] </optgroup> [% END %] diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html index 9231dd1c2..f5896b88f 100644 --- a/templates/web/base/admin/report_blocks.html +++ b/templates/web/base/admin/report_blocks.html @@ -1,32 +1,7 @@ [% SET report_blocks_included = 1; - -SET state_pretty = { - 'confirmed' = loc('Open') - 'investigating' = loc('Investigating') - 'planned' = loc('Planned') - 'in progress' = loc('In progress') - 'action scheduled' = loc('Action Scheduled') - 'fixed' = loc('Fixed') - 'fixed - user' = loc('Fixed - User') - 'fixed - council' = loc('Fixed - Council') - 'unable to fix' = loc('No further action') - 'not responsible' = loc('Not Responsible') - 'duplicate' = loc('Duplicate') - 'closed' = loc('Closed') - 'internal referral' = loc('Internal referral') - 'hidden' = loc('Hidden') - 'partial' = loc('Partial') - 'unconfirmed' = loc('Unconfirmed') -}; - -SET state_groups = [ - [ loc('Open'), [ 'confirmed', 'investigating', 'planned', 'in progress', 'action scheduled' ] ], - [ loc('Fixed'), [ 'fixed', 'fixed - user', 'fixed - council' ] ], - [ loc('Closed'), [ 'unable to fix', 'not responsible', 'duplicate', 'closed', 'internal referral' ] ], - [ loc('Hidden'), [ 'hidden', 'partial', 'unconfirmed' ] ] -]; +SET state_groups = c.cobrand.state_groups_admin; %] diff --git a/templates/web/base/admin/reportextrafields/edit.html b/templates/web/base/admin/reportextrafields/edit.html new file mode 100644 index 000000000..bc2f60ab3 --- /dev/null +++ b/templates/web/base/admin/reportextrafields/edit.html @@ -0,0 +1,68 @@ +[% INCLUDE 'admin/header.html' title=loc('Extra Fields') -%] + +<form method=post action="[% c.uri_for('', extra.id || 'new' ) %]"> + <div class="admin-hint"> + <p> + [% loc('Give this collection of fields a name. It is not shown publicly, just here in the admin.') %] + </p> + </div> + <p> + <label> + [% loc('Name') %] + <input type=text name="name" value="[% extra.name | html %]" /> + </label> + </p> + + [% IF cobrands.size > 1 %] + <div class="admin-hint"> + <p> + [% loc('To limit this collection of fields to a single cobrand, select it here.') %] + </p> + </div> + <p> + <label> + [% loc('Cobrand') %] + <select name="cobrand"> + <option value="">[% loc('All cobrands') %]</option> + [% FOREACH cobrand IN cobrands %] + <option value="[% cobrand | html %]" [% IF cobrand == extra.cobrand %]selected[% END %]>[% cobrand | html %]</option> + [% END %] + </select> + </label> + </p> + [% ELSE %] + <input type=hidden name=cobrand value="[% extra.cobrand | html %]" /> + [% END %] + + [% IF languages.size > 1 %] + <div class="admin-hint"> + <p> + [% loc('To limit this collection of fields to a single language, select it here.') %] + </p> + </div> + <p> + <label> + [% loc('Language') %] + <select name="language"> + <option value="">[% loc('All languages') %]</option> + [% FOREACH lang IN languages.pairs %] + <option value="[% lang.key | html %]" [% IF lang.key == extra.language %]selected[% END %]>[% lang.value.name | html %]</option> + [% END %] + </select> + </label> + </p> + [% ELSE %] + <input type=hidden name=language value="[% extra.language | html %]" /> + [% END %] + <p> + <label>[% loc('Fields') %]</label> + [% INCLUDE 'admin/extra-metadata-form.html' metas=extra.get_extra_fields %] + </p> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]" > + <input type="submit" class="btn" name="save" value="[% extra.in_storage ? loc('Save changes') : loc('Save new fields') %]"> + </p> +</form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/reportextrafields/index.html b/templates/web/base/admin/reportextrafields/index.html new file mode 100644 index 000000000..14d6f60d4 --- /dev/null +++ b/templates/web/base/admin/reportextrafields/index.html @@ -0,0 +1,26 @@ +[% INCLUDE 'admin/header.html' title=loc('Extra Fields') -%] + +<table> + <thead> + <tr> + <th>[% loc('Name') %]</th> + <th>[% loc('Cobrand') %]</th> + <th>[% loc('Languages') %]</th> + <th>[% loc('Fields') %]</th> + </tr> + </thead> + <tbody> + [% FOR f IN extra_fields %] + <tr> + <td><a href="[% c.uri_for('', f.id) %]">[% f.name | html %]</a></td> + <td>[% f.cobrand | html %]</td> + <td>[% f.language | html %]</td> + <td>[% f.get_extra_fields.size %]</td> + </tr> + [% END %] + </tbody> +</table> + +<a href="[% c.uri_for('', 'new') %]" class="btn">[% loc('Add extra fields') %]</a> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/responsepriorities/edit.html b/templates/web/base/admin/responsepriorities/edit.html index 07d6906ba..608f19e74 100644 --- a/templates/web/base/admin/responsepriorities/edit.html +++ b/templates/web/base/admin/responsepriorities/edit.html @@ -30,6 +30,18 @@ <div class="admin-hint"> <p> + [% loc('Select if this is the default priority') %] + </p> + </div> + <p> + <label> + <input type="checkbox" name="is_default" is="is_deleted" value="1"[% ' checked' IF rp.is_default %]> + [% loc('Default priority') %] + </label> + </p> + + <div class="admin-hint"> + <p> [% loc('If you only want this priority to be an option for specific categories, pick them here. By default they will show for all categories.') %] </p> </div> diff --git a/templates/web/base/admin/responsepriorities/list.html b/templates/web/base/admin/responsepriorities/list.html index 4c05ca14d..eedaccfdb 100644 --- a/templates/web/base/admin/responsepriorities/list.html +++ b/templates/web/base/admin/responsepriorities/list.html @@ -6,6 +6,7 @@ <th> [% loc('Name') %] </th> <th> [% loc('Description') %] </th> <th> [% loc('Categories') %] </th> + <th> [% loc('Default') %] </th> <th> </th> </tr> </thead> @@ -19,10 +20,11 @@ <em>[% loc('All categories') %]</em> [% ELSE %] [% FOR contact IN p.contacts %] - [% contact.category %][% ',' UNLESS loop.last %] + [% contact.category_display %][% ',' UNLESS loop.last %] [% END %] [% END %] </td> + <td> [% IF p.is_default %]X[% END %]</td> <td> <a href="[% c.uri_for('', body.id, p.id) %]" class="btn">[% loc('Edit') %]</a> </td> </tr> [% END %] diff --git a/templates/web/base/admin/state_groups_select.html b/templates/web/base/admin/state_groups_select.html index 9a70cd2c9..87674c47d 100644 --- a/templates/web/base/admin/state_groups_select.html +++ b/templates/web/base/admin/state_groups_select.html @@ -1,3 +1,3 @@ [% PROCESS 'admin/report_blocks.html'; # For state_groups %] [% DEFAULT current_state = problem.state %] -[% INCLUDE 'report/_state_select_field.html' %] +[% INCLUDE 'report/_state_select_field.html' single_fixed=0 %] diff --git a/templates/web/base/admin/states/index.html b/templates/web/base/admin/states/index.html new file mode 100644 index 000000000..1b68d4aea --- /dev/null +++ b/templates/web/base/admin/states/index.html @@ -0,0 +1,118 @@ +[% INCLUDE 'admin/header.html' title=loc('States') ~%] + +[% SET rows = languages.size + 1 IF languages.size > 1 ~%] + +<form method="post" accept-charset="utf-8"> + +<table> + <tr> + <th>[% loc('Label') %]</th> + <th>[% loc('Type') %]</th> + <th colspan="2">[% loc('Name') %]</th> + <th> </th> + </tr> + [% FOREACH state IN open_states.merge(closed_states).merge(fixed_states) %] + <tr> + <td rowspan="[% rows %]"> + [% IF state.label == 'confirmed' %] + open + [% ELSE %] + [% state.label %] + [% END %] + </td> + <td rowspan="[% rows %]"> + [% IF state.label == 'confirmed' %] + [% loc('Open') %]<input type="hidden" name="type:confirmed" value="open"> + [% ELSIF state.label == 'closed' %] + [% loc('Closed') %]<input type="hidden" name="type:closed" value="closed"> + [% ELSIF state.label == 'fixed' %] + [% loc('Fixed') %]<input type="hidden" name="type:fixed" value="fixed"> + [% ELSE %] + <select name="type:[% state.label %]"> + <option value="open"[% ' selected' IF state.type == 'open' %]>[% loc('Open') %]</option> + <option value="closed"[% ' selected' IF state.type == 'closed' %]>[% loc('Closed') %]</option> + </select> + [% END %] + </td> + <td colspan="2"> + [% IF state.label != 'confirmed' AND state.label != 'closed' %] + <input type="text" name="name:[% state.label %]" value="[% state.name %]"> + [% ELSIF languages.size == 1 %] + <input type="text" name="name:[% state.label %]" value="[% state.msgstr %]"> + [% ELSE %] + [% state.name %] + [% END %] + </td> + <td style="text-align:center;vertical-align:middle" rowspan="[% rows %]"> + [% IF state.label != 'confirmed' AND state.label != 'closed' %] + <input class="btn btn--small" type="submit" name="delete:[% state.label %]" value="Delete"> + [% END %] + </td> + </tr> + [% IF languages.size > 1 %] + [% FOREACH language IN languages.keys.sort %] + <tr> + <td style="vertical-align:middle; text-align:right;"> + <label style="margin:0" for="translation:[% state.label %]:[% language %]"> + [% languages.$language.name %] ([% language %]) + </label> + </td> + <td> + <input type="hidden" name="translation_id:[% state.label %]:[% language %]" + value="[% state.translated.name.$language.id %]"> + <input type="text" name="translation:[% state.label %]:[% language %]" + id="translation:[% state.label %]:[% language %]" value="[% state.translated.name.$language.msgstr %]"> + </td> + </tr> + [% END %] + [% END %] + </td> + </tr> + [% END %] +</table> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" value="[% loc('Update') %]"> + </p> + +</form> + +[% IF fixed_states.size == 0 %] +<form method="post" accept-charset="utf-8"> + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" name="new_fixed" value="[% loc('Add fixed state') %]"> + </p> +</form> + +[% END %] + +<h2>[% loc('New state') %]</h2> + +<form method="post" accept-charset="utf-8"> + <p> + <label for="label">[% loc('Label') %] <small>[% loc('(a-z and space only)') %]</small></label> + <input type="text" class="form-control" name="label" id="label" value="" size="20" pattern="[a-z ]+"> + </p> + + <p> + <label for="type">[% loc('Type') %]</label> + <select name="type" id="type"> + <option value="open">[% loc('Open') %]</option> + <option value="closed">[% loc('Closed') %]</option> + </select> + </p> + + <p> + <label for="name">[% loc('Name') %]</label> + <input type="text" class="form-control" name="name" id="name" value="" size="20"> + </p> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" name="new" value="[% loc('Create') %]"> + </p> +</form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/stats.html b/templates/web/base/admin/stats.html index 535f04d18..150afd619 100644 --- a/templates/web/base/admin/stats.html +++ b/templates/web/base/admin/stats.html @@ -99,7 +99,7 @@ [% END %] <p> - <input type="submit" class="btn" name="getcounts" size="30" id="getcounts" value="Get Count" /> + <input type="submit" class="btn" name="getcounts" size="30" id="getcounts" value="[% loc('Get Count') %]" /> </p> </form> diff --git a/templates/web/base/admin/stats_by_state.html b/templates/web/base/admin/stats_by_state.html index b003d934e..6bcd35f88 100644 --- a/templates/web/base/admin/stats_by_state.html +++ b/templates/web/base/admin/stats_by_state.html @@ -4,7 +4,7 @@ [%- BLOCK states -%] [%- FOREACH state IN list %] [%- '<ul>' IF loop.first %] - <li>[% object.$state %] [% state_pretty.$state %]</li> + <li>[% object.$state %] [% prettify_state(state) %]</li> [%- "\n</ul>" IF loop.last %] [%- END %] [% END -%] |