From f44c325bdf2d9e44570c65983fe09f65b1ddd224 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org>
Date: Sun, 21 Jan 2024 20:03:03 +0100
Subject: [PATCH] auto-resize images

---
 .../styleguide2/includes/atoms/articles/side_image.html       | 2 +-
 .../molecules/candidates/elections/candidate_footer_box.html  | 2 +-
 .../candidates/elections/candidate_primary_list.html          | 4 ++--
 .../candidates/elections/candidate_secondary_list.html        | 4 ++--
 .../styleguide2/includes/organisms/faq/faq_answer.html        | 4 ++--
 .../includes/organisms/header/elections/candidate_header.html | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/shared/templates/styleguide2/includes/atoms/articles/side_image.html b/shared/templates/styleguide2/includes/atoms/articles/side_image.html
index 8d53375c..f001d7ef 100644
--- a/shared/templates/styleguide2/includes/atoms/articles/side_image.html
+++ b/shared/templates/styleguide2/includes/atoms/articles/side_image.html
@@ -9,7 +9,7 @@
     lg:mx-8 lg:my-4 lg:w-2/5
   "
 >
-  {% image image original as side_image %}
+  {% image image max-512x512 as side_image %}
 
   <img
     class="my-0"
diff --git a/shared/templates/styleguide2/includes/molecules/candidates/elections/candidate_footer_box.html b/shared/templates/styleguide2/includes/molecules/candidates/elections/candidate_footer_box.html
index 5082ed1b..fee6f2b1 100644
--- a/shared/templates/styleguide2/includes/molecules/candidates/elections/candidate_footer_box.html
+++ b/shared/templates/styleguide2/includes/molecules/candidates/elections/candidate_footer_box.html
@@ -10,7 +10,7 @@
     lg:min-w-[24rem]
   "
 >
-  {% image candidate_page.image original as candidate_image %}
+  {% image candidate_page.image max-512x512 as candidate_image %}
 
   <img
     class="w-3/5"
diff --git a/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_primary_list.html b/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_primary_list.html
index 3996ca91..4c0b9af7 100644
--- a/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_primary_list.html
+++ b/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_primary_list.html
@@ -6,9 +6,9 @@
 >
   {% for candidate in self.candidates %}
     {% if candidate.image %}
-      {% image candidate.image original as resized_candidate_image %}
+      {% image candidate.image max-756x756 as resized_candidate_image %}
     {% else %}
-      {% image candidate.page.image original as resized_candidate_image %}
+      {% image candidate.page.image max-756x756 as resized_candidate_image %}
     {% endif %}
 
     {% include "styleguide2/includes/molecules/candidates/elections/candidate_primary_box.html" with name=candidate.page.title position=candidate.page.position description=candidate.description url=candidate.page.url candidate_image=resized_candidate_image %}
diff --git a/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_secondary_list.html b/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_secondary_list.html
index f3ea70a2..f5ed3054 100644
--- a/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_secondary_list.html
+++ b/shared/templates/styleguide2/includes/organisms/candidates/elections/candidate_secondary_list.html
@@ -10,9 +10,9 @@
           name: '{{ candidate.page.title }}',
 
           {% if candidate.image %}
-            {% image candidate.image original as resized_candidate_image %}
+            {% image candidate.image max-756x756 as resized_candidate_image %}
           {% else %}
-            {% image candidate.page.image original as resized_candidate_image %}
+            {% image candidate.page.image max-756x756 as resized_candidate_image %}
           {% endif %}
 
           imageSource: '{{ resized_candidate_image.url }}',
diff --git a/shared/templates/styleguide2/includes/organisms/faq/faq_answer.html b/shared/templates/styleguide2/includes/organisms/faq/faq_answer.html
index 800cb368..cf6ed262 100644
--- a/shared/templates/styleguide2/includes/organisms/faq/faq_answer.html
+++ b/shared/templates/styleguide2/includes/organisms/faq/faq_answer.html
@@ -63,9 +63,9 @@
           </div>
 
           {% if self.image %}
-            {% image self.image original as person_image %}
+            {% image self.image max-512x512 as person_image %}
           {% else %}
-            {% image self.person_page.image original as person_image %}
+            {% image self.person_page.image max-512x512 as person_image %}
           {% endif %}
 
           <img
diff --git a/shared/templates/styleguide2/includes/organisms/header/elections/candidate_header.html b/shared/templates/styleguide2/includes/organisms/header/elections/candidate_header.html
index 1f6beeec..b03948fc 100644
--- a/shared/templates/styleguide2/includes/organisms/header/elections/candidate_header.html
+++ b/shared/templates/styleguide2/includes/organisms/header/elections/candidate_header.html
@@ -77,7 +77,7 @@
         flex justify-center items-start grow w-full
       "
     >
-      {% image image original as person_image %}
+      {% image image max-756x756 as person_image %}
 
       <img
         class="lg:w-3/5"
-- 
GitLab