From eced4a342d572565fe655832f21c484f91cf2e23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomi=20Valentov=C3=A1?= <git@imaniti.org>
Date: Wed, 17 Jul 2024 12:49:50 +0200
Subject: [PATCH] fix profile images in templates

---
 shared/templates/styleguide2/contact_page.html               | 2 +-
 .../molecules/candidates/candidate_secondary_box.html        | 2 +-
 .../includes/molecules/contact/center_contacts.html          | 2 +-
 .../styleguide2/includes/molecules/popouts/popout_point.html | 2 +-
 .../includes/organisms/cards/people_card_list.html           | 4 ++--
 .../styleguide2/includes/organisms/header/person_header.html | 4 ++--
 .../styleguide2/includes/organisms/layout/footer.html        | 2 +-
 shared/templates/styleguide2/people_page.html                | 5 +++--
 shared/templates/styleguide2/person_page.html                | 2 +-
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/shared/templates/styleguide2/contact_page.html b/shared/templates/styleguide2/contact_page.html
index ac3f3038..578388f4 100644
--- a/shared/templates/styleguide2/contact_page.html
+++ b/shared/templates/styleguide2/contact_page.html
@@ -54,7 +54,7 @@
 
         <div class="grid grid-cols-1 xl:grid-cols-2 gap-4 mb-16">
           {% for contact_person in page.contact_people %}
-            {% with contact_person.get_profile_image as profile_image %}
+            {% with contact_person.specific.get_profile_image as profile_image %}
 
             {% if profile_image %}
               {% image profile_image fill-256x256 as contact_box_image %}
diff --git a/shared/templates/styleguide2/includes/molecules/candidates/candidate_secondary_box.html b/shared/templates/styleguide2/includes/molecules/candidates/candidate_secondary_box.html
index 31ac1fff..b0cf7297 100644
--- a/shared/templates/styleguide2/includes/molecules/candidates/candidate_secondary_box.html
+++ b/shared/templates/styleguide2/includes/molecules/candidates/candidate_secondary_box.html
@@ -16,7 +16,7 @@
         flex font-bold justify-center items-center rounded-full w-12 shrink-0 grow-1
       "
     >
-      {% with self.page.get_profile_image as profile_image %}
+      {% with self.page.specific.get_profile_image as profile_image %}
       {% if profile_image %}
         {% image profile_image fill-150x150 class="object-cover w-12 shrink-0 grow-1" %}
       {% endif %}
diff --git a/shared/templates/styleguide2/includes/molecules/contact/center_contacts.html b/shared/templates/styleguide2/includes/molecules/contact/center_contacts.html
index 0e363404..2ec9fa21 100644
--- a/shared/templates/styleguide2/includes/molecules/contact/center_contacts.html
+++ b/shared/templates/styleguide2/includes/molecules/contact/center_contacts.html
@@ -8,7 +8,7 @@
   {% for contact_details in self.contact_list %}
     <div class="grid grid-cols-1 xl:grid-cols-2 gap-4">
       {% with contact_details.person as person_page %}
-        {% image person_page.get_profile_image fill-256x256 as contact_box_image %}
+        {% image person_page.specific.get_profile_image fill-256x256 as contact_box_image %}
 
         {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=contact_box_image name=person_page.title function=person_page.position %}
       {% endwith %}
diff --git a/shared/templates/styleguide2/includes/molecules/popouts/popout_point.html b/shared/templates/styleguide2/includes/molecules/popouts/popout_point.html
index 6ef2030e..a9648929 100644
--- a/shared/templates/styleguide2/includes/molecules/popouts/popout_point.html
+++ b/shared/templates/styleguide2/includes/molecules/popouts/popout_point.html
@@ -19,7 +19,7 @@
               Garant programového bodu:
             </div>
 
-            {% with self.page.get_profile_image as profile_image %}
+            {% with self.page.specific.get_profile_image as profile_image %}
 
             {% if profile_image %}
               {% image profile_image fill-150x150 class="w-10 h-10 opacity-75 m-0 p-0 rounded-full" %}
diff --git a/shared/templates/styleguide2/includes/organisms/cards/people_card_list.html b/shared/templates/styleguide2/includes/organisms/cards/people_card_list.html
index b9e14841..ec80a7db 100644
--- a/shared/templates/styleguide2/includes/organisms/cards/people_card_list.html
+++ b/shared/templates/styleguide2/includes/organisms/cards/people_card_list.html
@@ -5,14 +5,14 @@
 <div class="grid grid-cols-1 gap-4 md:grid-cols-2 w-full my-8">
   {% if self.person_list %}
     {% for person_page in self.person_list %}
