From facd2b5de647a267f05d782f002ecafcbe769b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Thu, 21 Dec 2023 11:36:26 +0100 Subject: [PATCH] fix people link & include shared articles on homepage --- main/models.py | 15 +++++---------- .../main_section/representatives_section.html | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/main/models.py b/main/models.py index 59f9453b..de3f84d9 100644 --- a/main/models.py +++ b/main/models.py @@ -198,17 +198,12 @@ class MainHomePage( def get_context(self, request, *args, **kwargs): context = super().get_context(request, args, kwargs) - context["article_data_list"] = MainArticlePage.objects.live().order_by("-date")[ - :3 - ] - - articles_for_article_section = self.materialize_shared_articles_query( - self.append_all_shared_articles_query(MainArticlePage.objects.all())[:8] - ) - context["article_main"] = ( - articles_for_article_section[0] if articles_for_article_section else None + context["article_data_list"] = self.materialize_shared_articles_query( + self.append_all_shared_articles_query(MainArticlePage.objects.live().all()) + .live() + .order_by("-union_date") + [:3] ) - context["article_carousel_list"] = articles_for_article_section[1:8] return context diff --git a/main/templates/main/includes/organisms/main_section/representatives_section.html b/main/templates/main/includes/organisms/main_section/representatives_section.html index 38c31bc5..30b099b5 100644 --- a/main/templates/main/includes/organisms/main_section/representatives_section.html +++ b/main/templates/main/includes/organisms/main_section/representatives_section.html @@ -46,7 +46,7 @@ xl:py-24 " > - {% include 'main/includes/atoms/buttons/round_button.html' with classes='inline-block bg-white text-black' button_text="Další lidé" %} + {% include 'main/includes/atoms/buttons/round_button.html' with url=page.root_page.people_page.url classes='inline-block bg-white text-black' button_text="Další lidé" %} </div> </div> </div> -- GitLab