Skip to content
Snippets Groups Projects
Commit fcc59b6b authored by OndraRehounek's avatar OndraRehounek
Browse files

main: people page wip

parent 2ea15930
No related branches found
No related tags found
2 merge requests!607Pirati.cz,!575Feature/pirati cz
from django.utils.text import slugify
from wagtail.core.blocks import (
CharBlock,
ListBlock,
......@@ -53,11 +54,21 @@ class NewsBlock(StructBlock):
class PeopleGroupBlock(StructBlock):
title = CharBlock(label="Titulek")
slug = CharBlock(
label="Slug skupiny",
required=False,
help_text="Není třeba vyplňovat, bude automaticky vyplněno",
)
person_list = ListBlock(
PageChooserBlock(page_type="main.MainPersonPage", label="Detail osoby"),
label="Skupina osob",
)
def get_prep_value(self, value):
value = super().get_prep_value(value)
value["slug"] = slugify(value["title"])
return value
class PeopleOverviewBlock(StructBlock): # TODO asi jako BoxesBlock
title = CharBlock(label="Titulek")
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -30,6 +30,10 @@
{% include 'main/includes/layout/footer.html' %}
<script src="{% static "styleguide291/assets/js/vue.2.6.11.js" %}"></script>
<script src="{% static 'main/js/main.bundle.js' %}"></script>
{% block scripts %}{% endblock scripts %}
</body>
</html>
......@@ -16,25 +16,26 @@
<div class="container--medium">
<div class="__js-root">
<ui-view-provider
:initial="{candidates: true, program: false}"
:initial="{ {% for people_group in page.people %}'{{ people_group.value.slug }}': {% if forloop.counter0 %}true{% else %}false{% endif %},{% endfor %} }"
:sync-location="true"
v-slot="{ isCurrentView, toggleView }"
>
<div class="flex justify-center mb-12">
<div class="switch">
<a @click="toggleView('candidates')" class="switch__item"
:class="{'switch__item--active': isCurrentView('candidates')}">Poslanecká sněmovna</a>
<a @click="toggleView('program')" class="switch__item"
:class="{'switch__item--active': isCurrentView('program')}">Vláda</a>
{% for people_group in page.people %}
<a @click="toggleView('{{ people_group.value.slug }}')" class="switch__item"
:class="{'switch__item--active': isCurrentView('{{ people_group.value.slug }}')}">
{{ people_group.value.title }}
</a>
{% endfor %}
</div>
</div>
<div class="flex flex-wrap justify-center mb-12">
<template v-if="isCurrentView('snemovna')">
Sněmovna
</template>
<template v-if="isCurrentView('vlada')">
Vláda
{% for people_group in page.people %}
<template v-if="isCurrentView('{{ people_group.value.slug }}')">
{{ people_group.value.title }}
</template>
{% endfor %}
</div>
</ui-view-provider>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment