Merge branch 'Aufinal/form_display' into 'master'

Tweaks pour les templates

See merge request klub-dev-ens/authens!14
This commit is contained in:
Martin Pepin 2020-06-28 23:05:17 +02:00
commit da363f0df0
9 changed files with 68 additions and 50 deletions

View file

@ -35,16 +35,18 @@ h2 {
color: white; color: white;
} }
/* TODO: https://git.eleves.ens.fr/klub-dev-ens/authens/issues/9 */
.oldcas { .oldcas {
background: #CB6318; background: #CB6318;
color: white; color: white;
} }
form { #container-content {
padding: 0.5em;
text-align: center; text-align: center;
width: 100%; width: 100%;
}
.auth_form {
padding: 0.5em;
font-size: 1.5em; font-size: 1.5em;
} }
@ -58,12 +60,20 @@ form {
text-align: center; text-align: center;
} }
form table { ul.errorlist {
text-align: left;
font-size: 0.8em;
padding-left: 20px;
}
.auth_form table {
margin: 20px auto; margin: 20px auto;
border-spacing: 0.3em; border-spacing: 0.3em;
} }
th { th {
padding: 5px 0;
vertical-align: text-top;
text-align: right; text-align: right;
} }
@ -74,6 +84,8 @@ input {
input[type="text"], input[type="password"] { input[type="text"], input[type="password"] {
border: 0; border: 0;
padding: 5px; padding: 5px;
width: 100%;
max-width: 390px;
} }
input[type="submit"] { input[type="submit"] {
@ -95,7 +107,7 @@ select {
font-size: 1em; font-size: 1em;
background-color: white; background-color: white;
width: 100%; width: 100%;
padding:5px; max-width: 400px;
text-align: end; text-align: end;
} }

View file

@ -0,0 +1,4 @@
<tr>
<th>{{ field.label_tag }}</th>
<td>{{ field }}</td>
</tr>

View file

@ -15,6 +15,9 @@
</head> </head>
<body> <body>
<div id="container"> <div id="container">
{% block container-top %}
<h2>{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% block container-title %}{% endblock %}</h2>
{% endblock %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</body> </body>

View file

@ -0,0 +1,4 @@
<tr>
<th>{{ field.label_tag }}</th>
<td>{{ field }} {{ field.errors }}</td>
</tr>

View file

@ -0,0 +1,14 @@
{% load i18n %}
{% for error in form.non_field_errors %}
<p class="error">{{ error }}</p>
{% endfor %}
<div class="auth_form">
<form action="" method="post">
{% csrf_token %}
{% include "authens/form_snippet.html" %}
<input type="submit" value="{% trans submit_text %}">
</form>
</div>

View file

@ -0,0 +1,7 @@
<table>
<tbody>
{% for field in form %}
{% include 'authens/form_field_snippet.html' with field=field %}
{% endfor %}
</tbody>
</table>

View file

@ -1,8 +1,11 @@
{% extends "authens/base.html" %} {% extends "authens/base.html" %}
{% load i18n %} {% load i18n %}
{% block container-title %}
{% trans "Mode de connexion" %}
{% endblock %}
{% block content %} {% block content %}
<h2>{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Mode de connexion" %}</h2>
<a href="{% url "authens:login.cas" %}?next={{ next| urlencode }}"> <a href="{% url "authens:login.cas" %}?next={{ next| urlencode }}">
<div class="big-button cas"> <div class="big-button cas">
{% trans "Clipper" %} {% trans "Clipper" %}

View file

@ -1,27 +1,12 @@
{% extends "authens/base.html" %} {% extends "authens/base.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block container-title %}
<h2>{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Connexion vieilleux" %}</h2> {% trans "Connexion vieilleux" %}
{% if form.errors %}
<p class="error">{% trans "Login CAS, promotion et/ou mot de passe incorrect" %}</p>
{% endif %}
<form class="oldcas" method="post" action="">
{% csrf_token %}
<table>
<tbody>
{% for field in form %}
<tr>
<th>{{ field.label_tag }}</th>
<td>{{ field }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type="submit" value="{% trans "Se connecter" %}">
<input type="hidden" name="next" value="{{ next }}">
</form>
{% endblock %} {% endblock %}
{% block content %}
<div id="container-content" class="oldcas">
{% include "authens/form_full_snippet.html" with submit_text="Se connecter" %}
</div>
{% endblock %}

View file

@ -1,26 +1,12 @@
{% extends "authens/base.html" %} {% extends "authens/base.html" %}
{% load i18n %} {% load i18n %}
{% block content %} {% block container-title %}
<h2>{% if request.site.name %}{{ request.site.name }}{% else %}AuthENS{% endif %} - {% trans "Connexion par mot de passe" %}</h2> {% trans "Connexion par mot de passe" %}
{% endblock %}
{% if form.errors %}
<p class="error">{% trans "Nom d'utilisateur et/ou mot de passe incorrect" %}</p> {% block content %}
{% endif %} <div id="container-content" class="exte">
{% include "authens/form_full_snippet.html" with submit_text="Se connecter" %}
<form class="exte" method="post" action="{% url 'authens:login.pwd' %}"> </div>
{% csrf_token %}
<table>
<tbody>
{% for field in form %}
<tr>
<th>{{ field.label_tag }}</th>
<td>{{ field }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type="submit" value="{% trans "Se connecter" %}">
<input type="hidden" name="next" value="{{ next }}">
</form>
{% endblock %} {% endblock %}