Skip to content

Commit 712717a

Browse files
committed
feat: redesign sign in page
1 parent 9bcf33c commit 712717a

File tree

3 files changed

+35
-44
lines changed

3 files changed

+35
-44
lines changed
Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,37 @@
1-
{% extends "account/base.html" %}
1+
{% extends "base.html" %}
22

3-
{% load i18n %}
4-
{% load account %}
5-
{% load socialaccount %}
3+
{% load static account socialaccount widget_tweaks %}
64

7-
{% block head_title %}{% trans "Login" %}{% endblock %}
8-
9-
{% block content_header %}{% trans "Login" %}{% endblock %}
5+
{% block header%}{% endblock %}
106

117
{% block content %}
12-
<p>
13-
Please log in with one of the following 3rd party systems or with your existing account.
14-
</p>
15-
16-
<ul class="socialaccount_providers button-group radius">
17-
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
18-
</ul>
19-
20-
{% include "socialaccount/snippets/login_extra.html" %}
21-
{% endblock %}
22-
23-
{% block sidebar %}
24-
<form class="login" method="POST" action="{% url 'account_login' %}">
25-
{% csrf_token %}
26-
{% for field in form %}
27-
{% if field.name == 'remember' %}
28-
{{ field }}
29-
{{ field.label_tag }}
30-
{% else %}
31-
{{ field.label_tag }}
32-
{{ field }}
33-
{% endif %}
34-
{% if field.errors %}
35-
{{ field.errors }}
36-
{% endif %}
37-
{% endfor %}
38-
{% if redirect_field_value %}
39-
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
40-
{% endif %}
41-
<div class="button-group">
42-
<div class="controls">
43-
<button type="submit">Log in</button>
44-
<a href="{% url 'account_reset_password' %}" class="alt_button">Forgotten your password?</a>
8+
<div class="w-[40rem] flex flex-col items-center justify-center mx-auto p-8 font-common shadow-sign rounded-lg">
9+
<h3>Sign In</h3>
10+
<p>Don't have an account? <a class="text-base-green-600 underline">Sign Up</a></p>
11+
{% include "socialaccount/snippets/login_extra.html" %}
12+
<form class="login flex flex-col items-center w-[80%]" method="POST" action="{% url 'account_login' %}">
13+
{% csrf_token %}
14+
{% for field in form %}
15+
{% if field.name == 'remember' %}
16+
{% else %}
17+
<div class="flex w-full my-2">
18+
<label class="text-base text-left">{{ field.label }}</label>
19+
<span aria-hidden="true" class="text-4xl text-red-400 h-2 ml-1">*</span>
20+
</div>
21+
{{ field|add_class:"h-12 text-lg rounded-lg border-base-green-400 border-2" }}
22+
{% endif %}
23+
{% endfor %}
24+
<button type="submit" class="w-full my-4 h-12 text-lg bg-base-green-600 border-2 rounded-lg border-base-green-800 font-common hover:bg-base-white-400 hover:text-base-green-600">Sign In</button>
25+
</form>
26+
<a href="{% url 'account_reset_password' %}" class="block w-[80%] underline text-right text-base-green-600">Forgotten your password?</a>
27+
<div class="flex items-center my-4 w-[80%]">
28+
<div class="flex-1 border-t w-full border-gray-400"></div>
29+
<span class="px-4 text-gray-800 font-text">OR</span>
30+
<div class="flex-1 border-t border-gray-400"></div>
4531
</div>
46-
</div>
47-
</form>
32+
<ul class="socialaccount_providers button-group radius w-[80%]">
33+
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
34+
</ul>
35+
</div>
4836
{% endblock %}
37+
{% block footer %}{% endblock %}

djangosnippets/templates/socialaccount/snippets/provider_list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{% get_providers as socialaccount_providers %}
44

55
{% for provider in socialaccount_providers %}
6-
<li>
7-
<a title="{{ provider.name }}" class="button small" href="{% provider_login_url provider.id process=process %}"><i class="fa fa-{{ provider.id }}"></i> {{ provider.name }}</a>
6+
<li class="w-full">
7+
<a title="{{ provider.name }}" class="button small text-base-white-400 p-2 w-full text-lg my-0 bg-base-green-600/60 border-2 rounded-lg border-base-green-600/20 hover:bg-base-green-600" href="{% provider_login_url provider.id process=process %}"><i class="fa fa-{{ provider.id }} text-2xl mr-1"></i> Continue with {{ provider.name }}</a>
88
</li>
99
{% endfor %}

theme/static_src/src/styles.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
--color-base-black: #0a0a0a;
77
--color-base-gray-400: #7a7a7a;
88
--color-base-green-400: #256918;
9+
--color-base-green-600: #1E4F15;
910
--color-base-green-800: #12330c;
11+
--shadow-sign: rgba(0, 0, 0, 0.24) 0px 3px 8px;
1012
--font-header: "Libertinus Sans", sans-serif;
1113
--font-title: "Playfair Display", sans-serif;
1214
--font-text: "Nunito", sans-serif;

0 commit comments

Comments
 (0)