diff --git a/src/newsreader/accounts/templates/accounts/components/login-form.html b/src/newsreader/accounts/templates/accounts/components/login-form.html index d1c8dae..d09974a 100644 --- a/src/newsreader/accounts/templates/accounts/components/login-form.html +++ b/src/newsreader/accounts/templates/accounts/components/login-form.html @@ -4,17 +4,8 @@ {% block actions %}
- {% if cancel_url %} - {% trans "Cancel" %} - {% endif %} - - + {% include "components/form/cancel-button.html" %} + {% include "components/form/confirm-button.html" %}
diff --git a/src/newsreader/accounts/templates/accounts/components/settings-form.html b/src/newsreader/accounts/templates/accounts/components/settings-form.html index cc7620b..ff06cb7 100644 --- a/src/newsreader/accounts/templates/accounts/components/settings-form.html +++ b/src/newsreader/accounts/templates/accounts/components/settings-form.html @@ -4,9 +4,7 @@ {% block actions %}
- {% if cancel_url %} - {% trans "Cancel" %} - {% endif %} + {% include "components/form/cancel-button.html" %}
@@ -14,13 +12,7 @@ {% trans "Change password" %} - + {% include "components/form/confirm-button.html" %}
{% endblock actions %} diff --git a/src/newsreader/accounts/templates/accounts/views/password-change.html b/src/newsreader/accounts/templates/accounts/views/password-change.html index 5f7b852..fb8a98b 100644 --- a/src/newsreader/accounts/templates/accounts/views/password-change.html +++ b/src/newsreader/accounts/templates/accounts/views/password-change.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -
+
{% 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 %}
diff --git a/src/newsreader/templates/components/form/cancel-button.html b/src/newsreader/templates/components/form/cancel-button.html new file mode 100644 index 0000000..0891136 --- /dev/null +++ b/src/newsreader/templates/components/form/cancel-button.html @@ -0,0 +1,5 @@ +{% load i18n %} + +{% if cancel_url %} + {% trans "Cancel" %} +{% endif %} diff --git a/src/newsreader/templates/components/form/confirm-button.html b/src/newsreader/templates/components/form/confirm-button.html new file mode 100644 index 0000000..e18b560 --- /dev/null +++ b/src/newsreader/templates/components/form/confirm-button.html @@ -0,0 +1,9 @@ +{% load i18n %} + + diff --git a/src/newsreader/templates/components/form/form.html b/src/newsreader/templates/components/form/form.html index 6e15956..3c729ae 100644 --- a/src/newsreader/templates/components/form/form.html +++ b/src/newsreader/templates/components/form/form.html @@ -34,21 +34,11 @@
{% endblock fields %} - {% block actions %}
- {% if cancel_url %} - {% trans "Cancel" %} - {% endif %} - - + {% include "components/form/cancel-button.html" %} + {% include "components/form/confirm-button.html" %}
{% endblock actions %}