Skip to content

Commit 0f0f04c

Browse files
Updated signup form (#49)
* refactor: updated signup form * refactor: updated button all-auth element --------- Co-authored-by: mariatta <[email protected]>
1 parent c3d4f1f commit 0f0f04c

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

templates/account/signup.html

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,11 @@
2424
{% element form form=form method="post" action=action_url tags="entrance,signup" %}
2525
{% slot body %}
2626
{% csrf_token %}
27-
{% for field in form %}
28-
<div class="mb-3">
29-
{{ field.label_tag }}
30-
{% if field.errors %}
31-
{{ field|add_class:"form-control is-invalid" }}
32-
{% for error in field.errors %}
33-
<div class="invalid-feedback">{{ error }}</div>
34-
{% endfor %}
35-
{% else %}
36-
{{ field|add_class:"form-control" }}
37-
{% endif %}
38-
</div>
39-
{% endfor %}
27+
{% bootstrap_form form show_help=False layout="horizontal" %}
4028
{{ redirect_field }}
4129
{% endslot %}
4230
{% slot actions %}
43-
{% element button tags="prominent,signup" type="submit" %}
31+
{% element button type="submit" %}
4432
{% trans "Sign Up" %}
4533
{% endelement %}
4634
{% endslot %}

templates/allauth/elements/button.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
77
{% if attrs.value %}value="{{ attrs.value }}"{% endif %}
88
{% if attrs.type %}type="{{ attrs.type }}"{% endif %}
9-
>
9+
10+
class="{% block class %}
11+
btn
12+
{% if "link" in attrs.tags %}btn-link
13+
{% else %}
14+
{% if "prominent" in attrs.tags %}btn-lg{% elif "minor" in attrs.tags %}btn-sm{% endif %}
15+
btn-{% if 'outline' in attrs.tags %}outline-{% endif %}{% if "danger" in attrs.tags %}danger{% elif "secondary" in attrs.tags %}secondary{% elif "warning" in attrs.tags %}warning{% else %}primary{% endif %}
16+
{% endif %}{% endblock %}">
17+
1018
{% slot %}
1119
{% endslot %}
1220
</{% if attrs.href %}a{% else %}button{% endif %}>

0 commit comments

Comments
 (0)