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

add 'All' category to careers

parent e56166e6
No related branches found
No related tags found
2 merge requests!1229Release,!1228add 'All' category to careers
Pipeline #20655 passed
......@@ -2,7 +2,6 @@
Parse iCal data to Events.
"""
from datetime import date, datetime, timedelta
# for UID generation
from random import randint
from typing import Optional
......
......@@ -16,9 +16,8 @@ from wagtail.images.blocks import ImageChooserBlock
from shared.blocks import CandidateBlock as SharedCandidateBlockMixin
from shared.blocks import CandidateListBlock as SharedCandidateListBlockMixin
from shared.blocks import (
CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin,
)
from shared.blocks import \
CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin
from shared.blocks import (
CardLinkBlockMixin,
CardLinkWithHeadlineBlockMixin,
......@@ -31,9 +30,8 @@ from shared.blocks import (
ProgramGroupBlockMixin,
)
from shared.blocks import ProgramGroupBlockPopout as SharedProgramGroupBlockPopout
from shared.blocks import (
ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin,
)
from shared.blocks import \
ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin
from shared.blocks import SecondaryCandidateBlock as SharedSecondaryCandidateBlockMixin
from shared.blocks import TeamBlockMixin
......
......@@ -6,16 +6,31 @@
<div class="__js-root">
<ui-view-provider
:initial="{ {% for category in page.get_career_categories %} '{{ forloop.counter0 }}-{{ category }}': {% if forloop.first %}true{% else %}false{% endif %}{% if not forloop.last %},{% endif %}{% endfor %} }" :sync-location="true"
:initial="{ 'all': true, {% for category in page.get_career_categories %} '{{ forloop.counter0 }}-{{ category }}': false{% if not forloop.last %},{% endif %}{% endfor %} }" :sync-location="true"
v-slot="{ isCurrentView, toggleView }"
>
{% include 'styleguide2/includes/organisms/header/main/careers_header.html' with title=page.title sub_heading=page.subheading description_column_1=page.perex_col_1 description_column_2=page.perex_col_2 %}
<main role="main" class="mb-20">
<div class="container--wide">
<template v-if="isCurrentView('all')">
{% get_career_pages page show_closed as career_pages %}
{% if career_pages %}
<div class="grid lg:grid-cols-2 grid-cols-1 gap-6 mb-4">
{% for career in career_pages %}
{% include "styleguide2/includes/molecules/boxes/main/career_box.html" %}
{% endfor %}
</div>
{% else %}
<div class="mb-4 text-grey-250">Žádné aktuální nabídky.</div>
{% endif %}
</template>
{% for category in page.get_career_categories %}
<template v-if="isCurrentView('{{ forloop.counter0 }}-{{ category }}')">
{% get_career_pages page show_closed category as career_pages %}
{% if career_pages %}
<div class="grid lg:grid-cols-2 grid-cols-1 gap-6 mb-4">
{% for career in career_pages %}
......
......@@ -4,5 +4,5 @@ register = template.Library()
@register.simple_tag
def get_career_pages(page, show_closed: bool, category: str):
def get_career_pages(page, show_closed: bool, category: str|None = None):
return page.get_career_pages(show_closed, category)
......@@ -20,6 +20,11 @@
{% endblock %}
{% block switch %}
<a
@click="toggleView('all')" class="switch__item"
:class="{'switch__item--active': isCurrentView('all')}"
>Vše</a>
{% for category in page.get_career_categories %}
<a
@click="toggleView('{{ forloop.counter0 }}-{{ category }}')" class="switch__item"
......
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