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
Branches
No related tags found
2 merge requests!1229Release,!1228add 'All' category to careers
Pipeline #20655 passed
This commit is part of merge request !1229. Comments created here will be created in the context of that merge request.
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Parse iCal data to Events. Parse iCal data to Events.
""" """
from datetime import date, datetime, timedelta from datetime import date, datetime, timedelta
# for UID generation # for UID generation
from random import randint from random import randint
from typing import Optional from typing import Optional
......
...@@ -16,9 +16,8 @@ from wagtail.images.blocks import ImageChooserBlock ...@@ -16,9 +16,8 @@ from wagtail.images.blocks import ImageChooserBlock
from shared.blocks import CandidateBlock as SharedCandidateBlockMixin from shared.blocks import CandidateBlock as SharedCandidateBlockMixin
from shared.blocks import CandidateListBlock as SharedCandidateListBlockMixin from shared.blocks import CandidateListBlock as SharedCandidateListBlockMixin
from shared.blocks import ( from shared.blocks import \
CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin, CandidateSecondaryListBlock as SharedCandidateSecondaryListBlockMixin
)
from shared.blocks import ( from shared.blocks import (
CardLinkBlockMixin, CardLinkBlockMixin,
CardLinkWithHeadlineBlockMixin, CardLinkWithHeadlineBlockMixin,
...@@ -31,9 +30,8 @@ from shared.blocks import ( ...@@ -31,9 +30,8 @@ from shared.blocks import (
ProgramGroupBlockMixin, ProgramGroupBlockMixin,
) )
from shared.blocks import ProgramGroupBlockPopout as SharedProgramGroupBlockPopout from shared.blocks import ProgramGroupBlockPopout as SharedProgramGroupBlockPopout
from shared.blocks import ( from shared.blocks import \
ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin, ProgramGroupWithCandidatesBlock as SharedProgramGroupWithCandidatesBlockMixin
)
from shared.blocks import SecondaryCandidateBlock as SharedSecondaryCandidateBlockMixin from shared.blocks import SecondaryCandidateBlock as SharedSecondaryCandidateBlockMixin
from shared.blocks import TeamBlockMixin from shared.blocks import TeamBlockMixin
......
...@@ -6,16 +6,31 @@ ...@@ -6,16 +6,31 @@
<div class="__js-root"> <div class="__js-root">
<ui-view-provider <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 }" 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 %} {% 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"> <main role="main" class="mb-20">
<div class="container--wide"> <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 %} {% for category in page.get_career_categories %}
<template v-if="isCurrentView('{{ forloop.counter0 }}-{{ category }}')"> <template v-if="isCurrentView('{{ forloop.counter0 }}-{{ category }}')">
{% get_career_pages page show_closed category as career_pages %} {% get_career_pages page show_closed category as career_pages %}
{% if career_pages %} {% if career_pages %}
<div class="grid lg:grid-cols-2 grid-cols-1 gap-6 mb-4"> <div class="grid lg:grid-cols-2 grid-cols-1 gap-6 mb-4">
{% for career in career_pages %} {% for career in career_pages %}
......
...@@ -4,5 +4,5 @@ register = template.Library() ...@@ -4,5 +4,5 @@ register = template.Library()
@register.simple_tag @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) return page.get_career_pages(show_closed, category)
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
{% endblock %} {% endblock %}
{% block switch %} {% 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 %} {% for category in page.get_career_categories %}
<a <a
@click="toggleView('{{ forloop.counter0 }}-{{ category }}')" class="switch__item" @click="toggleView('{{ forloop.counter0 }}-{{ category }}')" class="switch__item"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment