diff options
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r-- | templates/web/base/admin/bodies.html | 6 | ||||
-rw-r--r-- | templates/web/base/admin/body-form.html | 6 | ||||
-rw-r--r-- | templates/web/base/admin/body.html | 6 | ||||
-rw-r--r-- | templates/web/base/admin/index.html | 26 | ||||
-rw-r--r-- | templates/web/base/admin/user-form.html | 11 |
5 files changed, 41 insertions, 14 deletions
diff --git a/templates/web/base/admin/bodies.html b/templates/web/base/admin/bodies.html index 4c95423c0..e98e2d350 100644 --- a/templates/web/base/admin/bodies.html +++ b/templates/web/base/admin/bodies.html @@ -1,5 +1,9 @@ [% INCLUDE 'admin/header.html' title=loc('Bodies') -%] +[% IF body_errors.size %] + <p class="error">[% loc('Please correct the errors below') %]</p> +[% END %] + [% IF bodies.size == 0 %] <p class="fms-admin-info"> [% loc('Currently no bodies have been created.') %] @@ -69,7 +73,7 @@ </table> [% END %] -[% IF c.cobrand.moniker != 'zurich' OR admin_type == 'super' %] +[% IF (c.cobrand.moniker == 'zurich' AND admin_type == 'super') OR c.user.is_superuser %] <div class="admin-box"> <h2>[% loc('Add body') %]</h2> [% INCLUDE 'admin/body-form.html', body='' %] diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html index 8c4956f7f..13e688097 100644 --- a/templates/web/base/admin/body-form.html +++ b/templates/web/base/admin/body-form.html @@ -6,6 +6,12 @@ categories of problem) to each body." ) %] </div> + + [% IF body_errors.name %] + <div class="fms-admin-warning"> + [% body_errors.name %] + </div> + [% END %] <div class="admin-hint"> <p> [% loc( diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html index 15802fc44..a00c5ca4c 100644 --- a/templates/web/base/admin/body.html +++ b/templates/web/base/admin/body.html @@ -7,6 +7,10 @@ </p> [% END %] +[% IF body_errors.size %] + <p class="error">[% loc('Please correct the errors below') %]</p> +[% END %] + [% IF NOT errors %] <p> @@ -213,7 +217,7 @@ </form> </div> -[% IF NOT errors %] +[% IF NOT errors and c.user.is_superuser %] <div class="admin-box"> <h2>[% loc('Edit body details') %]</h2> [% INCLUDE 'admin/body-form.html' %] diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html index 3c510471e..beb4dad7f 100644 --- a/templates/web/base/admin/index.html +++ b/templates/web/base/admin/index.html @@ -30,19 +30,21 @@ and to receive notices of updates. <input type="text" name="search" size="30" id="search_users" value="[% searched | html %]"> </form> -<form method="get" action="[% c.uri_for('bodies') %]"> -<label for="search_body">[% loc('Edit body details') %]</label> -<select id="search_body" name="body"> -[% FOREACH body IN bodies %] - [%- SET id = body.id %] - <option[% IF body.deleted %] class="adminhidden"[% END %] value="[% body.id %]"> - [% body.name | html %] - [%- IF body.parent %], [% body.parent.name | html %][% END -%] - </option> +[% IF c.user.is_superuser %] + <form method="get" action="[% c.uri_for('bodies') %]"> + <label for="search_body">[% loc('Edit body details') %]</label> + <select id="search_body" name="body"> + [% FOREACH body IN bodies %] + [%- SET id = body.id %] + <option[% IF body.deleted %] class="adminhidden"[% END %] value="[% body.id %]"> + [% body.name | html %] + [%- IF body.parent %], [% body.parent.name | html %][% END -%] + </option> + [% END %] + </select> + <input type="submit" value="[% loc('Go') %]"> + </form> [% END %] -</select> -<input type="submit" value="[% loc('Go') %]"> -</form> [% IF unsent_reports.size %] <h2>[% loc('Reports waiting to be sent') %]</h2> diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html index d6456f3d9..2942494a7 100644 --- a/templates/web/base/admin/user-form.html +++ b/templates/web/base/admin/user-form.html @@ -55,6 +55,17 @@ [% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]> </li> + + [% IF c.user.is_superuser %] + <li> + <div class="admin-hint"> + <p> + [% loc("Superusers have permission to perform <strong>all actions</strong> within the admin.") %] + </p> + </div> + [% loc('Superuser:') %] <input type="checkbox" id="is_superuser" name="is_superuser"[% user.is_superuser ? ' checked' : '' %]> + </li> + [% END %] [% END %] </ul> <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" > |