Merge branch 'feature/pw-reset' into develop

This commit is contained in:
Christian Cueni 2019-03-07 11:34:20 +01:00
commit 319725ae57
8 changed files with 98 additions and 5 deletions

View File

@ -177,7 +177,7 @@ LOGIN_REDIRECT_URL = '/'
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en'
LANGUAGE_CODE = 'de'
TIME_ZONE = 'UTC'
@ -347,3 +347,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;
@ -104,3 +104,7 @@ input[type=text], input[type=password], select {
font-weight: 800;
font-family: Montserrat, Arial, sans-serif;
}
.reset-heading {
font-size: 2.4rem;
}

View File

@ -1,16 +1,17 @@
{% extends "base.html" %}
{% load i18n %}
{% block body %}
<h1 class="logo">myskillbox</h1>
{% if next %}
<div class="h4">Melde dich jetzt an.</div>
<div class="h4">{% trans 'Melde dich jetzt an.' %}</div>
{% endif %}
{% if form.errors %}
<p class="alert alert-error">Benutzername und Passwort stimmen nicht überein.</p>
<p class="alert alert-error">{% trans 'Benutzername und Passwort stimmen nicht überein.' %}</p>
{% endif %}
@ -26,8 +27,10 @@
{{ form.password }}
</div>
<button class="btn mt-1" type="submit" name="action">Anmelden</button>
<button class="btn mt-1" type="submit" name="action">{% trans 'Anmelden' %}</button>
<input type="hidden" name="next" value="{{ next }}"/>
</form>
<p><a href="{% url 'password_reset' %}">{% trans '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 %}Du erhälst dieses Email weil dein Passwort auf {{ site_name }} zurückgesetzt wurde.{% 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 %}