Skip to content

Commit 7f85491

Browse files
frjowes-otf
andcommitted
Update hypha/apply/users/templates/users/partials/list.html
Co-authored-by: Wes Appler <145372368+wes-otf@users.noreply.github.com>
1 parent 61b01e7 commit 7f85491

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • hypha/apply/users/templates/users/partials

hypha/apply/users/templates/users/partials/list.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<li class="flex gap-2 items-center p-2 rounded border bg-base-100">
77
{% heroicon_micro "key" class="size-4 text-fg-muted" aria_hidden=true %}
88
<form
9-
x-data="{ dirty: false }"
9+
x-data="{ pkcurrent: '{{ passkey.name }}', pkinput: '{{ passkey.name }}' }"
1010
hx-post="{% url 'users:passkey_rename' passkey.pk %}"
1111
hx-target="#passkey-list"
1212
hx-swap="outerHTML"
@@ -16,14 +16,13 @@
1616
<input
1717
type="text"
1818
name="name"
19-
value="{{ passkey.name }}"
19+
x-model="pkinput"
2020
class="flex-1 input input-xs input-ghost"
2121
aria-label="{% trans 'Passkey name' %}"
2222
data-tippy-content="{% trans 'Click to edit name' %}"
23-
@input="dirty = true"
2423
required
2524
/>
26-
<button type="submit" class="btn btn-ghost btn-xs" :class="dirty && 'text-success'" title="{% trans 'Save name' %}">
25+
<button type="submit" class="btn btn-ghost btn-xs text-success" :class="pkcurrent == pkinput && 'btn-disabled invisible'" title="{% trans 'Save name' %}">
2726
{% heroicon_micro "check" class="size-4" aria_hidden=true %}
2827
</button>
2928
</form>

0 commit comments

Comments
 (0)