Skip to content
Snippets Groups Projects
Commit fc4c336a authored by Tomáš's avatar Tomáš
Browse files

Merge branch 'master' of gitlab.pirati.cz:/to/majak into feat/uniweb-charts

parents d12427ec 1ac61db0
No related branches found
No related tags found
2 merge requests!714Release,!700Add charts to uniweb & district pages
Pipeline #11222 passed
...@@ -2,6 +2,7 @@ from functools import cached_property ...@@ -2,6 +2,7 @@ from functools import cached_property
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from django.conf import settings from django.conf import settings
from django.contrib import messages
from django.core.paginator import Paginator from django.core.paginator import Paginator
from django.db import models from django.db import models
from django.http import HttpResponseRedirect, JsonResponse from django.http import HttpResponseRedirect, JsonResponse
...@@ -290,6 +291,12 @@ class MainHomePage( ...@@ -290,6 +291,12 @@ class MainHomePage(
settings.PIRATICZ_NEWSLETTER_ID, settings.PIRATICZ_NEWSLETTER_ID,
settings.PIRATICZ_NEWSLETTER_SOURCE, settings.PIRATICZ_NEWSLETTER_SOURCE,
) )
messages.success(
request,
"Zkontroluj si prosím schránku, poslali jsme ti potvrzovací email."
)
try: try:
page = ( page = (
Page.objects.filter(id=form.cleaned_data["return_page_id"]) Page.objects.filter(id=form.cleaned_data["return_page_id"])
...@@ -299,6 +306,12 @@ class MainHomePage( ...@@ -299,6 +306,12 @@ class MainHomePage(
return HttpResponseRedirect(page.full_url) return HttpResponseRedirect(page.full_url)
except Page.DoesNotExist: except Page.DoesNotExist:
return HttpResponseRedirect(self.url) return HttpResponseRedirect(self.url)
messages.error(
request,
"Tvůj prohlížeč nám odeslal špatná data. Prosím, zkus to znovu."
)
return HttpResponseRedirect(self.url) return HttpResponseRedirect(self.url)
@route(r"^feeds/atom/$") @route(r"^feeds/atom/$")
......
This diff is collapsed.
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
</head> </head>
<body> <body>
{% include 'main/includes/layout/messages.html' %}
{% include 'main/includes/layout/header.html' %} {% include 'main/includes/layout/header.html' %}
{% block content %}{% endblock content %} {% block content %}{% endblock content %}
......
{% if messages %}
<ul class="flex flex-col w-full drop-shadow-lg">
{% for message in messages %}
<li
class="px-5 py-4 text-center relative z-50 {% if message.tags == "debug" %}bg-grey-200{% elif message.tags == "info" %}bg-blue-300 text-white{% elif message.tags == "success" %}bg-green-400 text-white{% elif message.tags == "warning" %}bg-yellow-300{% elif message.tags == "error" %}bg-red-600 text-white{% endif %}"
>
<i
class="ico--{% if message.tags == "debug" %}cog{% elif message.tags == "info" %}info{% elif message.tags == "success" %}checkmark{% elif message.tags == "warning" %}warning{% elif message.tags == "error" %}cross{% endif %} mr-2"
></i>
{{ message }}
</li>
{% endfor %}
</ul>
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment