Skip to content
Snippets Groups Projects
Commit 3a0c1820 authored by jarmil's avatar jarmil
Browse files

MS web: lide do paticky stranky

parent 3bf74998
No related branches found
No related tags found
2 merge requests!173Release,!134Weby pro MS
# Generated by Django 3.1.1 on 2020-10-14 10:09
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("shared", "0008_personpage_search_image"),
("district", "0004_districthomepage_donation_page"),
]
operations = [
migrations.AddField(
model_name="districthomepage",
name="footperson_contact",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="shared.personpage",
verbose_name="Kontaktní osoba",
),
),
]
# Generated by Django 3.1.1 on 2020-10-14 10:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("district", "0005_districthomepage_footperson_contact"),
]
operations = [
migrations.RenameField(
model_name="districthomepage",
old_name="footperson_contact",
new_name="footperson_coord",
),
]
# Generated by Django 3.1.1 on 2020-10-14 10:32
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("shared", "0008_personpage_search_image"),
("district", "0006_auto_20201014_1230"),
]
operations = [
migrations.AddField(
model_name="districthomepage",
name="footperson_electman",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="footperson_electman",
to="shared.personpage",
verbose_name="Volební manažer",
),
),
migrations.AddField(
model_name="districthomepage",
name="footperson_media",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="footperson_media",
to="shared.personpage",
verbose_name="Kontakt pro média",
),
),
migrations.AlterField(
model_name="districthomepage",
name="footperson_coord",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="footperson_coord",
to="shared.personpage",
verbose_name="Koordinátor",
),
),
]
......@@ -7,7 +7,7 @@ from wagtail.core.fields import StreamField
from wagtail.core.models import Page
from wagtailmetadata.models import MetadataPageMixin
from shared.models import Article
from shared.models import Article, PersonPage
class SubpageMixin:
......@@ -41,6 +41,32 @@ class DistrictHomePage(MetadataPageMixin, Page):
donation_page = models.URLField("URL pro příjem darů", blank=True, null=True)
# Lide uvedeni v paticce
footperson_coord = models.ForeignKey(
"shared.PersonPage",
verbose_name="Koordinátor",
on_delete=models.PROTECT,
null=True,
blank=True,
related_name="footperson_coord",
)
footperson_electman = models.ForeignKey(
"shared.PersonPage",
verbose_name="Volební manažer",
on_delete=models.PROTECT,
null=True,
blank=True,
related_name="footperson_electman",
)
footperson_media = models.ForeignKey(
"shared.PersonPage",
verbose_name="Kontakt pro média",
on_delete=models.PROTECT,
null=True,
blank=True,
related_name="footperson_media",
)
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
......@@ -66,6 +92,14 @@ class DistrictHomePage(MetadataPageMixin, Page):
[FieldPanel("contact_email"), FieldPanel("contact_newcomers"),],
gettext_lazy("Kontakty"),
),
MultiFieldPanel(
[
FieldPanel("footperson_coord"),
FieldPanel("footperson_electman"),
FieldPanel("footperson_media"),
],
gettext_lazy("Lidé v zápatí stránky"),
),
]
### RELATIONS
......
......@@ -196,200 +196,24 @@
</div>
</section>
</div>
<section class="bg-black py-4 lg:py-12">
<div class="container container--default">
<div class="grid gap-4 grid-cols-1 md:grid-cols-2 xl:grid-cols-3">
<div class="badge ">
<a href="/lide/yveta-martinkova/" class="avatar
badge__avatar avatar--sm
">
<img src="/assets/d989e6-f3ff0de24e5601b4783127c01a73d5dc22f3fb0b3f4c3965fa329f8a34d4b819.jpg" alt="
Yveta Martinková
" />
</a>
<div class="badge__body">
<h2 class="head-heavy-2xs badge__title">
<a href="/lide/yveta-martinkova/" title="
Yveta Martinková
" class="content-block--nostyle">
Yveta Martinková
</a>
</h2>
<p class="badge__occupation">
Koordinátor
</p>
<a href="tel:+420 770 113 648" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--phone"></i>
<span>+420 770 113 648</span>
</a>
<a href="mailto:yveta.martinkova@pirati.cz" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--envelope"></i>
<span>yveta.martinkova@pirati.cz</span>
</a>
</div>
</div>
<div class="badge ">
<a href="/lide/jaromir-horky/" class="avatar
badge__avatar avatar--sm
">
<img src="/assets/d6b500-5107c589366d0e824b13e9ceb7ef2dcc2a93317a5733481a4fd0dc66ce6f1be6.jpg" alt="
Jaromír Horký
" />
</a>
<div class="badge__body">
<h2 class="head-heavy-2xs badge__title">
<a href="/lide/jaromir-horky/" title="
Jaromír Horký
" class="content-block--nostyle">
Jaromír Horký
</a>
</h2>
<p class="badge__occupation">
Volební manažer
</p>
<a href="tel:+420 774 942 021" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--phone"></i>
<span>+420 774 942 021</span>
</a>
<a href="mailto:jaromir.horky@pirati.cz" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--envelope"></i>
<span>jaromir.horky@pirati.cz</span>
</a>
</div>
</div>
<div class="badge ">
<a href="/lide/jaromir-horky/" class="avatar
badge__avatar avatar--sm
">
<img src="/assets/d6b500-5107c589366d0e824b13e9ceb7ef2dcc2a93317a5733481a4fd0dc66ce6f1be6.jpg" alt="
Jaromír Horký
" />
</a>
<div class="badge__body">
<h2 class="head-heavy-2xs badge__title">
<a href="/lide/jaromir-horky/" title="
Jaromír Horký
" class="content-block--nostyle">
Jaromír Horký
</a>
</h2>
<p class="badge__occupation">
Kontakt pro novináře
</p>
<a href="tel:+420 774 942 021" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--phone"></i>
<span>+420 774 942 021</span>
</a>
<a href="mailto:jaromir.horky@pirati.cz" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--envelope"></i>
<span>jaromir.horky@pirati.cz</span>
</a>
</div>
</div>
{% if page.root_page.footperson_coord %}
{% include "shared/_person_badge.html" with person=page.root_page.footperson_coord title="Koordinátor" %}
{% endif %}
{% if page.root_page.footperson_electman %}
{% include "shared/_person_badge.html" with person=page.root_page.footperson_electman title="Volební manažer" %}
{% endif %}
{% if page.root_page.footperson_media %}
{% include "shared/_person_badge.html" with person=page.root_page.footperson_media title="Kontakt pro média" %}
{% endif %}
</div>
</div>
</section>
</div>
</ui-app>
</footer>
......
......@@ -13,32 +13,7 @@
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 row-gap-8 col-gap-8">
{% for person in people %}
<div class="badge ">
<a href="/{{ person.slug }}" class="avatar badge__avatar avatar--md">
<img src="{{ person.portrait }}" alt="{{ person.name }}" />
</a>
<div class="badge__body">
<h2 class="head-heavy-xs badge__title">
<a href="/{{person.slug}}" title="{{ person.name }}" class="content-block--nostyle">
{{ person.name }}
</a>
</h2>
<p class="badge__occupation">{{ person.perex|linebreaksbr }}</p>
{% if person.phone %}
<a href="tel:person.phone" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--phone"></i>
<span>{{ person.phone }}</span>
</a>
{% endif %}
<a href="mailto:{{person.email}}" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--envelope"></i><span>{{person.email}}</span>
</a>
</div>
</div>
{% include "shared/_person_badge.html" with person=person %}
{% endfor %}
</div>
......
......@@ -2,6 +2,7 @@
{% load wagtailcore_tags wagtailimages_tags shared_filters %}
{% block subheader %}
<header class="hero hero--image pt-16 pb-24 lg:pt-32 pb-24 candidate-detail__hero"
style="--image-url: url(https://roznov.pirati.cz/assets/articles/2020/kampan20/zahajenikampan1-067fb446ec8933ae14591cbc29fc53ebb3009e4185900838bfb94752addbfa7b.jpg)"
>
......@@ -77,17 +78,7 @@
<div class="space-y-4">
{% for person in random_people %}
<div class="badge ">
<a href="/{{ person.slug }}" class="avatar badge__avatar avatar--sm">
<img src="{{ person.portrait }}" alt="{{ person.name }}" />
</a>
<div class="badge__body">
<h2 class="head-heavy-2xs badge__title">
<a href="/{{ person.slug }}" title="{{ person.name }}" class="content-block--nostyle">{{ person.name }}</a>
</h2>
<p class="badge__occupation">{{ person.perex|linebreaksbr }}</p>
</div>
</div>
{% include "shared/_person_badge.html" with person=person skipcontacts=1 %}
{% endfor %}
</div>
......
......@@ -111,7 +111,6 @@ class PersonPage(MetadataPageMixin, Page):
context["random_people"] = (
self.get_siblings(inclusive=False).type(PersonPage).live().specific()[:2]
)
print(context)
return context
......
<div class="badge ">
<a href="/{{ person.slug }}" class="avatar badge__avatar avatar--sm">
<img src="{{ person.portrait }}" alt="{{ person.name }}" />
</a>
<div class="badge__body">
<h2 class="head-heavy-xs badge__title">
<a href="/{{person.slug}}" title="{{ person.name }}" class="content-block--nostyle">
{{ person.name }}
</a>
</h2>
<p class="badge__occupation">
{% if title %}
{{ title }}
{% else %}
{{ person.perex|linebreaksbr }}
{% endif %}
</p>
{% if not skipcontacts %}
{% if person.phone %}
<a href="tel:person.phone" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--phone"></i>
<span>{{ person.phone }}</span>
</a>
{% endif %}
<a href="mailto:{{person.email}}" class="contact-line icon-link content-block--nostyle contact-line--responsive badge__link" >
<i class="ico--envelope"></i><span>{{person.email}}</span>
</a>
{% endif %}
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment