From 116cb30b4babcfd559936fe0135201edc8062578 Mon Sep 17 00:00:00 2001 From: MaM Web user Date: Mon, 6 Sep 2021 01:48:17 +0200 Subject: [PATCH] =?UTF-8?q?Dodate=C4=8Dn=C3=BD=20text=20k=20formul=C3=A1?= =?UTF-8?q?=C5=99i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/templates/seminar/formular_ok.html | 3 +++ seminar/views/views_all.py | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/seminar/templates/seminar/formular_ok.html b/seminar/templates/seminar/formular_ok.html index 6388f60c..be5f949f 100644 --- a/seminar/templates/seminar/formular_ok.html +++ b/seminar/templates/seminar/formular_ok.html @@ -4,6 +4,9 @@ {% block content %}

Formulář byl úspěšně odeslán

+{% if text %} +

{{ text | safe }}

+{% endif %} {% for odkaz in odkazy %}

{{odkaz.0}}

{% endfor %} diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index bda0d1ab..d6bcedea 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -1200,7 +1200,7 @@ def resitelEditView(request): msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa']) resitel_edit.save() osoba_edit.save() - return formularOKView(request) + return formularOKView(request, text=f'Údaje byly úspěšně uloženy. Vrátit se zpět na profil.') return render(request, 'seminar/profil/edit.html', {'form': form}) @@ -1348,7 +1348,7 @@ Tento e-mail byl vygenerován automaticky, chceš-li nás kontaktovat, napiš n from_email="registrace@mam.mff.cuni.cz", # FIXME: Chceme to mít radši tady, nebo v nastavení? ) - return formularOKView(request) + return formularOKView(request, text='Na tvůj e-mail jsme právě poslali odkaz pro nastavení hesla.') # if a GET (or any other method) we'll create a blank form else: @@ -1430,7 +1430,7 @@ def profilView(request): return LoginView.as_view()(request) # Interní, nemá se nikdy objevit v urls (jinak to účastníci vytrolí) -def formularOKView(request): +def formularOKView(request, text=''): template_name = 'seminar/formular_ok.html' odkazy = [ # (Text, odkaz) @@ -1439,6 +1439,7 @@ def formularOKView(request): ] context = { 'odkazy': odkazy, + 'text': text, } return render(request, template_name, context)