diff --git a/main/models.py b/main/models.py index 59f9453b9739e9ed89d27b1a26315fe8ae64ebc8..de3f84d9a3f42fd9a47755532d38553b595b609b 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 38c31bc54e28055673744ba2f8ed3600cda2e918..30b099b52e3f8cff00052148e3a815cc3a2abc31 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>