Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 1 | {% extends 'edit.twig' %} |
| 2 | |
| 3 | {% block inner_content %} |
| 4 | {% if result %} |
| 5 | <h4>{{ lang.edit.domain_admin }}</h4> |
| 6 | <br> |
| 7 | <form class="form-horizontal" data-id="editdomainadmin" role="form" method="post" autocomplete="off"> |
| 8 | <input type="hidden" value="0" name="active"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 9 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 10 | <label class="control-label col-sm-2" for="username_new">{{ lang.edit.username }}</label> |
| 11 | <div class="col-sm-10"> |
| 12 | <input class="form-control" type="text" name="username_new" value="{{ domain_admin }}" required onkeyup="this.value = this.value.toLowerCase();" /> |
| 13 | ↳ <kbd>a-z - _ .</kbd> |
| 14 | </div> |
| 15 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 16 | <div class="row mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 17 | <label class="control-label col-sm-2" for="domains">{{ lang.edit.domains }}</label> |
| 18 | <div class="col-sm-10"> |
| 19 | <select data-live-search="true" class="full-width-select" name="domains" multiple required> |
| 20 | {% for domain in result.selected_domains %} |
| 21 | <option selected>{{ domain }}</option> |
| 22 | {% endfor %} |
| 23 | {% for domain in result.unselected_domains %} |
| 24 | <option>{{ domain }}</option> |
| 25 | {% endfor %} |
| 26 | </select> |
| 27 | </div> |
| 28 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 29 | <div class="row mb-2"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 30 | <label class="control-label col-sm-2" for="password">{{ lang.edit.password }} (<a href="#" class="generate_password">{{ lang.edit.generate }}</a>)</label> |
| 31 | <div class="col-sm-10"> |
| 32 | <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="password" placeholder="" autocomplete="new-password"> |
| 33 | </div> |
| 34 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 35 | <div class="row mb-4"> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 36 | <label class="control-label col-sm-2" for="password2">{{ lang.edit.password_repeat }}</label> |
| 37 | <div class="col-sm-10"> |
| 38 | <input type="password" data-pwgen-field="true" class="form-control" name="password2" autocomplete="new-password"> |
| 39 | </div> |
| 40 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 41 | <div class="row mb-2"> |
| 42 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 43 | <div class="form-check"> |
| 44 | <label><input type="checkbox" class="form-check-input" value="1" name="active"{% if result.active == '1' %} checked{% endif %}> {{ lang.edit.active }}</label> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 45 | </div> |
| 46 | </div> |
| 47 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 48 | <div class="row mb-2"> |
| 49 | <div class="offset-sm-2 col-sm-10"> |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame] | 50 | <div class="form-check"> |
| 51 | <label><input type="checkbox" class="form-check-input" value="1" name="disable_tfa"> {{ lang.tfa.disable_tfa }}</label> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 52 | </div> |
| 53 | </div> |
| 54 | </div> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 55 | <div class="row mb-4"> |
| 56 | <div class="offset-sm-2 col-sm-10"> |
| 57 | <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-api-reload-location="/admin" data-id="editdomainadmin" data-item="{{ domain_admin }}" data-api-url='edit/domain-admin' data-api-attr='{}' href="#">{{ lang.edit.save }}</button> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 58 | </div> |
| 59 | </div> |
| 60 | </form> |
| 61 | <form data-id="daacl" class="form-inline well" method="post"> |
| 62 | <div class="row"> |
| 63 | <div class="col-sm-1"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 64 | <p class="text-muted">ACL</p> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 65 | </div> |
| 66 | <div class="col-sm-10"> |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 67 | <select class="mb-2" id="da_acl" name="da_acl" size="10" data-container="body" multiple> |
| 68 | {% for acl, val in da_acls %} |
| 69 | <option value="{{ acl }}"{% if val == 1 %} selected{% endif %}>{{ lang.acl[acl] }}</option> |
| 70 | {% endfor %} |
| 71 | </select> |
| 72 | <button class="btn btn-xs-lg d-block d-sm-inline btn-secondary mb-2" data-action="edit_selected" data-id="daacl" data-item="{{ domain_admin }}" data-api-url='edit/da-acl' data-api-attr='{}' href="#">{{ lang.admin.save }}</button> |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 73 | </div> |
| 74 | </div> |
| 75 | </form> |
| 76 | {% else %} |
| 77 | {{ parent() }} |
| 78 | {% endif %} |
| 79 | {% endblock %} |