diff options
-rw-r--r-- | templates/web/base/admin/users/_form_details.html | 33 | ||||
-rw-r--r-- | templates/web/base/admin/users/form.html | 42 | ||||
-rw-r--r-- | templates/web/zurich/admin/users/form.html | 36 |
3 files changed, 75 insertions, 36 deletions
diff --git a/templates/web/base/admin/users/_form_details.html b/templates/web/base/admin/users/_form_details.html new file mode 100644 index 000000000..e526ceb06 --- /dev/null +++ b/templates/web/base/admin/users/_form_details.html @@ -0,0 +1,33 @@ +<li> + <div class="admin-hint"> + <p> + [% loc( + "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>. + Names are not necessarily unique.") + %] + </p> + </div> + <label for="name">[% loc('Name:') %]</label> + <input type='text' class="form-control" name='name' id='name' value='[% user.name | html %]'> +</li> + +<li><label for="email">[% loc('Email:') %]</label> +<input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'> +[% IF user %] + <input class="btn" type="submit" name="send_login_email" value="[% loc('Send login email') %]"> +[% END %] +</li> + +<li><label class="inline-text" for="email_verified">[% loc('Email verified:') %]</label> +<input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]> + +<li><label for="phone">[% loc('Phone:') %]</label> +<input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li> +<li><label class="inline-text" for="phone_verified">[% loc('Phone verified:') %]</label> +<input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]> + +[% IF username_in_abuse %] +<li> + <p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p> +</li> +[% END %] diff --git a/templates/web/base/admin/users/form.html b/templates/web/base/admin/users/form.html index efe885908..c782b7172 100644 --- a/templates/web/base/admin/users/form.html +++ b/templates/web/base/admin/users/form.html @@ -7,38 +7,9 @@ [% INCLUDE 'errors.html' errors = field_errors.values %] <ul class="no-bullets"> - <li> - <div class="admin-hint"> - <p> - [% loc( - "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>. - Names are not necessarily unique.") - %] - </p> - </div> - <label for="name">[% loc('Name:') %]</label> - <input type='text' class="form-control" name='name' id='name' value='[% user.name | html %]'> - </li> - <li><label for="email">[% loc('Email:') %]</label> - <input type='text' class="form-control" id='email' name='email' value='[% user.email | html %]'> - [% IF user %] - <input class="btn" type="submit" name="send_login_email" value="[% loc('Send login email') %]"> - [% END %] - </li> - <li><label class="inline-text" for="email_verified">[% loc('Email verified:') %]</label> - <input type="checkbox" id="email_verified" name="email_verified" value="1" [% user.email_verified ? ' checked' : '' %]> - <li><label for="phone">[% loc('Phone:') %]</label> - <input type='text' class="form-control" id='phone' name='phone' value='[% user.phone | html %]'></li> - <li><label class="inline-text" for="phone_verified">[% loc('Phone verified:') %]</label> - <input type="checkbox" id="phone_verified" name="phone_verified" value="1" [% user.phone_verified ? ' checked' : '' %]> + [% PROCESS 'admin/users/_form_details.html' %] - [% IF username_in_abuse %] - <li> - <p class="error">[% loc('User in abuse table') %] <input name="unban" type="submit" value="[% loc('Unban') %]"></p> - </li> - [% END %] - - [% IF c.user.is_superuser || c.cobrand.moniker == 'zurich' %] + [% IF c.user.is_superuser %] <li> <div class="admin-hint"> <p> @@ -72,7 +43,7 @@ </li> [% END %] - [% IF areas AND c.cobrand.moniker != 'zurich' %] + [% IF areas %] <li> <div class="admin-hint"> <p> @@ -94,14 +65,14 @@ </li> [% END %] - [% IF contacts AND c.cobrand.moniker != 'zurich'%] + [% IF contacts %] <li class="js-user-categories"> [% INCLUDE 'admin/category-checkboxes.html' hint=loc("Authorised staff users can be associated with the categories in which they operate.") %] </li> [% END %] - [% IF user.from_body AND c.cobrand.moniker != 'zurich' %] + [% IF user.from_body %] <li> <div class="admin-hint"> <p> @@ -116,7 +87,6 @@ </li> [% END %] - [% IF c.cobrand.moniker != 'zurich' %] <li> <div class="admin-hint"> <p> @@ -197,7 +167,7 @@ </fieldset> </li> [% END %] - [% END %] + [% TRY %][% INCLUDE 'admin/users/form-extra-fields.html' %][% CATCH file %][% END %] </ul> <p> diff --git a/templates/web/zurich/admin/users/form.html b/templates/web/zurich/admin/users/form.html new file mode 100644 index 000000000..5182d943e --- /dev/null +++ b/templates/web/zurich/admin/users/form.html @@ -0,0 +1,36 @@ +<form method="post" id="user_edit" action="[% + SET action_end = user.id || 'add'; + c.uri_for_action( 'admin/users/edit', [ action_end ] ) + %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <input type="hidden" name="token" value="[% csrf_token %]" > + <input type="hidden" name="submit" value="1" > + + [% INCLUDE 'errors.html' errors = field_errors.values %] + <ul class="no-bullets"> + [% PROCESS 'admin/users/_form_details.html' %] + + <li> + <label for="body">[% loc('Body:') %]</label> + <select class="form-control" id='body' name='body'> + <option value=''>[% loc('No body') %]</option> + [% FOR body IN bodies %] + <option value="[% body.id %]"[% ' selected data-originally-selected' IF body.id == user.from_body.id %]>[% body.name %]</option> + [% END %] + </select> + </li> + + </ul> + <p> + <input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" > + </p> + + [% IF user AND NOT user.from_body %] + <ul class="no-bullets danger-zone"> + <li><input class="btn-danger" type="submit" name="logout_everywhere" value="[% loc('Log out of all sessions') %]"> + <li><input class="btn-danger" type="submit" name="anon_everywhere" value="[% loc('Make anonymous on all reports and updates') %]"> + <li><input class="btn-danger" type="submit" name="hide_everywhere" value="[% loc('Hide all reports and updates') %]"> + <li><input class="btn-danger" type="submit" name="remove_account" value="[% loc('Remove account details') %]"> + </ul> + [% END %] + +</form> |