From 12ce12e3e942d046121f4de3e2b120f79649af80 Mon Sep 17 00:00:00 2001
From: Eric Bremner <ebremner@uwaterloo.ca>
Date: Tue, 16 Nov 2021 02:14:30 +0000
Subject: [PATCH] ISTWCMS-5195: fixing profiles to use new node theming and
 fixing card teaser

---
 .../04-components/card/card--teaser/card--teaser.twig  |  6 ++----
 source/_patterns/04-components/card/card.twig          | 10 ++++++----
 source/_patterns/04-components/profile/profile.twig    |  6 ++++--
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/source/_patterns/04-components/card/card--teaser/card--teaser.twig b/source/_patterns/04-components/card/card--teaser/card--teaser.twig
index 296c9784..9d95c708 100644
--- a/source/_patterns/04-components/card/card--teaser/card--teaser.twig
+++ b/source/_patterns/04-components/card/card--teaser/card--teaser.twig
@@ -7,13 +7,11 @@
 {% include '@components/card/card.twig' with {
   'type': type,
   'url': teaser.url,
-  'title': teaser.title,
-  'sub_title': teaser.sub_title,
-  'date': teaser.date,
   'header': teaser.header,
   'listing_image': teaser.listing_image,
   'content': teaser.content,
   'tags': teaser.tags,
   'show_hover': show_hover,
-  'card_type': 'teaser',
+  'type': type,
+  'show_body': show_body
 } %}
diff --git a/source/_patterns/04-components/card/card.twig b/source/_patterns/04-components/card/card.twig
index 7bc9376b..8771fc74 100644
--- a/source/_patterns/04-components/card/card.twig
+++ b/source/_patterns/04-components/card/card.twig
@@ -11,10 +11,12 @@
   {% set show_header = 'yes' %}
 {% endif %}
 
-{% if not hero_image and not listing_image and not banner and not content %}
-  {% set show_body = 'no' %}
-{% else %}
-  {% set show_body = 'yes' %}
+{% if not show_body %}
+  {% if not hero_image and not listing_image and not banner and not content %}
+    {% set show_body = 'no' %}
+  {% else %}
+    {% set show_body = 'yes' %}
+  {% endif %}
 {% endif %}
 
 <article class="card{% if type %} card__{{ type }}{% endif %}{% if show_hover %} card--show-hover {% endif %}" >
diff --git a/source/_patterns/04-components/profile/profile.twig b/source/_patterns/04-components/profile/profile.twig
index cccbda05..3d8e3369 100644
--- a/source/_patterns/04-components/profile/profile.twig
+++ b/source/_patterns/04-components/profile/profile.twig
@@ -3,9 +3,11 @@
     {% block content %}
       {% for profile in profiles %}
         {% include '@components/card/card--teaser/card--teaser.twig' with {
-          teaser: profile,
+          'teaser': profile,
+          'type': 'teaser',
+          'show_body': 'yes',
         } %}
       {% endfor %}
     {% endblock %}
   {% endembed %}
-</div>
\ No newline at end of file
+</div>
-- 
GitLab