aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/admin/_translations.html19
-rw-r--r--templates/web/base/admin/body-form.html2
-rw-r--r--templates/web/base/admin/body.html7
-rw-r--r--templates/web/base/admin/category-checkboxes.html2
-rw-r--r--templates/web/base/admin/category-multiselect.html2
-rw-r--r--templates/web/base/admin/contact-form.html4
-rw-r--r--templates/web/base/admin/council_contacts.txt2
-rw-r--r--templates/web/base/admin/defecttypes/list.html2
-rw-r--r--templates/web/base/admin/problem_row.html2
-rw-r--r--templates/web/base/admin/report-category.html8
-rw-r--r--templates/web/base/admin/responsepriorities/list.html2
-rw-r--r--templates/web/base/dashboard/index.html2
-rw-r--r--templates/web/base/report/_inspect.html25
-rw-r--r--templates/web/base/report/_item.html2
-rw-r--r--templates/web/base/report/new/category.html6
-rw-r--r--templates/web/base/reports/_list-filters.html4
-rw-r--r--templates/web/zurich/admin/body.html2
-rw-r--r--templates/web/zurich/admin/contact-form.html2
-rw-r--r--templates/web/zurich/admin/problem_row.html2
-rw-r--r--templates/web/zurich/admin/report_edit-sdm.html2
-rw-r--r--templates/web/zurich/admin/report_edit.html6
-rw-r--r--templates/web/zurich/report/_main.html2
22 files changed, 67 insertions, 40 deletions
diff --git a/templates/web/base/admin/_translations.html b/templates/web/base/admin/_translations.html
new file mode 100644
index 000000000..d2e0ba322
--- /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 %]
+ <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 82032c0c3..7fa446f44 100644
--- a/templates/web/base/admin/body.html
+++ b/templates/web/base/admin/body.html
@@ -79,7 +79,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<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 | html %]</a>
+ <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>
[% cat.state %]
@@ -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-checkboxes.html b/templates/web/base/admin/category-checkboxes.html
index 63acd4112..9d5ab17ea 100644
--- a/templates/web/base/admin/category-checkboxes.html
+++ b/templates/web/base/admin/category-checkboxes.html
@@ -11,7 +11,7 @@
<li>
<label>
<input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/>
- [% contact.category %]
+ [% contact.category_display %]
</label>
</li>
[% END %]
diff --git a/templates/web/base/admin/category-multiselect.html b/templates/web/base/admin/category-multiselect.html
index 98416204f..4e4eceeed 100644
--- a/templates/web/base/admin/category-multiselect.html
+++ b/templates/web/base/admin/category-multiselect.html
@@ -4,7 +4,7 @@
<p>
<select class="form-control js-multiple" name="categories" id="categories" multiple data-all="[% loc('All categories') %]">
[% FOR contact IN contacts %]
- <option value="[% contact.id %]" [% 'selected' IF contact.active %]>[% contact.category | html %]</option>
+ <option value="[% contact.id %]" [% 'selected' IF contact.active %]>[% contact.category_display | html %]</option>
[% END %]
</select>
</p>
diff --git a/templates/web/base/admin/contact-form.html b/templates/web/base/admin/contact-form.html
index 0694459cb..375b3eb99 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.
diff --git a/templates/web/base/admin/council_contacts.txt b/templates/web/base/admin/council_contacts.txt
index ffab83ab6..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.state != 'confirmed' %]
-[% contact.category %] [% contact.email %]
+[% 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/problem_row.html b/templates/web/base/admin/problem_row.html
index e7e18dee9..def6ce60f 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>
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/responsepriorities/list.html b/templates/web/base/admin/responsepriorities/list.html
index 4c05ca14d..80d4e2cee 100644
--- a/templates/web/base/admin/responsepriorities/list.html
+++ b/templates/web/base/admin/responsepriorities/list.html
@@ -19,7 +19,7 @@
<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>
diff --git a/templates/web/base/dashboard/index.html b/templates/web/base/dashboard/index.html
index 2a9a2ef42..6033ef36b 100644
--- a/templates/web/base/dashboard/index.html
+++ b/templates/web/base/dashboard/index.html
@@ -29,7 +29,7 @@
<label for="category">[% loc('Category:') %]</label>
<select class="form-control" name="category"><option value=''>[% loc('All') %]</option>
[% FOR cat_op IN category_options %]
- <option value='[% cat_op | html %]'[% ' selected' IF category == cat_op %]>[% cat_op | html %]</option>
+ <option value='[% cat_op.name | html %]'[% ' selected' IF category == cat_op.name %]>[% cat_op.value | html %]</option>
[% END %]
</select>
</p>
diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html
index bf57cb858..922cc480b 100644
--- a/templates/web/base/report/_inspect.html
+++ b/templates/web/base/report/_inspect.html
@@ -50,18 +50,21 @@
[% INCLUDE 'admin/report-category.html' %]
</p>
- [% FOREACH category IN categories %]
- [% cat_prefix = category | lower | replace('[^a-z]', '') %]
- [% cat_prefix = "category_" _ cat_prefix _ "_" %]
- [% IF category == problem.category %]
- <p data-category="[% category | html %]" data-priorities='[% priorities_by_category.$category %]' data-defect-types='[% category_defect_types.$category %]' data-templates='[% templates_by_category.$category %]'>
- [% INCLUDE 'report/new/category_extras_fields.html' %]
- </p>
- [% ELSE %]
- <p data-category="[% category | html %]" class="hidden" data-priorities='[% priorities_by_category.$category %]' data-defect-types='[% category_defect_types.$category %]' data-templates='[% templates_by_category.$category %]'>
- [% INCLUDE 'report/new/category_extras_fields.html' report_meta='' %]
+ [% FOREACH category IN category_options_copy %]
+ [% cat_name = category.name;
+ cat_prefix = cat_name | lower | replace('[^a-z]', '');
+ cat_prefix = "category_" _ cat_prefix _ "_" %]
+ <p data-category="[% cat_name | html %]"
+ [%~ IF cat_name != problem.category %] class="hidden"[% END %]
+ data-priorities='[% priorities_by_category.$cat_name %]'
+ data-defect-types='[% category_defect_types.$cat_name %]'
+ ata-templates='[% templates_by_category.$cat_name %]'>
+ [% IF cat_name == problem.category %]
+ [% INCLUDE 'report/new/category_extras_fields.html' %]
+ [% ELSE %]
+ [% INCLUDE 'report/new/category_extras_fields.html' report_meta='' %]
+ [% END %]
</p>
- [% END %]
[% END %]
[% IF permissions.report_inspect %]
diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html
index 7a3530b1f..a892086ca 100644
--- a/templates/web/base/report/_item.html
+++ b/templates/web/base/report/_item.html
@@ -90,7 +90,7 @@
</div>
<div>
<h4>[% loc('Category') %]</h4>
- <p>[% (problem.category OR '-') | html %]</p>
+ <p>[% (problem.category_display OR '-') | html %]</p>
</div>
<div>
<h4>[% loc('State') %]</h4>
diff --git a/templates/web/base/report/new/category.html b/templates/web/base/report/new/category.html
index 4c66f00fb..b8ebf1653 100644
--- a/templates/web/base/report/new/category.html
+++ b/templates/web/base/report/new/category.html
@@ -7,9 +7,9 @@
</label>[% =%]
<select class="form-control" name='category' id='form_category' data-role='[% c.user.has_body_permission_to('planned_reports') ? 'inspector' : 'user' %]' data-body='[% c.user.from_body.name %]'>
[%~ FOREACH cat_op IN category_options ~%]
- [% cat_op_lc = cat_op | lower =%]
- <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%]
- >[% IF loop.first %][% cat_op %][% ELSE %][% cat_op | html %][% END %]</option>
+ [% cat_op_lc = cat_op.name | lower =%]
+ <option value='[% cat_op.name | html %]'[% ' selected' IF report.category == cat_op.name || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%]
+ >[% IF loop.first %][% cat_op.value %][% ELSE %][% cat_op.value | html %][% END %]</option>
[%~ END =%]
</select>
[%~ END ~%]
diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html
index efb917c16..73afe64f4 100644
--- a/templates/web/base/reports/_list-filters.html
+++ b/templates/web/base/reports/_list-filters.html
@@ -19,8 +19,8 @@
[% IF filter_categories.size %]
<select class="form-control js-multiple" name="filter_category" id="filter_categories" multiple data-all="[% loc('Everything') %]">
[% FOR cat IN filter_categories %]
- <option value="[% cat | html %]"[% ' selected' IF filter_category.$cat %]>
- [% cat | html %]
+ <option value="[% cat.name | html %]"[% ' selected' IF filter_category.${cat.name} %]>
+ [% cat.value | html %]
</option>
[% END %]
</select>
diff --git a/templates/web/zurich/admin/body.html b/templates/web/zurich/admin/body.html
index cf860990d..468f7adff 100644
--- a/templates/web/zurich/admin/body.html
+++ b/templates/web/zurich/admin/body.html
@@ -19,7 +19,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<tr[% IF cat.deleted %] class="is-deleted"[% END %]>
- <td><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category %]</a></td>
+ <td><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category_display %]</a></td>
<td>[% cat.email | html %]</td>
<td>[% cat.editor %]</td>
<td>[% cat.note | html %]</td>
diff --git a/templates/web/zurich/admin/contact-form.html b/templates/web/zurich/admin/contact-form.html
index aaf7a1797..236b169d0 100644
--- a/templates/web/zurich/admin/contact-form.html
+++ b/templates/web/zurich/admin/contact-form.html
@@ -1,5 +1,5 @@
<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" id="category_edit">
- <p><strong>[% loc('Category:') %] </strong>[% contact.category | html %]
+ <p><strong>[% loc('Category:') %] </strong>[% contact.category_display | html %]
<input type="hidden" name="category" value="[% contact.category | html %]" >
<input type="hidden" name="token" value="[% csrf_token %]" >
diff --git a/templates/web/zurich/admin/problem_row.html b/templates/web/zurich/admin/problem_row.html
index acbf17017..a83e22b27 100644
--- a/templates/web/zurich/admin/problem_row.html
+++ b/templates/web/zurich/admin/problem_row.html
@@ -15,7 +15,7 @@
[% END %]
</td>
<td>[% PROCESS value_or_nbsp value=problem.title %]</td>
- <td>[% PROCESS value_or_nbsp value=problem.category %]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.category_display %]</td>
<td>[% PROCESS format_date this_date=problem.created %]</td>
<td>[% PROCESS format_date this_date=problem.lastupdate %]</td>
<td> [% states.${problem.state} %][% IF problem.state == 'planned';
diff --git a/templates/web/zurich/admin/report_edit-sdm.html b/templates/web/zurich/admin/report_edit-sdm.html
index 3df9459f9..07f0332d5 100644
--- a/templates/web/zurich/admin/report_edit-sdm.html
+++ b/templates/web/zurich/admin/report_edit-sdm.html
@@ -70,7 +70,7 @@
</dd>
<dt>[% loc('Category:') %] <!-- Kategorie --></dt>
- <dd>[% problem.category | html %]</dd>
+ <dd>[% problem.category_display | html %]</dd>
<dt class="print-only">[% loc('State:') %] <!-- Status --></dt>
<dd class="print-only">[% states.${problem.state} %]</dd>
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index f87dcb5cf..35075a9f0 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -98,7 +98,7 @@
</dd>
<dt>[% loc('Category:') %] <!-- Kategorie --></dt>
- <dd>[% problem.category | html %]</dd>
+ <dd>[% problem.category_display | html %]</dd>
<dt class="print-only">[% loc('State:') %] <!-- Status --></dt>
<dd class="print-only">[% states_trans.${problem.state} %]</dd>
@@ -169,8 +169,8 @@
<label for="category">[% loc('Assign to different category:') %]</label>
<select class="form-control" name="category" id="category">
<option value="">--</option>
- [% FOREACH cat IN categories %]
- <option value="[% cat %]">[% cat %]</option>
+ [% FOREACH cat IN category_options %]
+ <option value="[% cat.name %]">[% cat.value %]</option>
[% END %]
</select>
</div>
diff --git a/templates/web/zurich/report/_main.html b/templates/web/zurich/report/_main.html
index c1e4d15e6..b868c03e2 100644
--- a/templates/web/zurich/report/_main.html
+++ b/templates/web/zurich/report/_main.html
@@ -1,5 +1,5 @@
<div class="problem-header clearfix">
- <h1>[% tprintf( loc('Reported in the %s category'), problem.category ) %]</h1>
+ <h1>[% tprintf( loc('Reported in the %s category'), problem.category_display ) %]</h1>
<p class="sub">
[% prettify_dt( problem.created, 'zurich' ) %]
[%- IF !problem.used_map %]<br>[% loc('there is no pin shown as the user did not use the map') %][% END %]