Compare commits

...

7 Commits

Author SHA1 Message Date
Nonimart
655f9721ff REFACTOR With new authors-list name instead of revue-authors-list
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-25 12:29:05 +02:00
Nonimart
3ef493e118 FEATURE Completion of main behaviours 2025-06-25 12:28:43 +02:00
Nonimart
15487c8891 FEATURE Introducing variant with show authors 2025-06-25 12:27:00 +02:00
Nonimart
7b8164c088 FEATURE Handling style of the authors when showed 2025-06-25 12:25:22 +02:00
Nonimart
abb619207d FEATURE Introducing the component 2025-06-25 12:25:01 +02:00
Nonimart
926e5c358e INCLUDE new components 2025-06-25 12:24:49 +02:00
Nonimart
d330f9bee5 REFACTOR Renaming the component 2025-06-25 12:24:32 +02:00
8 changed files with 68 additions and 19 deletions

View File

@ -23,7 +23,7 @@
@import './components/post-card.css';
@import './components/etiquettes-grid.css';
@import './components/author-card.css';
@import './components/revue-authors-list.css';
@import './components/authors-list.css';
@import './components/article-content.css';
@import './components/content-meta.css';
@import './components/post-header.css';
@ -32,6 +32,7 @@
@import './components/footnotes-index.css';
@import './components/article-toolbar.css';
@import './components/post-card--article.css';
@import './components/authors-last-publications.css';
/* ########### PAGES ############ */
@import './pages/singles.css';

View File

@ -0,0 +1,5 @@
.authors-last-publications {
.post-card {
@apply mb-6;
}
}

View File

@ -0,0 +1,12 @@
.authors-list {
@apply mb-20;
&__title {
@apply text-4xl font-medium mb-4 uppercase;
}
&__article-title {
@apply mb-8 underline underline-offset-8 decoration-1 opacity-90;
}
.author-card {
@apply mb-8;
}
}

View File

@ -2,4 +2,17 @@
.post-card__title {
@apply text-2xl;
}
.post-card__authors {
@apply flex flex-wrap gap-8 pt-6;
li {
@apply text-lg flex items-center gap-2;
&::before {
@apply w-6 h-6 block rounded-full bg-no-repeat bg-center bg-contain;
content: '';
background-image: url('../resources/img/icons/carhop-plume.svg');
@apply filter-primary;
}
}
}
}

View File

@ -1,5 +0,0 @@
.revue-authors-list {
&__title {
@apply text-4xl font-medium mb-4 uppercase;
}
}

View File

@ -8,7 +8,8 @@ $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;
$showAuthors = $args['showAuthors'] ?? false;
$authors = get_field('authors', $ID);
?>
@ -25,6 +26,22 @@ $related_revue_issue_number = $related_revue ? get_field('issue_number', $relate
</div>
<h3 class="post-card__title"><?php echo $title; ?></h3>
<time class="post-card__date" datetime="<?php echo $date; ?>"><?php echo $date; ?></time>
<?php if ($showAuthors && $authors) : ?>
<ul class="post-card__authors">
<?php foreach ($authors as $author) : ?>
<?php
$name = get_the_title($author);
if (!$name || empty($name)) continue;
?>
<li class="post-card__author-name">
<?php echo $name ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<div class="issue-number">

View File

@ -8,8 +8,6 @@ if ($isArticle) {
} else {
$authors = getRevueAuthors($postId);
}
if (empty($authors)) return;
$authorsLastPosts = get_posts(array(
@ -19,15 +17,23 @@ $authorsLastPosts = get_posts(array(
'orderby' => 'date',
'order' => 'DESC',
));
if (empty($authorsLastPosts)) return;
?>
<div class="authors-last-publications">
<?php if (count($authors) <= 1) : ?>
<h3 class="title-small">Ses dernières publications</h3>
<?php else : ?>
<h3 class="title-small">Leurs dernières publications</h3>
<?php endif; ?>
<?php foreach ($authorsLastPosts as $post) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'ID' => $post->ID,
)); ?>
<?php endforeach; ?>
<?php foreach ($authorsLastPosts as $post) : ?>
<?php get_template_part('template-parts/articles/card-article', null, array(
'ID' => $post->ID,
'showAuthors' => true,
)); ?>
<?php endforeach; ?>
</div>
<?php wp_reset_postdata(); ?>

View File

@ -15,10 +15,10 @@ if (empty($authors)) return;
?>
<section class="revue-authors-list">
<h3 class="revue-authors-list__title"><?php echo $componentTitle; ?></h3>
<section class="authors-list">
<h3 class="authors-list__title"><?php echo $componentTitle; ?></h3>
<?php if ($articleTitle) : ?>
<p class="revue-authors-list__article-title"><?php echo $articleTitle; ?></p>
<p class="authors-list__article-title"><?php echo $articleTitle; ?></p>
<?php endif; ?>
<?php foreach ($authors as $authorID) : ?>
<?php get_template_part(