diff --git a/calendar_utils/icalevents/icalparser.py b/calendar_utils/icalevents/icalparser.py index 42e2a268a5642786397b9275070d550afa932944..9854a89dff6281ccdff3cc6b0608a907e008c223 100644 --- a/calendar_utils/icalevents/icalparser.py +++ b/calendar_utils/icalevents/icalparser.py @@ -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 diff --git a/district/blocks.py b/district/blocks.py index ba2573410511ef714fa6bc352e6c247dec060eca..ad6adbabe41a9fb371c6865d3cbcfd5c93fbe140 100644 --- a/district/blocks.py +++ b/district/blocks.py @@ -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 diff --git a/main/templates/main/main_careers_page.html b/main/templates/main/main_careers_page.html index 709030117ef0646b5b48bf034f9c2e3ffa8cb0db..bc921775ced4d01d777452a3d62afa04fde60214 100644 --- a/main/templates/main/main_careers_page.html +++ b/main/templates/main/main_careers_page.html @@ -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 %} diff --git a/main/templatetags/careers.py b/main/templatetags/careers.py index 403f6bb09da07938450603c690ff79799651f18c..0637d8cd0808947901b670489d55aaccd9c8421c 100644 --- a/main/templatetags/careers.py +++ b/main/templatetags/careers.py @@ -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) diff --git a/shared/templates/styleguide2/includes/organisms/header/main/careers_header.html b/shared/templates/styleguide2/includes/organisms/header/main/careers_header.html index 52454dfae13e2d0f0adad18358e6ad802f341d33..7721d6b81655f81e508cc51da636a8b8bda26635 100644 --- a/shared/templates/styleguide2/includes/organisms/header/main/careers_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/main/careers_header.html @@ -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"