add templates for password reset

This commit is contained in:
Christian Cueni 2019-03-06 09:54:13 +01:00
parent 32697fcf49
commit 670fecd35f
8 changed files with 96 additions and 4 deletions

View File

@ -176,7 +176,7 @@ LOGIN_REDIRECT_URL = '/'
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en'
LANGUAGE_CODE = 'de'
TIME_ZONE = 'UTC'
@ -346,3 +346,5 @@ WAGTAIL_SITE_NAME = 'skillbox'
GRAPHQL_QUERIES_DIR = os.path.join(BASE_DIR, '..', 'client', 'src', 'graphql', 'gql')
GRAPHQL_MUTATIONS_DIR = os.path.join(GRAPHQL_QUERIES_DIR, 'mutations')
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

View File

@ -78,7 +78,7 @@ a {
box-shadow: none;
}
input[type=text], input[type=password], select {
input[type=text], input[type=password], input[type=email], select {
width: 100%;
padding: $space;
margin: 8px 0;
@ -103,4 +103,8 @@ input[type=text], input[type=password], select {
font-size: 36px;
font-weight: 800;
font-family: Montserrat, Arial, sans-serif;
}
}
.reset-heading {
font-size: 2.4rem;
}

View File

@ -30,4 +30,6 @@
<input type="hidden" name="next" value="{{ next }}"/>
</form>
{% endblock %}
<p><a href="{% url 'password_reset' %}">Passwort vergessen?</a></p>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans 'Passwort zurücksetzen abgeschlossen' %}{% endblock %}
{% block body %}
<h1 class="logo">skillbox</h1>
<h2 class="reset-heading">{% trans 'Passwort zurücksetzen abgeschlossen' %}</h2>
<p>{% trans 'Dein Passwort wurde zurückgesetzt. Du kannst dich nun auf der Loginseite anmelden.' %}</p>
<p><a href="{% url "login" %}">{% trans 'Einloggen' %}</a></p>
</div>
{% endblock %}

View File

@ -0,0 +1,23 @@
<!-- templates/registration/password_reset_confirm.html -->
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans 'Setze dein Passwort?' %}{% endblock %}
{% block body %}
<h1 class="logo">skillbox</h1>
<h2 class="reset-heading">{% trans 'Setze dein neues Passwort' %}</h2>
<form method="post" class="mt-1">
{% csrf_token %}
<div>
{{ form.new_password1.label_tag }}
{{ form.new_password1 }}
</div>
<div>
{{ form.new_password2.label_tag }}
{{ form.new_password2 }}
</div>
<button class="btn mt-1" type="submit" name="action">{% trans 'Passwort zurücksetzen' %}</button>
</form>
{% endblock %}

View File

@ -0,0 +1,12 @@
<!-- templates/registration/password_reset_form.html -->
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans 'Anweisungen versandt' %}{% endblock %}
{% block body %}
<h1 class="logo">skillbox</h1>
<h2 class="reset-heading">{% trans 'Schau in dein Postfach' %}</h2>
<p>{% trans 'Wir haben dir die Anweisungen wie du dein Passwort zurückzusetzen kannst an dich versendet. Das Email sollte in Kürze bei dir ankommen.' %}</p>
</div>
{% endblock %}

View File

@ -0,0 +1,12 @@
{% load i18n %}{% autoescape off %}
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
{% trans "Bitte öffne folgende Seite, um dein Passwort einzugeben:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% trans "Dein Benutzername lautet:" %} {{ user.get_username }}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@ -0,0 +1,24 @@
<!-- templates/registration/password_reset_form.html -->
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans 'Passwort vergessen?' %}{% endblock %}
{% block body %}
<h1 class="logo">skillbox</h1>
<h2 class="reset-heading">{% trans 'Passwort vergessen?' %}</h2>
<p>{% trans 'Kein Problem! Gib deine Emailadresse ein und erhalte weitere Anweisungen.' %}</p>
<form method="post" class="mt-1">
{% csrf_token %}
<div>
{{ form.email.label_tag }}
{{ form.email }}
</div>
<button class="btn mt-1" type="submit" name="action">{% trans 'Passwort zurücksetzen' %}</button>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
</div>
{% endblock %}