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 %}
|
||||
<section class="section form__section--last">
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
{% if cancel_url %}
|
||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
|
||||
<button class="button button--confirm">
|
||||
{% if confirm_text %}
|
||||
{{ confirm_text }}
|
||||
{% else %}
|
||||
{% trans "Save" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
{% include "components/form/cancel-button.html" %}
|
||||
{% include "components/form/confirm-button.html" %}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
{% block actions %}
|
||||
<section class="section form__section--last">
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
{% if cancel_url %}
|
||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
{% include "components/form/cancel-button.html" %}
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
|
|
@ -14,13 +12,7 @@
|
|||
{% trans "Change password" %}
|
||||
</a>
|
||||
|
||||
<button class="button button--confirm">
|
||||
{% if confirm_text %}
|
||||
{{ confirm_text }}
|
||||
{% else %}
|
||||
{% trans "Save" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
{% include "components/form/confirm-button.html" %}
|
||||
</fieldset>
|
||||
</section>
|
||||
{% endblock actions %}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<main class="main">
|
||||
<main id="password-change--page" class="main">
|
||||
{% 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 %}
|
||||
</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>
|
||||
{% endblock fields %}
|
||||
|
||||
|
||||
{% block actions %}
|
||||
<section class="section form__section--last">
|
||||
<fieldset class="fieldset form__fieldset">
|
||||
{% if cancel_url %}
|
||||
<a class="link button button--cancel" href="{{ cancel_url }}">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
|
||||
<button class="button button--confirm">
|
||||
{% if confirm_text %}
|
||||
{{ confirm_text }}
|
||||
{% else %}
|
||||
{% trans "Save" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
{% include "components/form/cancel-button.html" %}
|
||||
{% include "components/form/confirm-button.html" %}
|
||||
</fieldset>
|
||||
</section>
|
||||
{% endblock actions %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue