diff --git a/src/newsreader/accounts/templates/accounts/views/login.html b/src/newsreader/accounts/templates/accounts/views/login.html index ab308b2..6c73a1c 100644 --- a/src/newsreader/accounts/templates/accounts/views/login.html +++ b/src/newsreader/accounts/templates/accounts/views/login.html @@ -4,21 +4,6 @@ {% block content %}
-
- {% csrf_token %} -
-

Login

-
- - - -
+ {% include "form/login-form.html" with form=form title="Login" confirm_text="Login" %}
{% endblock %} diff --git a/src/newsreader/scss/components/form/_login-form.scss b/src/newsreader/scss/components/form/_login-form.scss deleted file mode 100644 index 10e81a0..0000000 --- a/src/newsreader/scss/components/form/_login-form.scss +++ /dev/null @@ -1,33 +0,0 @@ -.login-form { - @extend .form; - - width: 100%; - - h4 { - margin: 0; - padding: 20px 24px 5px 24px; - } - - &__fieldset { - @extend .form__fieldset; - - & label { - @extend .label; - } - - & input { - @extend .input; - } - } - - &__fieldset:last-child { - flex-direction: row-reverse; - justify-content: space-between; - } - - &__fieldset:last-child { - .button { - padding: 10px 50px; - } - } -} diff --git a/src/newsreader/scss/components/form/index.scss b/src/newsreader/scss/components/form/index.scss index 1555ae9..7457a70 100644 --- a/src/newsreader/scss/components/form/index.scss +++ b/src/newsreader/scss/components/form/index.scss @@ -5,7 +5,6 @@ @import "rules-form"; @import "import-form"; -@import "login-form"; @import "activation-form"; @import "register-form"; diff --git a/src/newsreader/scss/pages/login/index.scss b/src/newsreader/scss/pages/login/index.scss index 69b946e..82b9457 100644 --- a/src/newsreader/scss/pages/login/index.scss +++ b/src/newsreader/scss/pages/login/index.scss @@ -3,4 +3,29 @@ width: 50%; border-radius: 4px; + + & .form { + @extend .form; + + width: 100%; + + h4 { + margin: 0; + padding: 20px 24px 5px 24px; + } + + &__section { + &--last { + flex-direction: row-reverse; + justify-content: space-between; + } + } + + &__fieldset { + @extend .form__fieldset; + + &--last { + } + } + } } diff --git a/src/newsreader/templates/form/form.html b/src/newsreader/templates/form/form.html index 5907df5..ac8beea 100644 --- a/src/newsreader/templates/form/form.html +++ b/src/newsreader/templates/form/form.html @@ -11,31 +11,42 @@ {% include "form/title.html" with title=title only %} {% endif %} -
- {% for field in form.hidden_fields %} - {{ field }} - {% endfor %} - - {% for field in form.visible_fields %} -
- - - {{ field.errors }} + {% block fields %} +
+ {% for field in form.hidden_fields %} {{ field }} - {{ field.help_text }} + {% endfor %} + + {% for field in form.visible_fields %} +
+ + + {{ field.errors }} + {{ field }} + {{ field.help_text }} +
+ {% endfor %} +
+ {% endblock fields %} + + + {% block actions %} +
+
+ {% if cancel_url %} + {% trans "Cancel" %} + {% endif %} + +
- {% endfor %} -
- -
-
- {% if cancel_url %} - {% trans "Cancel" %} - {% endif %} - - -
-
+
+ {% endblock actions %} diff --git a/src/newsreader/templates/form/login-form.html b/src/newsreader/templates/form/login-form.html new file mode 100644 index 0000000..6f920c0 --- /dev/null +++ b/src/newsreader/templates/form/login-form.html @@ -0,0 +1,27 @@ +{% extends "form/form.html" %} + +{% load i18n %} + +{% block actions %} +
+
+ {% if cancel_url %} + {% trans "Cancel" %} + {% endif %} + + +
+ +
+ + I forgot my password + +
+
+{% endblock actions %}