From 0e56838ee45d4c2c43b0dfde47e3bc15952cd0a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Sat, 15 May 2021 03:15:19 +0200
Subject: [PATCH] elections2021: Page header block

---
 .../templates/elections2021/_page_header.html          | 10 ++++++----
 .../elections2021/elections2021_articles_page.html     |  2 +-
 .../elections2021_candidates_list_page.html            |  2 +-
 .../elections2021/elections2021_program_page.html      |  6 ++++--
 .../elections2021/elections2021_questions_page.html    |  2 +-
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/elections2021/templates/elections2021/_page_header.html b/elections2021/templates/elections2021/_page_header.html
index 4fbcd223..a874cd36 100644
--- a/elections2021/templates/elections2021/_page_header.html
+++ b/elections2021/templates/elections2021/_page_header.html
@@ -2,10 +2,12 @@
 <article class="relative bg-lemon md:bg-split-color px-4 md:pl-8 md:pr-0 2xl:px-8 hero py-0 w-full ">
   <div class="2xl:container w-auto bg-lemon md:pl-20 pr-0 grid lg:grid-rows-1 h-64  lg:grid-cols-7 items-center 2xl:mx-auto">
     <div class="lg:row-span-1 lg:col-span-4 order-1 md:pr-20">
-      <h1 class="head-alt-md sm:head-alt-lg  pt-1 max-w-sm">{{ page.title }}</h1>
-    </div>
-    <div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3">
-      {% image page.photo fill-618x256 class="object-cover w-full h-full" %}
+      <h1 class="head-alt-md sm:head-alt-lg  pt-1 max-w-sm">{{ title }}</h1>
     </div>
+    {% if photo %}
+      <div class="hidden lg:block lg:row-span-2 lg:col-span-3 order-2 h-full 2xl:absolute 2xl:right-0 2xl:w-1/3">
+        {% image photo fill-618x256 class="object-cover w-full h-full" %}
+      </div>
+    {% endif %}
   </div>
 </article>
diff --git a/elections2021/templates/elections2021/elections2021_articles_page.html b/elections2021/templates/elections2021/elections2021_articles_page.html
index f6f606f6..d0d5e3d1 100644
--- a/elections2021/templates/elections2021/elections2021_articles_page.html
+++ b/elections2021/templates/elections2021/elections2021_articles_page.html
@@ -2,7 +2,7 @@
 
 {% block content %}
 
-{% include "elections2021/_page_header.html" %}
+{% include "elections2021/_page_header.html" with title=page.title photo=page.photo %}
 
 <div class="container container--default pt-8 lg:py-24">
   <div class="article-card-list grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
diff --git a/elections2021/templates/elections2021/elections2021_candidates_list_page.html b/elections2021/templates/elections2021/elections2021_candidates_list_page.html
index 00514fa9..6ffef88b 100644
--- a/elections2021/templates/elections2021/elections2021_candidates_list_page.html
+++ b/elections2021/templates/elections2021/elections2021_candidates_list_page.html
@@ -3,7 +3,7 @@
 
 {% block content %}
 
-{% include "elections2021/_page_header.html" %}
+{% include "elections2021/_page_header.html" with title=page.title photo=page.photo %}
 
 <div class="container container--default py-8 lg:py-24">
   <section class="text-center relative">
diff --git a/elections2021/templates/elections2021/elections2021_program_page.html b/elections2021/templates/elections2021/elections2021_program_page.html
index b69ca64a..e8662798 100644
--- a/elections2021/templates/elections2021/elections2021_program_page.html
+++ b/elections2021/templates/elections2021/elections2021_program_page.html
@@ -3,7 +3,7 @@
 
 {% block content %}
 
-{% if active_ministry or active_plan %}
+{% if active_plan %}
   <article class="relative w-full ">
     <div class="grid grid-cols-12">
       <div class="col-span-12 lg:col-span-5 grid grid-cols-12">
@@ -19,8 +19,10 @@
       </div>
     </div>
   </article>
+{% elif active_ministry %}
+  {% include "elections2021/_page_header.html" with title=title %}
 {% else %}
-  {% include "elections2021/_page_header.html" %}
+  {% include "elections2021/_page_header.html" with title=page.title photo=page.photo %}
 {% endif %}
 
 <div class="relative">
diff --git a/elections2021/templates/elections2021/elections2021_questions_page.html b/elections2021/templates/elections2021/elections2021_questions_page.html
index 6322d663..461b1078 100644
--- a/elections2021/templates/elections2021/elections2021_questions_page.html
+++ b/elections2021/templates/elections2021/elections2021_questions_page.html
@@ -3,7 +3,7 @@
 
 {% block content %}
 
-{% include "elections2021/_page_header.html" %}
+{% include "elections2021/_page_header.html" with title=page.title photo=page.photo %}
 
 <div class="container container--default lg:pb-24">
   <section class="py-16">
-- 
GitLab