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):
|
||||
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():
|
||||
return {i: i for i in [10, 20, 50, 100, 200, 500]}
|
||||
|
@ -453,7 +453,7 @@ select, .button {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#form-adoption-notice {
|
||||
#form-adoption-notice, #form-registration {
|
||||
.form-group {
|
||||
margin: 30px;
|
||||
}
|
||||
|
@ -1,15 +1,11 @@
|
||||
{% extends "fellchensammlung/base_generic.html" %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block content %}
|
||||
{% if not user.is_authenticated %}
|
||||
<form method="post" action=".">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
||||
<input type="submit" value="{% translate 'Registrieren' %}" />
|
||||
</form>
|
||||
{% else %}
|
||||
<p>{% translate "Du bist bereits eingeloggt." %}</p>
|
||||
{% endif %}
|
||||
{% if not user.is_authenticated %}
|
||||
{% crispy form %}
|
||||
{% else %}
|
||||
<p>{% translate "Du bist bereits eingeloggt." %}</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user