diff --git a/main/models.py b/main/models.py index 3edde815d9348ac3a14a19bc1f72e67fa59ea748..957682da9cb5abc56e320c74d1ec81cb88d700b2 100644 --- a/main/models.py +++ b/main/models.py @@ -167,7 +167,12 @@ 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[0] if articles_for_article_section else None + ) + context["article_carousel_list"] = articles_for_article_section[1:8] return context diff --git a/main/styleguide/source/_patterns/molecules/footer/footer-person-contact.mustache b/main/styleguide/source/_patterns/molecules/footer/footer-person-contact.mustache index e98fad8f511d9e425a48a0d07624bde71c5f7f8e..83a15521aaf23e681f5b5e877a37e57d87e8723f 100644 --- a/main/styleguide/source/_patterns/molecules/footer/footer-person-contact.mustache +++ b/main/styleguide/source/_patterns/molecules/footer/footer-person-contact.mustache @@ -1,4 +1,4 @@ -<div class="flex space-x-2 mb-4 xl:mb-0"> +<div class="flex space-x-2 mb-4 xl:mr-4 xl:mb-0"> <div class="mr-5"> <img class="rounded-full shadow-sm w-16 mb-2" src="https://randomuser.me/api/portraits/women/26.jpg" alt="user image"> diff --git a/main/styleguide/source/_patterns/organisms/footer.mustache b/main/styleguide/source/_patterns/organisms/footer.mustache index 31f9f279c6d646c403a62a9df931b790ae1266b8..9513c8701666366a109a996c0418815d10d97e8c 100644 --- a/main/styleguide/source/_patterns/organisms/footer.mustache +++ b/main/styleguide/source/_patterns/organisms/footer.mustache @@ -149,7 +149,8 @@ </div> <section class="bg-black py-8 xl:pb-36"> <div class="container--wide flex flex-col lg:flex-row lg:justify-between lg:items-end"> - <div class="mb-10 flex flex-col lg:flex-row lg:order-2 lg:mb-0"> + <div class="mb-10 flex flex-col lg:flex-row lg:flex-wrap lg:order-2 lg:mb-0"> + {{> molecules-footer-person-contact }} {{> molecules-footer-person-contact }} {{> molecules-footer-person-contact }} </div> diff --git a/main/templates/main/blocks/news_block.html b/main/templates/main/blocks/news_block.html index ac0d3bc63477d1a831ff478d7ab860c3d6513a54..0dc78b4893a57681d22f287ba9574efe34287ec1 100644 --- a/main/templates/main/blocks/news_block.html +++ b/main/templates/main/blocks/news_block.html @@ -5,21 +5,23 @@ <h2 class="head-7xl xl:text-center mb-6 xl:mb-28"> {{ self.title }} </h2> - <div class="flex flex-wrap mb-5 lg:mb-10"> - {% image article_data_list.0.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" %} + {% if article_main %} + <div class="flex flex-wrap mb-5 lg:mb-10"> + {% 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_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> - </div> - <div class="__js-root"> - <ui-article-carousel> - {% include 'main/includes/article_carousel_item.html' with article_carousel_list=article_carousel_list %} - </ui-article-carousel> - </div> + <div class="__js-root"> + <ui-article-carousel> + {% include 'main/includes/article_carousel_item.html' with article_carousel_list=article_carousel_list %} + </ui-article-carousel> + </div> + {% endif %} </div> </div> diff --git a/main/templates/main/includes/layout/footer.html b/main/templates/main/includes/layout/footer.html index 1ad964298a84397a7ae2184be35e97edfe06e829..e1f1577c70c00833658c842ae3858763ed206f6f 100644 --- a/main/templates/main/includes/layout/footer.html +++ b/main/templates/main/includes/layout/footer.html @@ -45,9 +45,9 @@ {% if page.root_page.footer_person_list %} <section class="bg-black py-8 xl:pb-36"> <div class="container--wide flex flex-col lg:flex-row lg:justify-between lg:items-end"> - <div class="mb-10 flex flex-col lg:flex-row lg:order-2 lg:mb-0"> + <div class="mb-10 flex flex-wrap flex-col lg:flex-row lg:flex-wrap lg:order-2 lg:mb-0"> {% for person in page.root_page.footer_person_list %} - <div class="flex space-x-2 mb-4 xl:mb-0"> + <div class="flex space-x-2 mb-4 xl:mr-4 xl:mb-0"> <div class="mr-5"> {% image person.value.person.profile_image fill-75x75 as person_profile_image %} <img class="rounded-full shadow-sm w-16 mb-2" src="{{ person_profile_image.url }}" diff --git a/main/templates/main/main_article_page.html b/main/templates/main/main_article_page.html index 6d1e9db205893bc1f6c998f948acdb4636935fe1..7fa3eee772b1e147223b7ee1d725abc6966b929f 100644 --- a/main/templates/main/main_article_page.html +++ b/main/templates/main/main_article_page.html @@ -11,7 +11,9 @@ <div class="grid-container mb-2 lg:mb-12 relative"> <div class="grid-left-side h-full bg-grey-150 left-tab"> <div class="p-6 flex flex-wrap flex-row items-center justify-between xl:items-start xl:flex-col"> - <span class="font-bold 3xl:text-xl">AUTOR ČLÁNKU: <br> {{ page.author }}</span><br> + {% if page.author %} + <span class="font-bold 3xl:text-xl">AUTOR ČLÁNKU: <br> {{ page.author }}</span><br> + {% endif %} <div class="flex flex-row static bottom-0 xl:absolute sm:bottom-5"> {% for social in page.author_page.social_links %} <a href="{{ social.value.link }}" class="flex hover:no-underline"> diff --git a/main/templates/main/main_contact_page.html b/main/templates/main/main_contact_page.html index 233a395eecd88396ba66f1911c6c02689fe97cc1..67239920da779340dbc8d2007a3493e7abe7e9cc 100644 --- a/main/templates/main/main_contact_page.html +++ b/main/templates/main/main_contact_page.html @@ -94,8 +94,8 @@ {% endif %} </span> {% if contact_person_box.value.person %} - <span>{{ contact_person_box.value.person.phone }}</span> - <span class="text-turquoise-500">{{ contact_person_box.value.person.email }}</span> + <span>{{ contact_person_box.value.person.phone|default_if_none:'' }}</span> + <span class="text-turquoise-500">{{ contact_person_box.value.person.email|default_if_none:'' }}</span> {% endif %} </div> </div>