From b8c41f54c5378e64599c0f091e8038a5735e753b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 4 Apr 2021 13:26:35 +0200 Subject: [PATCH] stages/email: update default email templates Signed-off-by: Jens Langhammer --- authentik/stages/email/api.py | 7 +- .../email/static/stages/email/css/base.css | 7 +- .../email/templates/email/password_reset.html | 78 +++++++++++-------- 3 files changed, 52 insertions(+), 40 deletions(-) diff --git a/authentik/stages/email/api.py b/authentik/stages/email/api.py index 30a715229..f93804b04 100644 --- a/authentik/stages/email/api.py +++ b/authentik/stages/email/api.py @@ -8,11 +8,7 @@ from rest_framework.viewsets import ModelViewSet from authentik.core.api.utils import TypeCreateSerializer from authentik.flows.api.stages import StageSerializer -from authentik.stages.email.models import ( - EmailStage, - EmailTemplates, - get_template_choices, -) +from authentik.stages.email.models import EmailStage, get_template_choices class EmailStageSerializer(StageSerializer): @@ -23,6 +19,7 @@ class EmailStageSerializer(StageSerializer): self.fields["template"].choices = get_template_choices() def validate_template(self, value: str) -> str: + """Check validity of template""" choices = get_template_choices() for path, _ in choices: if path == value: diff --git a/authentik/stages/email/static/stages/email/css/base.css b/authentik/stages/email/static/stages/email/css/base.css index b8b6ab985..d0effdecc 100644 --- a/authentik/stages/email/static/stages/email/css/base.css +++ b/authentik/stages/email/static/stages/email/css/base.css @@ -61,7 +61,6 @@ body { .main { background-color: #fff; border: 1px solid #e9e9e9; - border-radius: 3px; } .content-wrap { @@ -153,10 +152,13 @@ a { text-align: center; cursor: pointer; display: inline-block; - border-radius: 5px; text-transform: capitalize; } +.btn-primary a { + color: #fff; +} + /* ------------------------------------- OTHER STYLES THAT MIGHT BE USEFUL ------------------------------------- */ @@ -194,7 +196,6 @@ a { font-weight: 500; padding: 20px; text-align: center; - border-radius: 3px 3px 0 0; } .alert a { color: #fff; diff --git a/authentik/stages/email/templates/email/password_reset.html b/authentik/stages/email/templates/email/password_reset.html index d83a0cee1..b88909fd3 100644 --- a/authentik/stages/email/templates/email/password_reset.html +++ b/authentik/stages/email/templates/email/password_reset.html @@ -4,36 +4,50 @@ {% load humanize %} {% block content %} - -

- {% blocktrans with username=user.username %} - Hi {{ username }}, - {% endblocktrans %} -

-

- {% blocktrans %} - You recently requested to change your password for you authentik account. Use the button below to set a new password. - {% endblocktrans %} -

- - - - - - - -

- {% blocktrans with expires=expires|naturaltime %} - If you did not request a password change, please ignore this Email. The link above is valid for {{ expires }}. - {% endblocktrans %} -

- + + + {% blocktrans with username=user.username %} + Hi {{ username }}, + {% endblocktrans %} + + + + + + + + + + + + + + +
+ {% blocktrans %} + You recently requested to change your password for you authentik account. Use the button below to set a new password. + {% endblocktrans %} +
+ + + + + + + +
+ {% blocktrans with expires=expires|naturaltime %} + If you did not request a password change, please ignore this Email. The link above is valid for {{ expires }}. + {% endblocktrans %} +
+ + {% endblock %}