Skip to content
Snippets Groups Projects
Commit ef98d268 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

Update makeawish templates

parent 69640617
No related branches found
No related tags found
2 merge requests!1268Release,!1267Update makeawish templates
Pipeline #20806 failed
This commit is part of merge request !1267. Comments created here will be created in the context of that merge request.
# Generated by Django 5.0.7 on 2025-03-19 18:26
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('make_a_wish', '0005_makeawishroot_success_text'),
('wagtailimages', '0027_image_description'),
]
operations = [
migrations.AddField(
model_name='makeawishroot',
name='header_image',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailimages.image', verbose_name='Obrázek v headeru'),
),
migrations.AlterField(
model_name='makeawishroot',
name='new_wish_image',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='+', to='wagtailimages.image', verbose_name='Obrázek k novému přání'),
),
]
# Generated by Django 5.0.7 on 2025-03-20 05:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('make_a_wish', '0006_makeawishroot_header_image_and_more'),
]
operations = [
migrations.AddField(
model_name='makeawishroot',
name='matomo_id',
field=models.IntegerField(blank=True, null=True, verbose_name='Matomo ID pro sledování návštěvnosti'),
),
]
...@@ -32,12 +32,22 @@ class MakeAWishRoot( ...@@ -32,12 +32,22 @@ class MakeAWishRoot(
main_text = models.TextField(verbose_name="Hlavní text") main_text = models.TextField(verbose_name="Hlavní text")
success_text = models.TextField(verbose_name="Text po odeslání formuláře") success_text = models.TextField(verbose_name="Text po odeslání formuláře")
header_image = models.ForeignKey(
"wagtailimages.Image",
on_delete=models.PROTECT,
blank=True,
null=True,
related_name="+",
verbose_name="Obrázek v headeru",
)
new_wish_image = models.ForeignKey( new_wish_image = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
on_delete=models.PROTECT, on_delete=models.PROTECT,
blank=True, blank=True,
null=True, null=True,
verbose_name="Obrázek k novému prání", related_name="+",
verbose_name="Obrázek k novému přání",
) )
video_url = models.URLField( video_url = models.URLField(
...@@ -66,9 +76,14 @@ class MakeAWishRoot( ...@@ -66,9 +76,14 @@ class MakeAWishRoot(
verbose_name="Statistiky" verbose_name="Statistiky"
) )
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
content_panels = Page.content_panels + [ content_panels = Page.content_panels + [
FieldPanel("main_text"), FieldPanel("main_text"),
FieldPanel("success_text"), FieldPanel("success_text"),
FieldPanel("header_image"),
FieldPanel("new_wish_image"), FieldPanel("new_wish_image"),
FieldPanel("video_url"), FieldPanel("video_url"),
FieldPanel("common_wishes"), FieldPanel("common_wishes"),
...@@ -77,7 +92,9 @@ class MakeAWishRoot( ...@@ -77,7 +92,9 @@ class MakeAWishRoot(
InlinePanel("form_fields", label="Formulář - neměnit!!"), InlinePanel("form_fields", label="Formulář - neměnit!!"),
] ]
promote_panels = make_promote_panels() promote_panels = make_promote_panels() + [
FieldPanel("matomo_id")
]
submissions_panels = [FormSubmissionsPanel()] submissions_panels = [FormSubmissionsPanel()]
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<div class="xl:block xl:w-auto w-full flex justify-center items-center"> <div class="xl:block xl:w-auto w-full flex justify-center items-center">
{% image new_wish_image original class="pb-4 xl:mr-32 xl:w-[300px] w-[200px]" %} {% image header_image original class="pb-4 xl:mr-32 xl:w-[300px] w-[200px]" %}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -4,27 +4,32 @@ ...@@ -4,27 +4,32 @@
{% block head_start %} {% block head_start %}
{% comment %}quick dirty fix{% endcomment %} {% comment %}quick dirty fix{% endcomment %}
<title>Máte přání?</title> <title>Máte přání?</title>
{% if page.root_page.matomo_id %}
{% include "shared/matomo_snippet.html" with matomo_id=page.root_page.matomo_id %}
{% endif %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% include 'styleguide2/includes/organisms/layout/navbar.html' %} {% include 'styleguide2/includes/organisms/layout/navbar.html' %}
{% include 'make_a_wish/header/wish_header.html' with title=page.title new_wish_image=page.new_wish_image %} {% include 'make_a_wish/header/wish_header.html' with title=page.title header_image=page.header_image %}
<main role="main"> <main role="main">
<div class="container--wide grid grid-cols-1 xl:grid-cols-2 gap-8"> <div class="container--wide grid grid-cols-1 xl:grid-cols-2 gap-8">
<div> <div>
<div class="prose prose-black text-2xl xl:text-3xl mb-8"> {% block top_content %}
<div class="prose prose-black text-2xl xl:text-3xl mb-8 xl:!w-[115%%]">
{{ page.main_text }} {{ page.main_text }}
</div> </div>
<div class="bg-grey-175 border-grey-200 border-2"> <div class="bg-grey-175 border-grey-200 border-2 xl:!w-[115%]">
<div class="flex gap-0 xl:flex-row flex-col"> <div class="flex gap-0 xl:flex-row flex-col">
{% image page.new_wish_image original class="h-32 xl:flex-1" style="height:6rem" %} {% image page.new_wish_image original class="h-32 xl:flex-1" style="height:6rem" %}
<div <div
class=" class="
font-alt text-3xl xl:border-l-2 border-grey-200 xl:w-48 justify-center items-center flex font-alt text-3xl xl:border-l-2 border-grey-200 xl:w-48 justify-center items-center flex
hover:bg-grey-200 duration-100 cursor-pointer hover:bg-grey-600 duration-100 cursor-pointer bg-black text-white
h-24 h-24
" "
id="open_wish" id="open_wish"
...@@ -46,13 +51,12 @@ ...@@ -46,13 +51,12 @@
{{ hidden_field }} {{ hidden_field }}
{% endfor %} {% endfor %}
<input <textarea
type="text"
class="bg-white font-alt p-3 text-3xl border-2 border-grey-200 w-full" class="bg-white font-alt p-3 text-3xl border-2 border-grey-200 w-full"
placeholder="Přeju si, aby..." placeholder="Přeju si, aby..."
name="vase_prani" name="vase_prani"
id="id_vase_prani" id="id_vase_prani"
> ></textarea>
<div class="flex xl:gap-6 gap-4 justify-center mt-4 xl:flex-row flex-col"> <div class="flex xl:gap-6 gap-4 justify-center mt-4 xl:flex-row flex-col">
<input <input
...@@ -82,27 +86,30 @@ ...@@ -82,27 +86,30 @@
</form> </form>
</div> </div>
</div> </div>
{% endblock %}
<div class="xl:mb-16 hidden" id="separator"></div> <div class="xl:mb-16 hidden" id="separator"></div>
</div> </div>
{% block video %}
<div class="flex xl:justify-end xl:absolute xl:ml-[920px] xl:mt-[-8px] xl:mb-0 mb-8"> <div class="flex xl:justify-end xl:absolute xl:ml-[920px] xl:mt-[-8px] xl:mb-0 mb-8">
<video <video
width="720" width="720"
height="1280" height="1280"
class="w-96 mr-16" class="w-full xl:w-96 xl:mr-16"
autoplay controls muted autoplay controls muted
> >
<source src="{{ page.video_url }}" type="video/mp4"> <source src="{{ page.video_url }}" type="video/mp4">
</video> </video>
</div> </div>
{% endblock %}
</div> </div>
<div class="bg-black"> <div class="bg-black">
<div class="container--wide text-white pb-16 pt-24 xl:pr-[71px]"> <div class="container--wide text-white pb-16 pt-24 xl:pr-[71px]">
<div class="grid grid-cols-1 xl:grid-cols-3"> <div class="grid grid-cols-1 xl:grid-cols-3">
<div class="xl:col-span-2 xl:pr-32"> <div class="xl:col-span-2 xl:pr-32 text-center xl:text-left">
<h2 class="head-14xl xl:text-8xl">Co trápí čechy a češky</h2> <h2 class="head-14xl xl:text-8xl xl:leading-[7rem] leading-[6rem]">Co trápí čechy a češky</h2>
<div class="text-7xl xl:text-center"></div> <div class="text-7xl xl:text-center"></div>
</div> </div>
</div> </div>
...@@ -125,7 +132,7 @@ ...@@ -125,7 +132,7 @@
</div> </div>
<div class="mt-12 xl:p-12 p-6 bg-grey-50 text-black"> <div class="mt-12 xl:p-12 p-6 bg-grey-50 text-black">
<h3 class="head-4xl text-5xl px-6 pt-6">Máte přání tour</h3> <h3 class="head-4xl text-5xl pt-6">Máte přání tour</h3>
<ul class="flex flex-col gap-4 mt-8"> <ul class="flex flex-col gap-4 mt-8">
{% for tour_date in page.tour_dates %} {% for tour_date in page.tour_dates %}
......
{% extends "styleguide2/base.html" %} {% extends "make_a_wish/make_a_wish_root.html" %}
{% load wagtailcore_tags wagtailimages_tags %}
{% block head_start %} {% block top_content %}
{% comment %}quick dirty fix{% endcomment %} <div class="prose prose-black text-2xl xl:text-3xl mb-16 xl:!w-[115%%]">
<title>Máte přání?</title>
{% endblock %}
{% block content %}
{% include 'styleguide2/includes/organisms/layout/navbar.html' %}
{% include 'make_a_wish/header/wish_header.html' with title=page.title new_wish_image=page.new_wish_image %}
<main role="main">
<div class="container--wide grid grid-cols-1 xl:grid-cols-2 gap-8">
<div>
<div class="prose prose-black text-2xl xl:text-3xl mb-16">
{{ page.success_text }} {{ page.success_text }}
</div> </div>
</div>
</div>
<div class="bg-black">
<div class="container--wide text-white pb-16 pt-24 xl:pr-[71px]">
<div class="grid grid-cols-1 xl:grid-cols-3">
<div class="xl:col-span-2 xl:pr-32">
<h2 class="head-14xl xl:text-8xl">Co trápí čechy a češky</h2>
<div class="text-7xl xl:text-center"></div>
</div>
</div>
<div class="mt-16 p-12 bg-grey-50">
<ul class="flex flex-col xl:gap-6 gap-12">
{% for wish in page.common_wishes %}
<li>
<div class="flex xl:gap-8 gap-6 items-center xl:flex-row flex-col">
{% image wish.value.image original class="rounded-full h-32 w-32" %}
<div class="text-black">
<h4 class="font-alt text-5xl mb-3">{{ wish.value.title }}</h4>
<p class="text-2xl xl:mb-0">{{ wish.value.description }}</p>
</div>
</div>
</li>
{% endfor %}
</ul>
</div>
<div class="mt-12 xl:p-12 p-6 bg-grey-50 text-black">
<h3 class="head-4xl text-5xl px-6 pt-6">Máte přání tour</h3>
<ul class="flex flex-col gap-4 mt-8">
{% for tour_date in page.tour_dates %}
<li class="py-4">
<div class="font-alt text-4xl">
{{ tour_date.value.date }}
</div>
<div class="text-2xl">
{{ tour_date.value.details }}
</div>
</li>
{% if not forloop.last %}
<div class="mx-24 border-t-2 border-grey-200"></div>
{% endif %}
{% endfor %}
</ul>
</div>
<h3 class="mt-12 xl:head-6xl head-9xl text-white">Naše data</h3>
<div class="mt-4 p-6 bg-grey-50 text-black flex gap-8 xl:gap-16 justify-between xl:flex-row flex-col">
{% for stat_info in page.stats %}
<div class="flex gap-4 items-center">
<div class="text-6xl font-alt">{{ stat_info.value.count }}</div>
<div class="text-3xl font-alt">
{{ stat_info.value.description }}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</main>
<script>
document.getElementById("open_wish").onclick = ((e) => {
const makeAWish = document.getElementById("make_a_wish");
const separator = document.getElementById("separator");
if (makeAWish.classList.contains("hidden")) {
makeAWish.classList.remove("hidden");
separator.classList.remove("hidden");
e.currentTarget.innerHTML = "← Zrušit"
} else {
makeAWish.classList.add("hidden");
separator.classList.add("hidden");
e.currentTarget.innerHTML = "+ Přidat přání"
}
});
</script>
{% endblock %} {% endblock %}
{% block video %}{% endblock %}
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment