Skip to content

Commit

Permalink
Add 'delete username' button to change pw dialog (#3037)
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Aug 22, 2022
1 parent af37a39 commit 9335625
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<div class="modal-footer">
{% button class="btn btn-default" text=_"Cancel" action={dialog_close} tag="a" %}
{% button class="btn btn-primary" text=_"Delete" action={delete_username id=id on_success=on_success} action={dialog_close} %}
{% button class="btn btn-danger" text=_"Delete Username" action={delete_username id=id on_success=on_success} action={dialog_close} %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
</p>
{% else %}
<p>
{_ Enter a (unique) username and password. Usernames and passwords are case sensitive, so be careful when entering them. _}
{% if username %}
{_ Click “delete” to remove any existing username/password from the person; this person will no longer be a user. _}
{% endif %}
</p>
{% wire id=#form type="submit" postback="set_username_password" delegate=delegate %}
<form id="{{ #form }}" method="POST" action="postback" class="form form-horizontal">
<input type="hidden" name="id" value="{{ id }}" />
Expand All @@ -20,6 +13,10 @@
<div class="modal-footer">
{% button class="btn btn-default" action={dialog_close} text=_"Cancel" tag="a" %}
<button class="btn btn-primary" type="submit">{_ Save _}</button>
{% if id /= 1 %}
{% button class="btn btn-danger pull-left" text=_"Delete Username" action={dialog_delete_username id=id} %}
{% endif %}
</div>
</form>
{% endif %}
12 changes: 6 additions & 6 deletions modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

{% if id /= 1 %}
<div>
{% button class="btn btn-default" text=_"delete username" action={dialog_delete_username id=id on_success={slide_fade_out target=#tr.id}} %}
</div>
{% endif %}
</div>
</div>
{% endif %}
{% button class="btn btn-default" text=_"Delete Username" action={dialog_delete_username id=id on_success={slide_fade_out target=#tr.id}} %}
</div>
{% endif %}
</div>
</div>
{% endif %}

{% all include "_admin_edit_basics_user_extra.tpl" %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="form-group row">
<label class="control-label col-md-3" for="new_password">{_ Password _}</label>
<div class="col-md-9">
<input class="form-control" type="password" id="new_password" name="new_password" value="{{ password|escape }}" autocomplete="new-password" />
<input class="form-control" type="password" id="new_password" name="new_password" value="{{ password|escape }}" autocomplete="one-time-code" />
{% if m.config.mod_admin_identity.password_regex.value %}
{% validate id="new_password" type={presence} type={format pattern=m.config.mod_admin_identity.password_regex.value failure_message=_"This password does not meet the security requirements"} %}
{% else %}
Expand Down
15 changes: 9 additions & 6 deletions modules/mod_admin_identity/templates/admin_users.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@
<tr>
<th width="20%">{_ Name _}</th>
<th width="20%">{_ Username _}</th>
<th width="15%">{_ Last logon _}</th>
<th width="15%">{_ Created on _}</th>
<th width="25%">{_ Modified on _}</th>
<th></th>
<th>{_ Last logon _}</th>
<th>{_ Created on _}</th>
<th>{_ Modified on _}</th>
<th></th>
</tr>
</thead>

Expand All @@ -68,10 +70,11 @@
{% if id == me %} <strong>{_ (that's you) _}</strong>{% endif %}
{% endif %}
</td>
<td>{{ user_info.visited|date:_"d M Y, H:i" }}</td>
<td>{{ id.created|date:_"d M Y, H:i" }}</td>
<td>{% all include "_admin_user_info.tpl" id=id %}</td>
<td>{{ user_info.visited|date:_"Y-m-d" }}</td>
<td>{{ id.created|date:_"Y-m-d" }}</td>
<td>{{ id.modified|date:_"Y-m-d" }}</td>
<td>
{{ id.modified|date:_"d M Y, H:i" }}
<div class="pull-right buttons">
{% if is_users_editable %}
{% button class="btn btn-default btn-xs" action={dialog_set_username_password id=id} text=_"set username / password" on_delete={slide_fade_out target=#tr.id} %}
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ msgid "d M, H:i"
msgstr ""

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "borrar usuario"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/et.po
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ msgid "d M, H:i"
msgstr ""

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "kustuta kasutajanimi"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ msgid "d M Y, H:i"
msgstr "d M Y, H:i"

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "Verwijder gebruikersnaam"

#: modules/mod_admin_identity/templates/admin_users.tpl:74
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/pl.po
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ msgid "d M, H:i"
msgstr ""

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "skasuj login"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ msgid "d M, H:i"
msgstr ""

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "удалить учетную запись"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ msgid "d M, H:i"
msgstr ""

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "kullanıcı adını sil"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/translations/zh.po
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ msgid "d M, H:i"
msgstr "M d, H:i"

#: modules/mod_admin_identity/templates/_admin_edit_basics_user.tpl:20
msgid "delete username"
msgid
msgstr "删除用户名"

#: modules/mod_admin_identity/templates/admin_users.tpl:73
Expand Down
5 changes: 5 additions & 0 deletions modules/mod_auth2fa/templates/_admin_user_info.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if m.auth2fa[id].is_totp_enabled %}
<span class="label label-success" title="{_ Two-factor authentication is enabled _}">√ {_ 2FA _}</span>
{% else %}
<span class="label label-danger" title=="{_ Two-factor authentication is not enabled _}">&times; {_ 2FA _}</span>
{% endif %}

0 comments on commit 9335625

Please sign in to comment.