Skip to content
Snippets Groups Projects
Commit 37560ba0 authored by Štěpán Farka's avatar Štěpán Farka
Browse files

[FIX] article first

parent bb0dee95
No related branches found
No related tags found
2 merge requests!607Pirati.cz,!575Feature/pirati cz
Pipeline #9604 passed
......@@ -165,7 +165,10 @@ class MainHomePage(MenuMixin, ExtendedMetadataHomePageMixin, MetadataPageMixin,
context["article_data_list"] = MainArticlePage.objects.filter(
region__isnull=False
).order_by("-date")[:3]
context["article_carousel_list"] = MainArticlePage.objects.order_by("-date")[:8]
articles_for_article_section = MainArticlePage.objects.order_by("-date")
context["article_main"] = articles_for_article_section[:1]
context["article_carousel_list"] = articles_for_article_section[1:8]
return context
......
......@@ -5,14 +5,15 @@
<h2 class="head-7xl xl:text-center mb-6 xl:mb-28">
{{ self.title }}
</h2>
{% if article_main %}
<div class="flex flex-wrap mb-5 lg:mb-10">
{% image article_data_list.0.image original as article_img %}
{% image article_main.image original as article_img %}
<img src="{{ article_img.url }}" draggable="false" alt="" class="lg:max-w-lg lg:mr-11 h-fit">
<div class="flex flex-col max-w-xl items-start">
<span class="text-green-500 head-3xl mt-10 mb-4 lg:mb-8">{{ article_data_list.0.date }}</span>
<h5 class="head-4xl mb-5 lg:mb-10">{{ article_data_list.0.title }}</h5>
<p class="leading-6 mb-4 lg:mb-8">{{ article_data_list.0.perex }}</p>
{% include 'main/includes/button_animated.html' with btn_link=article_data_list.0.url btn_text="Číst dále" %}
<span class="text-green-500 head-3xl mt-10 mb-4 lg:mb-8">{{ article_main.date }}</span>
<h5 class="head-4xl mb-5 lg:mb-10">{{ article_main.title }}</h5>
<p class="leading-6 mb-4 lg:mb-8">{{ article_main.perex }}</p>
{% include 'main/includes/button_animated.html' with btn_link=article_main.url btn_text="Číst dále" %}
</div>
</div>
......@@ -21,5 +22,6 @@
{% include 'main/includes/article_carousel_item.html' with article_carousel_list=article_carousel_list %}
</ui-article-carousel>
</div>
{% endif %}
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment