Skip to content
Snippets Groups Projects
Commit 9610f8f5 authored by Štěpán Farka's avatar Štěpán Farka
Browse files

[ADD] page for gdpr

parent 7c0d5b80
No related branches found
No related tags found
2 merge requests!609Release,!608Small tuning and fixes of pirati.cz (main) module
Pipeline #9652 passed
# Generated by Django 4.0.7 on 2022-08-31 14:26
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("main", "0028_alter_mainarticlepage_content_mainsimplepage"),
]
operations = [
migrations.AddField(
model_name="mainhomepage",
name="gdpr_and_cookies_page",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="main.mainsimplepage",
verbose_name="Stránka pro GDPR",
),
),
]
......@@ -17,8 +17,9 @@ from wagtail.admin.edit_handlers import (
ObjectList,
TabbedInterface,
)
from wagtail.admin.panels import PageChooserPanel
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from wagtail.core.blocks import CharBlock, PageChooserBlock, RichTextBlock
from wagtail.core.blocks import CharBlock, RichTextBlock
from wagtail.core.fields import RichTextField, StreamField
from wagtail.core.models import Page
from wagtailmetadata.models import MetadataPageMixin
......@@ -96,6 +97,14 @@ class MainHomePage(
)
# settings
gdpr_and_cookies_page = models.ForeignKey(
"main.MainSimplePage",
verbose_name="Stránka pro GDPR",
on_delete=models.PROTECT,
blank=True,
null=True,
)
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
......@@ -123,6 +132,7 @@ class MainHomePage(
settings_panels = [
FieldPanel("contact_newcomers"),
PageChooserPanel("gdpr_and_cookies_page"),
FieldPanel("donation_page"),
FieldPanel("social_links"),
FieldPanel("matomo_id"),
......@@ -155,6 +165,12 @@ class MainHomePage(
class Meta:
verbose_name = "HomePage pirati.cz"
@cached_property
def gdpr_and_cookies_url(self):
if self.gdpr_and_cookies_page:
return self.gdpr_and_cookies_page.url
return "#"
@staticmethod
def get_404_response(request):
return render(request, "main/404.html", status=404)
......
......@@ -19,7 +19,7 @@
<div class="checkbox form-field__control flex items-center mb-3">
<input type="checkbox" id="checkbox_1" name="confirmed" required="">
<label class="text-xs font-alt font-light" for="checkbox_1">
Souhlasím se zpracováním osobních údajů
Souhlasím se <a href="{{ page.root_page.gdpr_and_cookies_url }}" target="_blank">zpracováním osobních údajů</a>
</label>
</div>
{% include 'main/includes/form_button_animated.html' with btn_text="Odebírat" %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment