Skip to content

Commit b1a58af

Browse files
committed
feat: redesign signup page
- Change field order in signup form (username, email)
1 parent 1134b4e commit b1a58af

File tree

2 files changed

+29
-14
lines changed

2 files changed

+29
-14
lines changed

djangosnippets/settings/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def user_url(user):
138138
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
139139

140140
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 7
141-
ACCOUNT_SIGNUP_FIELDS = ["email*", "username*", "password1*", "password2*"]
141+
ACCOUNT_SIGNUP_FIELDS = ["username*", "email*", "password1*", "password2*"]
142142
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
143143
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
144144
ACCOUNT_LOGOUT_ON_GET = True
Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
11
{% extends "account/base.html" %}
22

3-
{% load i18n %}
3+
{% load widget_tweaks %}
44

5-
{% block head_title %}{% trans "Signup" %}{% endblock %}
5+
{% block head_title %}Signup{% endblock %}
66

7-
{% block content_header %}{% trans "Signup" %}{% endblock %}
7+
{% block header%}{% endblock %}
88

99
{% block content %}
10-
<p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">log in</a>.{% endblocktrans %}</p>
11-
12-
<form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}">
13-
{% csrf_token %}
14-
{{ form.as_p }}
15-
{% if redirect_field_value %}
16-
<input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
17-
{% endif %}
18-
<button type="submit">{% trans "Sign Up" %}</button>
19-
</form>
10+
<div class="w-[40rem] flex flex-col items-center justify-center mx-auto p-8 font-common shadow-sign-content rounded-lg">
11+
<h3>Sign Up</h3>
12+
<p>Already have an account? Then please <a class="underline text-base-green-600 hover:text-base-orange-400" href="{{ login_url }}">log in</a></p>
13+
{% include "socialaccount/snippets/login_extra.html" %}
14+
<form class="flex flex-col items-center w-[80%]" method="POST" action="{% url 'account_signup' %}">
15+
{% csrf_token %}
16+
{% for field in form %}
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+
{% endfor %}
23+
<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 Up</button>
24+
</form>
25+
<div class="flex items-center my-4 w-[80%]">
26+
<div class="flex-1 border-t w-full border-gray-400"></div>
27+
<span class="px-4 text-gray-800 font-text">OR</span>
28+
<div class="flex-1 border-t border-gray-400"></div>
29+
</div>
30+
<ul class="socialaccount_providers button-group radius w-[80%]">
31+
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
32+
</ul>
33+
</div>
2034
{% endblock %}
35+
{% block footer %}{% endblock %}

0 commit comments

Comments
 (0)