diff --git a/server/core/templates/registration/password_reset_confirm.html b/server/core/templates/registration/password_reset_confirm.html index 04619a5a..bdc3fbd6 100644 --- a/server/core/templates/registration/password_reset_confirm.html +++ b/server/core/templates/registration/password_reset_confirm.html @@ -2,7 +2,7 @@ {% extends 'base.html' %} {% load i18n %} -{% block title %}{% trans 'Setze dein Passwort?' %}{% endblock %} +{% block title %}{% trans 'Setze dein Passwort' %}{% endblock %} {% block body %}
{% trans 'Dein Passwort wurde erfolgreich gespeichert. Du kannst dich nun anmelden.' %}
+ + + +{% endblock %} diff --git a/server/core/templates/registration/set_password_confirm.html b/server/core/templates/registration/set_password_confirm.html new file mode 100644 index 00000000..395607aa --- /dev/null +++ b/server/core/templates/registration/set_password_confirm.html @@ -0,0 +1,23 @@ + +{% extends 'base.html' %} +{% load i18n %} + +{% block title %}{% trans 'Setze dein Passwort' %}{% endblock %} + +{% block body %} +{% trans 'Wir haben ein E-Mail mit allen weiteren Anweisungen an dich verschickt. Das E-Mail sollte in Kürze bei dir ankommen.' %}
+{% trans 'Hinweis: Deine persönlichen Angaben für dein Benutzerkonto wurden zuvor in Myskillbox importiert. Du kannst ausschliesslich die importierte E-Mail verwenden. Wenn du nicht weisst, welche E-Mail für dich importiert wurde, kannst du deine Lehrperson fragen.' %}
+ +{% endblock %} diff --git a/server/core/templates/registration/set_password_email.html b/server/core/templates/registration/set_password_email.html new file mode 100644 index 00000000..e248cd40 --- /dev/null +++ b/server/core/templates/registration/set_password_email.html @@ -0,0 +1,12 @@ +{% load i18n %}{% autoescape off %} +{% blocktrans %}Du erhältst dieses E-Mail, um dein Passwort auf {{ site_name }} initial zu setzen.{% endblocktrans %} + +{% trans "Bitte öffne folgende Seite, um dein neues Passwort einzugeben:" %} +{% block reset_link %} +{{ protocol }}://{{ domain }}{% url 'set_password_confirm' uidb64=uid token=token %} +{% endblock %} +{% trans "Dein Benutzername lautet:" %} {{ user.get_username }} + +{% trans "Dein Skillbox Team" %} + +{% endautoescape %} diff --git a/server/core/templates/registration/set_password_form.html b/server/core/templates/registration/set_password_form.html new file mode 100644 index 00000000..425b0137 --- /dev/null +++ b/server/core/templates/registration/set_password_form.html @@ -0,0 +1,24 @@ + +{% extends 'base.html' %} +{% load i18n %} + +{% block title %}{% trans 'Willkommen bei Myskillbox' %}{% endblock %} + +{% block body %} +{% trans 'Bevor du Myskillbox verwenden kannst, muss du deine E-Mail bestätigen und ein persönliches Passwort festlegen.' %}
+ + + + +{% endblock %} diff --git a/server/core/templates/registration/set_password_subject.txt b/server/core/templates/registration/set_password_subject.txt new file mode 100644 index 00000000..94018095 --- /dev/null +++ b/server/core/templates/registration/set_password_subject.txt @@ -0,0 +1 @@ +Myskillbox: E-Mail bestätigen und Passwort setzen diff --git a/server/core/urls.py b/server/core/urls.py index 35daa49a..7a97c9cc 100644 --- a/server/core/urls.py +++ b/server/core/urls.py @@ -2,12 +2,13 @@ from django.conf import settings from django.conf.urls import url, include from django.conf.urls.static import static from django.contrib import admin -from django.urls import re_path +from django.urls import re_path, path from django.views.generic import RedirectView from wagtail.admin import urls as wagtailadmin_urls from wagtail.core import urls as wagtail_urls from core import views +from core.views import SetPasswordView, SetPasswordDoneView, SetPasswordConfirmView, SetPasswordCompleteView urlpatterns = [ # django admin @@ -15,6 +16,12 @@ urlpatterns = [ url(r'^accounts/', include('django.contrib.auth.urls')), url(r'^statistics/', include('statistics.urls', namespace='statistics')), + # set password + path('welcome/', SetPasswordView.as_view(), name='set_password'), + path('set-password/done/', SetPasswordDoneView.as_view(), name='set_password_done'), + path('set-password/