admin: use spinner-button for modal forms
This commit is contained in:
parent
7d296b2119
commit
74d240dfd4
|
@ -27,7 +27,9 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<footer class="pf-c-modal-box__footer">
|
<footer class="pf-c-modal-box__footer">
|
||||||
<input class="pf-c-button pf-m-primary" type="submit" form="main-form" value="{% block action %}{% endblock %}" />
|
<ak-spinner-button form="main-form">
|
||||||
|
{% block action %}{% endblock %}
|
||||||
|
</ak-spinner-button>
|
||||||
<a class="pf-c-button pf-m-secondary" href="{% back %}">{% trans "Cancel" %}</a>
|
<a class="pf-c-button pf-m-secondary" href="{% back %}">{% trans "Cancel" %}</a>
|
||||||
</footer>
|
</footer>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
{% extends "base/skeleton.html" %}
|
|
||||||
|
|
||||||
{% load i18n %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<ak-message-container></ak-message-container>
|
|
||||||
<div class="pf-c-page">
|
|
||||||
<a class="pf-c-skip-to-content pf-c-button pf-m-primary" href="#main-content">{% trans 'Skip to content' %}</a>
|
|
||||||
{% block page_content %}
|
|
||||||
{% endblock %}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends 'base/page.html' %}
|
{% extends 'base/skeleton.html' %}
|
||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load authentik_utils %}
|
{% load authentik_utils %}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
{% extends "base/page.html" %}
|
|
||||||
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load authentik_utils %}
|
{% load authentik_utils %}
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<div class="pf-c-card">
|
<div class="pf-c-card">
|
||||||
<div class="pf-c-card__header pf-c-title pf-m-md">
|
<div class="pf-c-card__header pf-c-title pf-m-md">
|
||||||
{% trans 'Reset your password' %}
|
{% trans 'Reset your password' %}
|
||||||
|
@ -14,4 +11,3 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ export class SpinnerButton extends LitElement {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.form) {
|
if (this.form) {
|
||||||
// Because safari we can't just extend HTMLButtonElement, hence I have to implement
|
// Since the form= attribute is only used within a modal button,
|
||||||
// these attributes by myself here, sigh...
|
// we can assume the form is always two levels up
|
||||||
document.querySelector<HTMLFormElement>(`#${this.form}`)?.submit();
|
this.parentElement?.parentElement?.querySelector < HTMLFormElement>(`#${this.form}`)?.dispatchEvent(new Event("submit"));
|
||||||
}
|
}
|
||||||
this.setLoading();
|
this.setLoading();
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue