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

senate: Candidates for second round

parent fab9d339
No related branches found
No related tags found
No related merge requests found
# Generated by Django 3.1.1 on 2020-10-06 09:21
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("senate", "0003_auto_20200702_1831"),
]
operations = [
migrations.AddField(
model_name="senatehomepage",
name="candidates_second_round",
field=wagtail.core.fields.StreamField(
[
(
"item",
wagtail.core.blocks.StructBlock(
[
("name", wagtail.core.blocks.CharBlock(label="jméno")),
(
"district",
wagtail.core.blocks.CharBlock(label="obvod"),
),
(
"info",
wagtail.core.blocks.CharBlock(
label="info o nominaci"
),
),
(
"phone",
wagtail.core.blocks.CharBlock(
label="telefon", required=False
),
),
(
"email",
wagtail.core.blocks.EmailBlock(
label="email", required=False
),
),
(
"web",
wagtail.core.blocks.URLBlock(
label="web", required=False
),
),
(
"photo",
wagtail.images.blocks.ImageChooserBlock(
label="fotka"
),
),
]
),
)
],
blank=True,
verbose_name="kandidáti do 2. kola",
),
),
]
......@@ -39,6 +39,9 @@ class SenateHomePage(MetadataPageMixin, Page):
candidates = StreamField(
[("item", PersonBlock())], verbose_name="kandidáti", blank=True
)
candidates_second_round = StreamField(
[("item", PersonBlock())], verbose_name="kandidáti do 2. kola", blank=True
)
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
)
......@@ -48,6 +51,7 @@ class SenateHomePage(MetadataPageMixin, Page):
content_panels = Page.content_panels + [
StreamFieldPanel("senators"),
StreamFieldPanel("candidates"),
StreamFieldPanel("candidates_second_round"),
]
promote_panels = [
......
......@@ -8,24 +8,37 @@
<div class="container my-5">
<div class="row">
<div class="col-lg-12">
<h2 class="headline-normal">Kandidáti do Senátu</h2>
<div class="row">
{% for person in page.candidates %}
{% include "senate/person_snippet.html" %}
{% endfor %}
</div>
{% if page.candidates_second_round %}
<h2 class="headline-normal">Kandidáti postupující do 2. kola senátních voleb</h2>
<div class="row">
{% for person in page.candidates_second_round %}
{% include "senate/person_snippet.html" %}
{% endfor %}
</div>
<hr class="my-4">
{% endif %}
<hr class="my-4">
<h2 class="headline-normal">Naši Senátoři</h2>
{% if page.candidates %}
<h2 class="headline-normal">Kandidáti do Senátu</h2>
<div class="row">
{% for person in page.candidates %}
{% include "senate/person_snippet.html" %}
{% endfor %}
</div>
<hr class="my-4">
{% endif %}
<div class="row">
{% for person in page.senators %}
{% include "senate/person_snippet.html" %}
{% endfor %}
</div>
{% if page.senators %}
<h2 class="headline-normal">Naši Senátoři</h2>
<div class="row">
{% for person in page.senators %}
{% include "senate/person_snippet.html" %}
{% endfor %}
</div>
<hr class="my-4">
{% endif %}
<hr class="my-4">
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment