Skip to content
Snippets Groups Projects
Commit 9486f28b authored by jan.bednarik's avatar jan.bednarik
Browse files

elections2021: Headers updates

parent 4cd1dd1c
Branches
No related tags found
2 merge requests!256elections2021: Headers updates,!255elections2021: Headers updates
Pipeline #3705 passed
# Generated by Django 3.2.2 on 2021-05-17 19:34
import wagtail.core.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("elections2021", "0025_elections2021programapppage_info_title"),
]
operations = [
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_childless_title",
),
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_mature_title",
),
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_parents_title",
),
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_seniors_title",
),
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_students_title",
),
migrations.RemoveField(
model_name="elections2021programpage",
name="archetype_working_seniors_title",
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_childless_author_1",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="bezdětní podpis 1"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_childless_author_2",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="bezdětní podpis 2"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_childless_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="bezdětní text"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_mature_author_1",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="zralí podpis 1"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_mature_author_2",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="zralí podpis 2"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_mature_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="zralí text"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_parents_author_1",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="rodiče podpis 1"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_parents_author_2",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="rodiče podpis 2"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_parents_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="rodiče text"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_seniors_author_1",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="senioři podpis 1"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_seniors_author_2",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="senioři podpis 2"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_seniors_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="senioři text"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_students_author_1",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="studenti podpis 1"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_students_author_2",
field=models.CharField(
blank=True, max_length=150, null=True, verbose_name="studenti podpis 2"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_students_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="studenti text"
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_working_seniors_author_1",
field=models.CharField(
blank=True,
max_length=150,
null=True,
verbose_name="pracující senioři podpis 1",
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_working_seniors_author_2",
field=models.CharField(
blank=True,
max_length=150,
null=True,
verbose_name="pracující senioři podpis 2",
),
),
migrations.AddField(
model_name="elections2021programpage",
name="archetype_working_seniors_text",
field=wagtail.core.fields.RichTextField(
blank=True, null=True, verbose_name="pracující senioři text"
),
),
]
...@@ -757,8 +757,14 @@ class Elections2021ProgramPage( ...@@ -757,8 +757,14 @@ class Elections2021ProgramPage(
"Jistota péče a pomoci", blank=True, null=True, features=RESTRICTED_FEATURES "Jistota péče a pomoci", blank=True, null=True, features=RESTRICTED_FEATURES
) )
archetype_childless_title = models.CharField( archetype_childless_text = RichTextField(
"bezdětní titulek", null=True, blank=True, max_length=50 "bezdětní text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_childless_author_1 = models.CharField(
"bezdětní podpis 1", null=True, blank=True, max_length=150
)
archetype_childless_author_2 = models.CharField(
"bezdětní podpis 2", null=True, blank=True, max_length=150
) )
archetype_childless_photo = models.ForeignKey( archetype_childless_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -768,8 +774,14 @@ class Elections2021ProgramPage( ...@@ -768,8 +774,14 @@ class Elections2021ProgramPage(
verbose_name="bezdětní foto", verbose_name="bezdětní foto",
related_name="+", related_name="+",
) )
archetype_parents_title = models.CharField( archetype_parents_text = RichTextField(
"rodiče titulek", null=True, blank=True, max_length=50 "rodiče text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_parents_author_1 = models.CharField(
"rodiče podpis 1", null=True, blank=True, max_length=150
)
archetype_parents_author_2 = models.CharField(
"rodiče podpis 2", null=True, blank=True, max_length=150
) )
archetype_parents_photo = models.ForeignKey( archetype_parents_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -779,8 +791,14 @@ class Elections2021ProgramPage( ...@@ -779,8 +791,14 @@ class Elections2021ProgramPage(
verbose_name="rodiče foto", verbose_name="rodiče foto",
related_name="+", related_name="+",
) )
archetype_mature_title = models.CharField( archetype_mature_text = RichTextField(
"zralí titulek", null=True, blank=True, max_length=50 "zralí text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_mature_author_1 = models.CharField(
"zralí podpis 1", null=True, blank=True, max_length=150
)
archetype_mature_author_2 = models.CharField(
"zralí podpis 2", null=True, blank=True, max_length=150
) )
archetype_mature_photo = models.ForeignKey( archetype_mature_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -790,8 +808,14 @@ class Elections2021ProgramPage( ...@@ -790,8 +808,14 @@ class Elections2021ProgramPage(
verbose_name="zralí foto", verbose_name="zralí foto",
related_name="+", related_name="+",
) )
archetype_seniors_title = models.CharField( archetype_seniors_text = RichTextField(
"senioři titulek", null=True, blank=True, max_length=50 "senioři text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_seniors_author_1 = models.CharField(
"senioři podpis 1", null=True, blank=True, max_length=150
)
archetype_seniors_author_2 = models.CharField(
"senioři podpis 2", null=True, blank=True, max_length=150
) )
archetype_seniors_photo = models.ForeignKey( archetype_seniors_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -801,8 +825,14 @@ class Elections2021ProgramPage( ...@@ -801,8 +825,14 @@ class Elections2021ProgramPage(
verbose_name="senioři foto", verbose_name="senioři foto",
related_name="+", related_name="+",
) )
archetype_working_seniors_title = models.CharField( archetype_working_seniors_text = RichTextField(
"pracující senioři titulek", null=True, blank=True, max_length=50 "pracující senioři text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_working_seniors_author_1 = models.CharField(
"pracující senioři podpis 1", null=True, blank=True, max_length=150
)
archetype_working_seniors_author_2 = models.CharField(
"pracující senioři podpis 2", null=True, blank=True, max_length=150
) )
archetype_working_seniors_photo = models.ForeignKey( archetype_working_seniors_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -812,8 +842,14 @@ class Elections2021ProgramPage( ...@@ -812,8 +842,14 @@ class Elections2021ProgramPage(
verbose_name="pracující senioři foto", verbose_name="pracující senioři foto",
related_name="+", related_name="+",
) )
archetype_students_title = models.CharField( archetype_students_text = RichTextField(
"studenti titulek", null=True, blank=True, max_length=50 "studenti text", blank=True, null=True, features=RESTRICTED_FEATURES
)
archetype_students_author_1 = models.CharField(
"studenti podpis 1", null=True, blank=True, max_length=150
)
archetype_students_author_2 = models.CharField(
"studenti podpis 2", null=True, blank=True, max_length=150
) )
archetype_students_photo = models.ForeignKey( archetype_students_photo = models.ForeignKey(
"wagtailimages.Image", "wagtailimages.Image",
...@@ -972,42 +1008,54 @@ class Elections2021ProgramPage( ...@@ -972,42 +1008,54 @@ class Elections2021ProgramPage(
archetype_panels = [ archetype_panels = [
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_childless_title"), FieldPanel("archetype_childless_text"),
FieldPanel("archetype_childless_author_1"),
FieldPanel("archetype_childless_author_2"),
ImageChooserPanel("archetype_childless_photo"), ImageChooserPanel("archetype_childless_photo"),
], ],
"archetyp bezdětní", "archetyp bezdětní",
), ),
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_parents_title"), FieldPanel("archetype_parents_text"),
FieldPanel("archetype_parents_author_1"),
FieldPanel("archetype_parents_author_2"),
ImageChooserPanel("archetype_parents_photo"), ImageChooserPanel("archetype_parents_photo"),
], ],
"archetyp rodiče", "archetyp rodiče",
), ),
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_mature_title"), FieldPanel("archetype_mature_text"),
FieldPanel("archetype_mature_author_1"),
FieldPanel("archetype_mature_author_2"),
ImageChooserPanel("archetype_mature_photo"), ImageChooserPanel("archetype_mature_photo"),
], ],
"archetyp zralí", "archetyp zralí",
), ),
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_seniors_title"), FieldPanel("archetype_seniors_text"),
FieldPanel("archetype_seniors_author_1"),
FieldPanel("archetype_seniors_author_2"),
ImageChooserPanel("archetype_seniors_photo"), ImageChooserPanel("archetype_seniors_photo"),
], ],
"archetyp senioři", "archetyp senioři",
), ),
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_working_seniors_title"), FieldPanel("archetype_working_seniors_text"),
FieldPanel("archetype_working_seniors_author_1"),
FieldPanel("archetype_working_seniors_author_2"),
ImageChooserPanel("archetype_working_seniors_photo"), ImageChooserPanel("archetype_working_seniors_photo"),
], ],
"archetyp pracující senioři", "archetyp pracující senioři",
), ),
MultiFieldPanel( MultiFieldPanel(
[ [
FieldPanel("archetype_students_title"), FieldPanel("archetype_students_text"),
FieldPanel("archetype_students_author_1"),
FieldPanel("archetype_students_author_2"),
ImageChooserPanel("archetype_students_photo"), ImageChooserPanel("archetype_students_photo"),
], ],
"archetyp studenti", "archetyp studenti",
...@@ -1209,27 +1257,39 @@ class Elections2021ProgramPage( ...@@ -1209,27 +1257,39 @@ class Elections2021ProgramPage(
archetype = get_archetype(selection) archetype = get_archetype(selection)
if archetype == CHILDLESS: if archetype == CHILDLESS:
weights.append("weight_childless") weights.append("weight_childless")
archetype_title = self.archetype_childless_title archetype_text = self.archetype_childless_text
archetype_author_1 = self.archetype_childless_author_1
archetype_author_2 = self.archetype_childless_author_2
archetype_photo = self.archetype_childless_photo archetype_photo = self.archetype_childless_photo
elif archetype == PARENTS: elif archetype == PARENTS:
weights.append("weight_parents") weights.append("weight_parents")
archetype_title = self.archetype_parents_title archetype_text = self.archetype_parents_text
archetype_author_1 = self.archetype_parents_author_1
archetype_author_2 = self.archetype_parents_author_2
archetype_photo = self.archetype_parents_photo archetype_photo = self.archetype_parents_photo
elif archetype == MATURE: elif archetype == MATURE:
weights.append("weight_mature") weights.append("weight_mature")
archetype_title = self.archetype_mature_title archetype_text = self.archetype_mature_text
archetype_author_1 = self.archetype_mature_author_1
archetype_author_2 = self.archetype_mature_author_2
archetype_photo = self.archetype_mature_photo archetype_photo = self.archetype_mature_photo
elif archetype == STUDENTS: elif archetype == STUDENTS:
weights.append("weight_students") weights.append("weight_students")
archetype_title = self.archetype_students_title archetype_text = self.archetype_students_text
archetype_author_1 = self.archetype_students_author_1
archetype_author_2 = self.archetype_students_author_2
archetype_photo = self.archetype_students_photo archetype_photo = self.archetype_students_photo
elif archetype == SENIORS: elif archetype == SENIORS:
weights.append("weight_seniors") weights.append("weight_seniors")
archetype_title = self.archetype_seniors_title archetype_text = self.archetype_seniors_text
archetype_author_1 = self.archetype_seniors_author_1
archetype_author_2 = self.archetype_seniors_author_2
archetype_photo = self.archetype_seniors_photo archetype_photo = self.archetype_seniors_photo
elif archetype == WORKING_SENIORS: elif archetype == WORKING_SENIORS:
weights.append("weight_working_seniors") weights.append("weight_working_seniors")
archetype_title = self.archetype_working_seniors_title archetype_text = self.archetype_working_seniors_text
archetype_author_1 = self.archetype_working_seniors_author_1
archetype_author_2 = self.archetype_working_seniors_author_2
archetype_photo = self.archetype_working_seniors_photo archetype_photo = self.archetype_working_seniors_photo
if selection["occupation"] == OCCUPATION_BUSINESS: if selection["occupation"] == OCCUPATION_BUSINESS:
...@@ -1264,7 +1324,9 @@ class Elections2021ProgramPage( ...@@ -1264,7 +1324,9 @@ class Elections2021ProgramPage(
"points": points, "points": points,
"show_app_banner": False, "show_app_banner": False,
"active_my_program": True, "active_my_program": True,
"archetype_title": archetype_title, "archetype_text": archetype_text,
"archetype_author_1": archetype_author_1,
"archetype_author_2": archetype_author_2,
"archetype_photo": archetype_photo, "archetype_photo": archetype_photo,
} }
return self.render(request, context_overrides=context) return self.render(request, context_overrides=context)
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<article class="relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full "> <article class="relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full ">
<div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-1 h-40 sm:h-56 md:h-64 lg:grid-cols-7 items-center 2xl:mx-auto"> <div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-1 h-40 sm:h-56 md:h-64 lg:grid-cols-7 items-center 2xl:mx-auto">
<div class="lg:row-span-1 lg:col-span-4 order-1 md:pr-20"> <div class="lg:row-span-1 lg:col-span-4 order-1 md:pr-20">
<h1 class="head-alt-md sm:head-alt-lg pt-1 max-w-sm">{{ title }}</h1> <h1 class="head-alt-md sm:head-alt-lg pt-1 max-w-xl">{{ title }}</h1>
</div> </div>
{% if photo %} {% if photo %}
<div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3"> <div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3">
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<img src="{% static head_image %}" height="128" style="filter:invert(1)" width="128"> <img src="{% static head_image %}" height="128" style="filter:invert(1)" width="128">
</div> </div>
</div> </div>
<div class="content-block col-span-12 lg:col-span-7 bg-lemon pl-16 pr-16 lg:pr-32 py-12"> <div class="col-span-12 lg:col-span-7 bg-lemon pl-8 pr-8 lg:pr-32 py-12 para">
{{ head_text|richtext }} {{ head_text|richtext }}
</div> </div>
</div> </div>
...@@ -22,24 +22,16 @@ ...@@ -22,24 +22,16 @@
{% elif active_ministry %} {% elif active_ministry %}
{% include "elections2021/_page_header.html" with title=title photo=head_photo %} {% include "elections2021/_page_header.html" with title=title photo=head_photo %}
{% elif active_my_program %} {% elif active_my_program %}
<article class="relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full "> <article class="hero-listing relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full ">
<div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-2 lg:grid-cols-7 items-center 2xl:mx-auto"> <div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-1 lg:grid-cols-7 items-center 2xl:mx-auto">
<div class="lg:row-span-1 lg:col-span-4 order-1 pt-14 md:pr-20"> <div class="lg:row-span-1 lg:col-span-4 order-1 py-14 md:pr-20">
<h1 class="head-alt-md sm:head-alt-lg max-w-sm">{{ title }}</h1> <div class="para">{{ archetype_text|richtext }}</div>
</div> <p class="head-alt-2xs mt-8">{{ archetype_author_1|default:"" }}</p>
<div class="lg:row-span-1 lg:col-span-4 order-3 pb-14 md:pr-20"> <p class="head-alt-2xs mt-2">{{ archetype_author_2|default:"" }}</p>
<p class="head-alt-2xs max-w-xs mt-8"> </div>
Vybrané programové body pro:
</p>
<h2 class="head-alt-md pt-2">
{{ archetype_title }}
</h2>
</div>
{% if archetype_photo %}
<div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3"> <div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3">
{% image archetype_photo fill-618x256 class="object-cover w-full h-full" %} {% image archetype_photo fill-618x256 class="object-cover w-full h-full" %}
</div> </div>
{% endif %}
</div> </div>
</article> </article>
{% else %} {% else %}
......
...@@ -288,19 +288,16 @@ ...@@ -288,19 +288,16 @@
</div> </div>
<script> <script>
/*copied from molecules/accordeon-preview.mustache.*/ document.addEventListener("DOMContentLoaded", setMaxHeights);
/*should run once on any page accordeon rows with previews are present*/ window.addEventListener('resize', setMaxHeights);
document.addEventListener("DOMContentLoaded", setMaxHeightsPreviews);
window.addEventListener('resize', setMaxHeightsPreviews);
function setMaxHeightsPreviews() { function setMaxHeights() {
// set height for css transition // set height for css transition
var accordeonRowBodies = document.getElementsByClassName('accordeon-row-body--preview'); var accordeonRowBodies = document.getElementsByClassName('accordeon-row-body');
if (accordeonRowBodies !== null) { if (accordeonRowBodies !== null) {
for (var i = 0; i < accordeonRowBodies.length; i++) { for (var i = 0; i < accordeonRowBodies.length; i++) {
accordeonRowBodies[i].style.maxHeight = accordeonRowBodies[i].getElementsByClassName("clampedcontent")[0] accordeonRowBodies[i].style.maxHeight = accordeonRowBodies[i].scrollHeight + "px";
.scrollHeight + "px";
}; };
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment