Skip to content

Commit 539b5fa

Browse files
committed
slight cleanup to page UI login for large screens
1 parent 858ad0d commit 539b5fa

File tree

1 file changed

+62
-16
lines changed

1 file changed

+62
-16
lines changed

templates/registration/login.html

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,73 @@
22

33
{% load bootstrap4 %}
44

5+
6+
{% block title %}Login{% endblock %}
7+
8+
9+
{% block css %}
10+
<style>
11+
@media screen and (min-width: 992px) {
12+
html,
13+
body {
14+
height: 100%;
15+
position: relative;
16+
}
17+
div.container-fluid {
18+
background-color: #e9ecef;
19+
padding: 4rem 2rem;
20+
min-height: calc(100vh - 56px);
21+
overflow: hidden;
22+
display: block;
23+
position: relative;
24+
padding-bottom: 100px; /* height of your footer */
25+
}
26+
div.container-fluid div.col-md-6 {
27+
background-color:#ffffff;
28+
margin:0 auto;
29+
max-width: 600px;
30+
padding: 2rem 2rem;
31+
}
32+
footer {
33+
position: absolute;
34+
bottom: 0;
35+
width: 100%;
36+
}
37+
}
38+
</style>
39+
{% endblock %}
40+
41+
542
{% block content %}
6-
<div class="jumbotron">
43+
<div class="container-fluid">
744
<div class="row justify-content-md-center">
8-
<div class="col-md-6">
9-
{% if request.GET.status and request.GET.status == 'success' %}
10-
<div class="alert alert-info alert-dismissable alert-link">
45+
<div class="col-md-6">
46+
47+
{% if request.GET.status and request.GET.status == 'success' %}
48+
<div class="alert alert-info alert-link alert-dismissable">
1149
<button class="close" type="button" data-dismiss="alert" aria-hidden="true">&#215;</button>
1250
Your account was successfully created!
1351
</div>
14-
{% endif %}
15-
<form action="." method="POST">
16-
{% csrf_token %}
17-
{% bootstrap_form form %}
18-
<p class="small"><a href="/password_reset/">Forgot your password?</a></p>
19-
{% buttons %}
20-
<button type="submit" class="btn btn-primary">
21-
Submit
22-
</button>
23-
{% endbuttons %}
24-
</form>
52+
{% endif %}
53+
54+
{% if request.user.is_authenticated %}
55+
<div class="alert alert-warning alert-link">
56+
You already logged in. Please <a href="{% url 'logout' %}?next={{ request.get_full_path|urlencode }}">logout</a> first.
57+
</div>
58+
{% else %}
59+
<form action="." method="POST">
60+
{% csrf_token %}
61+
{% bootstrap_form form %}
62+
<p class="small text-right"><a href="{% url 'password_reset' %}">Forgot your password?</a></p>
63+
64+
<div>
65+
<button type="submit" class="btn btn-primary btn-block">
66+
Login
67+
</button>
68+
</div>
69+
</form>
70+
{% endif %}
71+
</div>
2572
</div>
2673
</div>
27-
</div>
2874
{% endblock %}

0 commit comments

Comments
 (0)