feat: make regirstration form nicer
This commit is contained in:
parent
4358d37f37
commit
d7cf051a16
@ -145,6 +145,14 @@ class CustomRegistrationForm(RegistrationForm):
|
|||||||
class Meta(RegistrationForm.Meta):
|
class Meta(RegistrationForm.Meta):
|
||||||
model = User
|
model = User
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.helper = FormHelper()
|
||||||
|
self.helper.form_id = 'form-registration'
|
||||||
|
self.helper.form_class = 'card'
|
||||||
|
|
||||||
|
self.helper.add_input(Submit('submit', _('Registrieren'), css_class="btn"))
|
||||||
|
|
||||||
|
|
||||||
def _get_distances():
|
def _get_distances():
|
||||||
return {i: i for i in [10, 20, 50, 100, 200, 500]}
|
return {i: i for i in [10, 20, 50, 100, 200, 500]}
|
||||||
|
@ -453,7 +453,7 @@ select, .button {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#form-adoption-notice {
|
#form-adoption-notice, #form-registration {
|
||||||
.form-group {
|
.form-group {
|
||||||
margin: 30px;
|
margin: 30px;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
{% extends "fellchensammlung/base_generic.html" %}
|
{% extends "fellchensammlung/base_generic.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if not user.is_authenticated %}
|
{% if not user.is_authenticated %}
|
||||||
<form method="post" action=".">
|
{% crispy form %}
|
||||||
{% csrf_token %}
|
{% else %}
|
||||||
{{ form.as_p }}
|
|
||||||
|
|
||||||
<input type="submit" value="{% translate 'Registrieren' %}" />
|
|
||||||
</form>
|
|
||||||
{% else %}
|
|
||||||
<p>{% translate "Du bist bereits eingeloggt." %}</p>
|
<p>{% translate "Du bist bereits eingeloggt." %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user