From 80822f5797cece2fdb4d0fb57d2d68b7f912e4da Mon Sep 17 00:00:00 2001 From: Nonimart Date: Thu, 18 Sep 2025 15:22:58 +0200 Subject: [PATCH] FEATURE Handling double issue post cards --- resources/css/components/post-card.css | 22 ++++++++++++++++++ template-parts/articles/card-article.php | 29 ++++++++++++++++++------ template-parts/revues/card-revue.php | 28 ++++++++++++++++++----- 3 files changed, 66 insertions(+), 13 deletions(-) diff --git a/resources/css/components/post-card.css b/resources/css/components/post-card.css index 809ac58..8f411c0 100644 --- a/resources/css/components/post-card.css +++ b/resources/css/components/post-card.css @@ -4,6 +4,13 @@ @screen lg { grid-template-columns: 1fr 40px; } + + &:has(.issue-number-group) { + @screen lg { + grid-template-columns: 1fr 86px; + } + } + &.has-cover { .post-card__cover { @apply col-span-1; @@ -14,6 +21,12 @@ @apply col-span-1; } } + + &:has(.issue-number-group) { + @screen lg { + grid-template-columns: 1fr 3fr 86px; + } + } } .content-meta { @@ -61,8 +74,17 @@ @apply order-2 lg:order-1; } + .issue-number-group { + @apply flex h-auto gap-2; + .issue-number { + @apply h-[40px]; + } + } + .issue-number-group, .issue-number { @apply order-1 lg:order-1; + } + .issue-number { @apply bg-primary text-white w-[40px] h-auto flex items-center justify-center; aspect-ratio: 1/1; } diff --git a/template-parts/articles/card-article.php b/template-parts/articles/card-article.php index fe34089..2356335 100644 --- a/template-parts/articles/card-article.php +++ b/template-parts/articles/card-article.php @@ -7,7 +7,7 @@ $link = get_the_permalink($ID); $related_revue = get_field('related_revue', $ID); $related_revue_issue_number = $related_revue ? get_field('issue_number', $related_revue) : null; - +$is_multiple_issue_number = $related_revue_issue_number && is_numeric($related_revue_issue_number) && strpos($related_revue_issue_number, '.') !== false; $showAuthors = $args['showAuthors'] ?? false; $authors = get_field('authors', $ID); @@ -44,11 +44,26 @@ $authors = get_field('authors', $ID); -
- - - -
- + + +
+ + +
+ + + +
+ +
+ +
+ + + +
+ \ No newline at end of file diff --git a/template-parts/revues/card-revue.php b/template-parts/revues/card-revue.php index f0eafe1..aa3f972 100644 --- a/template-parts/revues/card-revue.php +++ b/template-parts/revues/card-revue.php @@ -5,6 +5,7 @@ $date = get_the_date('F Y', $ID); $cover = get_the_post_thumbnail_url($ID); $link = get_the_permalink($ID); $issue_number = get_field('issue_number', $ID); +$is_multiple_issue_number = $issue_number && is_numeric($issue_number) && strpos($issue_number, '.') !== false; ?> @@ -22,11 +23,26 @@ $issue_number = get_field('issue_number', $ID); -
- - - -
- + + +
+ + +
+ + + +
+ +
+ +
+ + + +
+
\ No newline at end of file