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

Update sorting, move button to switch open/closed job positions

parent b3d10cbe
No related branches found
No related tags found
2 merge requests!1321Release,!1320Update sorting, move button to switch open/closed job positions
Pipeline #21039 passed
...@@ -489,13 +489,21 @@ class MainCareersPage( ...@@ -489,13 +489,21 @@ class MainCareersPage(
current_date = date.today() current_date = date.today()
if not show_closed: if show_closed:
filter = filter & models.Q(closing_date__lt=current_date)
else:
filter = filter & models.Q(closing_date__gte=current_date) filter = filter & models.Q(closing_date__gte=current_date)
if category is not None: if category is not None:
filter = filter & models.Q(category=category) filter = filter & models.Q(category=category)
return MainCareerPage.objects.child_of(self).filter(filter).live().all() return (
MainCareerPage.objects.child_of(self)
.filter(filter)
.order_by("-created_date")
.live()
.all()
)
class Meta: class Meta:
verbose_name = "Kariéry" verbose_name = "Kariéry"
......
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
<main role="main" class="mb-20"> <main role="main" class="mb-20">
<div class="container--wide"> <div class="container--wide">
{% if not show_closed %}
<a class="underline" href="?show_closed=true">Zobrazit uzavřené</a>
{% else %}
<a class="underline" href="?show_closed=false">Skrýt uzavřené</a>
{% endif %}
<template v-if="isCurrentView('all')"> <template v-if="isCurrentView('all')">
{% get_career_pages page show_closed as career_pages %} {% get_career_pages page show_closed as career_pages %}
...@@ -42,12 +48,6 @@ ...@@ -42,12 +48,6 @@
{% endif %} {% endif %}
</template> </template>
{% endfor %} {% endfor %}
{% if not show_closed %}
<a class="underline" href="?show_closed=true">Zobrazit uzavřené</a>
{% else %}
<a class="underline" href="?show_closed=false">Skrýt uzavřené</a>
{% endif %}
</div> </div>
</main> </main>
</ui-view-provider> </ui-view-provider>
......
...@@ -1747,7 +1747,10 @@ class MainArticlePageMixin( ...@@ -1747,7 +1747,10 @@ class MainArticlePageMixin(
articles_with_same_tags = list( articles_with_same_tags = list(
all_articles_in_same_web.filter( all_articles_in_same_web.filter(
tags__in=self.get_tags, tags__in=self.get_tags,
).distinct().specific().all() )
.distinct()
.specific()
.all()
) )
picked_articles = [] picked_articles = []
...@@ -1784,9 +1787,9 @@ class MainArticlePageMixin( ...@@ -1784,9 +1787,9 @@ class MainArticlePageMixin(
picked_articles picked_articles
) )
main_web_articles = list( main_web_articles = list(
MainArticlePage.objects.distinct().all().specific()[ MainArticlePage.objects.distinct()
: needed_supplementary_articles_num - 1 .all()
] .specific()[: needed_supplementary_articles_num - 1]
) )
picked_articles += main_web_articles picked_articles += main_web_articles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment