Split confirm/cancel buttons into components
This commit is contained in:
parent
b2eaf0411f
commit
ae56d6d76b
6 changed files with 21 additions and 34 deletions
|
|
@ -4,17 +4,8 @@
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
<section class="section form__section--last">
|
<section class="section form__section--last">
|
||||||
<fieldset class="fieldset form__fieldset">
|
<fieldset class="fieldset form__fieldset">
|
||||||
{% if cancel_url %}
|
{% include "components/form/cancel-button.html" %}
|
||||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
{% include "components/form/confirm-button.html" %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<button class="button button--confirm">
|
|
||||||
{% if confirm_text %}
|
|
||||||
{{ confirm_text }}
|
|
||||||
{% else %}
|
|
||||||
{% trans "Save" %}
|
|
||||||
{% endif %}
|
|
||||||
</button>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="fieldset form__fieldset">
|
<fieldset class="fieldset form__fieldset">
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
<section class="section form__section--last">
|
<section class="section form__section--last">
|
||||||
<fieldset class="fieldset form__fieldset">
|
<fieldset class="fieldset form__fieldset">
|
||||||
{% if cancel_url %}
|
{% include "components/form/cancel-button.html" %}
|
||||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
|
||||||
{% endif %}
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="fieldset form__fieldset">
|
<fieldset class="fieldset form__fieldset">
|
||||||
|
|
@ -14,13 +12,7 @@
|
||||||
{% trans "Change password" %}
|
{% trans "Change password" %}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button class="button button--confirm">
|
{% include "components/form/confirm-button.html" %}
|
||||||
{% if confirm_text %}
|
|
||||||
{{ confirm_text }}
|
|
||||||
{% else %}
|
|
||||||
{% trans "Save" %}
|
|
||||||
{% endif %}
|
|
||||||
</button>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</section>
|
</section>
|
||||||
{% endblock actions %}
|
{% endblock actions %}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main class="main">
|
<main id="password-change--page" class="main">
|
||||||
{% url 'accounts:settings' as cancel_url %}
|
{% url 'accounts:settings' as cancel_url %}
|
||||||
{% include "components/form/form.html" with form=form title="Change password" confirm_text="Change password" cancel_url=cancel_url %}
|
{% include "components/form/form.html" with form=form title="Change password" confirm_text="Change password" cancel_url=cancel_url %}
|
||||||
</main>
|
</main>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% if cancel_url %}
|
||||||
|
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
||||||
|
{% endif %}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<button class="button button--confirm">
|
||||||
|
{% if confirm_text %}
|
||||||
|
{{ confirm_text }}
|
||||||
|
{% else %}
|
||||||
|
{% trans "Save" %}
|
||||||
|
{% endif %}
|
||||||
|
</button>
|
||||||
|
|
@ -34,21 +34,11 @@
|
||||||
</section>
|
</section>
|
||||||
{% endblock fields %}
|
{% endblock fields %}
|
||||||
|
|
||||||
|
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
<section class="section form__section--last">
|
<section class="section form__section--last">
|
||||||
<fieldset class="fieldset form__fieldset">
|
<fieldset class="fieldset form__fieldset">
|
||||||
{% if cancel_url %}
|
{% include "components/form/cancel-button.html" %}
|
||||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
{% include "components/form/confirm-button.html" %}
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<button class="button button--confirm">
|
|
||||||
{% if confirm_text %}
|
|
||||||
{{ confirm_text }}
|
|
||||||
{% else %}
|
|
||||||
{% trans "Save" %}
|
|
||||||
{% endif %}
|
|
||||||
</button>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</section>
|
</section>
|
||||||
{% endblock actions %}
|
{% endblock actions %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue