diff --git a/authens/static/authens/css/authens.css b/authens/static/authens/css/authens.css index 89c5eea..4cedbc5 100644 --- a/authens/static/authens/css/authens.css +++ b/authens/static/authens/css/authens.css @@ -35,16 +35,18 @@ h2 { color: white; } -/* TODO: https://git.eleves.ens.fr/klub-dev-ens/authens/issues/9 */ .oldcas { background: #CB6318; color: white; } -form { - padding: 0.5em; +#container-content { text-align: center; width: 100%; +} + +.auth_form { + padding: 0.5em; font-size: 1.5em; } @@ -58,12 +60,20 @@ form { text-align: center; } -form table { +ul.errorlist { + text-align: left; + font-size: 0.8em; + padding-left: 20px; +} + +.auth_form table { margin: 20px auto; border-spacing: 0.3em; } th { + padding: 5px 0; + vertical-align: text-top; text-align: right; } @@ -74,6 +84,8 @@ input { input[type="text"], input[type="password"] { border: 0; padding: 5px; + width: 100%; + max-width: 390px; } input[type="submit"] { @@ -95,7 +107,7 @@ select { font-size: 1em; background-color: white; width: 100%; - padding:5px; + max-width: 400px; text-align: end; } diff --git a/authens/templates/authens/auth_form_field.html b/authens/templates/authens/auth_form_field.html new file mode 100644 index 0000000..ff8fdfb --- /dev/null +++ b/authens/templates/authens/auth_form_field.html @@ -0,0 +1,4 @@ + + {{ field.label_tag }} + {{ field }} + \ No newline at end of file diff --git a/authens/templates/authens/base.html b/authens/templates/authens/base.html index f8714d5..19642fd 100644 --- a/authens/templates/authens/base.html +++ b/authens/templates/authens/base.html @@ -15,6 +15,9 @@
+ {% block container-top %} +

{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% block container-title %}{% endblock %}

+ {% endblock %} {% block content %}{% endblock %}
diff --git a/authens/templates/authens/form_field_snippet.html b/authens/templates/authens/form_field_snippet.html new file mode 100644 index 0000000..08a3bb0 --- /dev/null +++ b/authens/templates/authens/form_field_snippet.html @@ -0,0 +1,4 @@ + + {{ field.label_tag }} + {{ field }} {{ field.errors }} + \ No newline at end of file diff --git a/authens/templates/authens/form_full_snippet.html b/authens/templates/authens/form_full_snippet.html new file mode 100644 index 0000000..c09e407 --- /dev/null +++ b/authens/templates/authens/form_full_snippet.html @@ -0,0 +1,14 @@ +{% load i18n %} + +{% for error in form.non_field_errors %} +

{{ error }}

+{% endfor %} + +
+
+ {% csrf_token %} + {% include "authens/form_snippet.html" %} + + +
+
diff --git a/authens/templates/authens/form_snippet.html b/authens/templates/authens/form_snippet.html new file mode 100644 index 0000000..c5ea640 --- /dev/null +++ b/authens/templates/authens/form_snippet.html @@ -0,0 +1,7 @@ + + + {% for field in form %} + {% include 'authens/form_field_snippet.html' with field=field %} + {% endfor %} + +
\ No newline at end of file diff --git a/authens/templates/authens/login_switch.html b/authens/templates/authens/login_switch.html index 08c52fc..a01b8fd 100644 --- a/authens/templates/authens/login_switch.html +++ b/authens/templates/authens/login_switch.html @@ -1,8 +1,11 @@ {% extends "authens/base.html" %} {% load i18n %} +{% block container-title %} +{% trans "Mode de connexion" %} +{% endblock %} + {% block content %} -

{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Mode de connexion" %}

{% trans "Clipper" %} diff --git a/authens/templates/authens/old_cas_login.html b/authens/templates/authens/old_cas_login.html index 2e790f9..deb6e8d 100644 --- a/authens/templates/authens/old_cas_login.html +++ b/authens/templates/authens/old_cas_login.html @@ -1,27 +1,12 @@ {% extends "authens/base.html" %} {% load i18n %} -{% block content %} -

{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Connexion vieilleux" %}

- - {% if form.errors %} -

{% trans "Login CAS, promotion et/ou mot de passe incorrect" %}

- {% endif %} - -
- {% csrf_token %} - - - {% for field in form %} - - - - - {% endfor %} - -
{{ field.label_tag }}{{ field }}
- - -
+{% block container-title %} +{% trans "Connexion vieilleux" %} {% endblock %} +{% block content %} +
+ {% include "authens/form_full_snippet.html" with submit_text="Se connecter" %} +
+{% endblock %} diff --git a/authens/templates/authens/pwd_login.html b/authens/templates/authens/pwd_login.html index 94b0321..41e582f 100644 --- a/authens/templates/authens/pwd_login.html +++ b/authens/templates/authens/pwd_login.html @@ -1,26 +1,12 @@ {% extends "authens/base.html" %} {% load i18n %} -{% block content %} -

{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Connexion par mot de passe" %}

- - {% if form.errors %} -

{% trans "Nom d'utilisateur et/ou mot de passe incorrect" %}

- {% endif %} - -
- {% csrf_token %} - - - {% for field in form %} - - - - - {% endfor %} - -
{{ field.label_tag }}{{ field }}
- - -
+{% block container-title %} +{% trans "Connexion par mot de passe" %} +{% endblock %} + +{% block content %} +
+ {% include "authens/form_full_snippet.html" with submit_text="Se connecter" %} +
{% endblock %}