-      {% image person_page.get_profile_image fill-480x480 as profile_image %}
+      {% image person_page.specific.get_profile_image fill-480x480 as profile_image %}
 
       {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=person_page.position telephone=person_page.phone mail=person_page.email url=person_page.url %}
     {% endfor %}
   {% elif self.person_list_with_custom_positions %}
     {% for person in self.person_list_with_custom_positions %}
       {% with person.page as person_page %}
-        {% image person_page.get_profile_image fill-480x480 as profile_image %}
+        {% image person_page.specific.get_profile_image fill-480x480 as profile_image %}
         {% firstof person.position person_page.position as position %}
 
         {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=position telephone=person_page.phone mail=person_page.email url=person_page.url %}
diff --git a/shared/templates/styleguide2/includes/organisms/header/person_header.html b/shared/templates/styleguide2/includes/organisms/header/person_header.html
index 909fe06c..25398b8c 100644
--- a/shared/templates/styleguide2/includes/organisms/header/person_header.html
+++ b/shared/templates/styleguide2/includes/organisms/header/person_header.html
@@ -1,7 +1,7 @@
 {% load wagtailimages_tags %}
 
-{% image main_image max-1920x1080 as background_image %}
-{% image profile_image max-500x500 as processed_profile_image %}
+{% image main_image fill-1920x1080 as background_image %}
+{% image profile_image fill-500x500 as processed_profile_image %}
 
 <header
   class="
diff --git a/shared/templates/styleguide2/includes/organisms/layout/footer.html b/shared/templates/styleguide2/includes/organisms/layout/footer.html
index 645282e7..68fd1a35 100644
--- a/shared/templates/styleguide2/includes/organisms/layout/footer.html
+++ b/shared/templates/styleguide2/includes/organisms/layout/footer.html
@@ -40,7 +40,7 @@
         <div class="flex flex-col gap-12">
           {% if page.root_page.footer_person_list %}
             {% for person in page.root_page.footer_person_list %}
-              {% image person.value.person.get_profile_image fill-256x256 as person_profile_image %}
+              {% image person.value.person.specific.get_profile_image fill-256x256 as person_profile_image %}
 
               {% firstof person.value.position person.value.person.position as position %}
 
diff --git a/shared/templates/styleguide2/people_page.html b/shared/templates/styleguide2/people_page.html
index 827166b3..d60b0dd4 100644
--- a/shared/templates/styleguide2/people_page.html
+++ b/shared/templates/styleguide2/people_page.html
@@ -35,7 +35,7 @@
                 <template v-if="isCurrentView('{{ block.value.slug }}-{{ forloop.counter }}')">
                   {% if block.value.person_list|length %}
                     {% for person_page in block.value.person_list %}
-                      {% image person_page.get_profile_image fill-480x480 as profile_image %}
+                      {% image person_page.specific.get_profile_image fill-480x480 as profile_image %}
 
                       {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=person_page.position telephone=person_page.phone mail=person_page.email url=person_page.url %}
                     {% endfor %}
@@ -44,7 +44,8 @@
                   {% if block.value.person_list_with_custom_positions|length %}
                     {% for person in block.value.person_list_with_custom_positions %}
                       {% with person.page as person_page %}
-                        {% image person_page.get_profile_image fill-480x480 as profile_image %}
+                        {% image person_page.specific.get_profile_image fill-480x480 as profile_image %}
+
                         {% firstof person.position person_page.position as position %}
 
                         {% include 'styleguide2/includes/molecules/contact/contact_person_large_box.html' with image=profile_image name=person_page.title function=position telephone=person_page.phone mail=person_page.email url=person_page.url %}
diff --git a/shared/templates/styleguide2/person_page.html b/shared/templates/styleguide2/person_page.html
index e2826e1e..ece9c0c3 100644
--- a/shared/templates/styleguide2/person_page.html
+++ b/shared/templates/styleguide2/person_page.html
@@ -132,7 +132,7 @@
             <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 content-stretch gap-8">
               {% for person in page.related_people %}
                 {% with person.value as person %}
-                  {% image person.get_profile_image fill-500x500 as profile_image %}
+                  {% image person.specific.get_profile_image fill-500x500 as profile_image %}
 
                   {% include 'styleguide2/includes/molecules/boxes/card_box.html' with image=profile_image url=person.url header=person.title content=person.position description_classes='!bg-grey-180' %}
                 {% endwith %}
-- 
GitLab