summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-03-01 10:44:15 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-24 19:38:57 +0200
commit672685ebd78f1310dbe7428fd57593ac327b03bc (patch)
treeb32de43705cae8ac5e19181394244af95f1c67ca
parentce46ae2b1ce6b4c2217b0f5508ff5914acd9bd6e (diff)
downloadIshtar-672685ebd78f1310dbe7428fd57593ac327b03bc.tar.bz2
Ishtar-672685ebd78f1310dbe7428fd57593ac327b03bc.zip
UI: improve login layout
-rw-r--r--ishtar_common/templates/blocks/bs_field_snippet.html2
-rw-r--r--ishtar_common/templates/registration/login.html19
-rw-r--r--scss/custom.scss4
3 files changed, 11 insertions, 14 deletions
diff --git a/ishtar_common/templates/blocks/bs_field_snippet.html b/ishtar_common/templates/blocks/bs_field_snippet.html
index 43509eefc..b89727327 100644
--- a/ishtar_common/templates/blocks/bs_field_snippet.html
+++ b/ishtar_common/templates/blocks/bs_field_snippet.html
@@ -1,5 +1,5 @@
{% load i18n %}
- <div class="form-group{% if not field.label %} no-label{% endif %} {% if field.field.widget.attrs.cols or force_large_col %}col-lg-12{% else %}col-lg-6{% endif %}{% if field.errors %} is-invalid{% endif %}{% if field.field.required %} required{% endif %}"
+ <div class="form-group{% if not field.label %} no-label{% endif %} {% if field.field.widget.attrs.cols or force_large_col %}col-lg-12{% else %}col-lg-6{% endif %}{% if field.errors %} is-invalid{% endif %}{% if field.field.required %} required{% endif %}{% if force_large_col %} full-width{% endif %}"
data-alt-name="{{field.field.alt_name}}">
{% if field.label %}{{ field.label_tag }}{% endif %}
{% if show_field_number or form.show_field_number %}
diff --git a/ishtar_common/templates/registration/login.html b/ishtar_common/templates/registration/login.html
index 3e82a882f..2be3e4a2c 100644
--- a/ishtar_common/templates/registration/login.html
+++ b/ishtar_common/templates/registration/login.html
@@ -3,8 +3,8 @@
{% block content %}
<div class="row justify-content-center">
- <div class="col-md-6">
- <h4>{%trans "Log in"%}</h4>
+ <div class="col-md-3">
+ <h3 class="text-center">{%trans "Log in"%}</h3>
<form method="post" action=".">{% csrf_token %}
<input type="hidden" name="next" value="{{ next }}" />
{% if form.non_field_errors %}
@@ -16,21 +16,14 @@
{% endfor %}
</div>
{% endif %}
-
+ {% with force_large_col=True %}
{% for field in form %}
- {% if field.errors %}
- <div class="form-group row has-errors text-danger small">
- {{field.errors}}
- </div>
- {% endif %}
- <div class="form-group row">
- <label for="{{field.id}}" class="col-6 col-form-label">{{field.label}}</label>
- <div class="col-6">{{field}}</div>
- </div>
+ {% include "blocks/bs_field_snippet.html" %}
{% endfor %}
+ {% endwith %}
<div class="row justify-content-center">
- <div class="col-12">
+ <div class="col-md-4">
<button type="submit" class="btn btn-primary">{% trans 'Log in' %}</button>
</div>
</div>
diff --git a/scss/custom.scss b/scss/custom.scss
index 26a2cffdf..4f854650a 100644
--- a/scss/custom.scss
+++ b/scss/custom.scss
@@ -41,6 +41,10 @@ label {
display: block;
}
+.form-group.full-width input{
+ width: 100%;
+}
+
.form-group.no-label{
margin-top: 1.7rem;
}