Compare commits
6 Commits
0e733e5988
...
2f495878c3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f495878c3 | ||
|
|
86fd29864c | ||
|
|
435eb4f218 | ||
|
|
f37f9cca3a | ||
|
|
288fb8e733 | ||
|
|
3fbd4a4ac6 |
|
|
@ -4,6 +4,8 @@
|
||||||
@apply container mx-auto grid grid-cols-12 gap-12 py-12 items-start;
|
@apply container mx-auto grid grid-cols-12 gap-12 py-12 items-start;
|
||||||
grid-template-columns: 1fr 2fr;
|
grid-template-columns: 1fr 2fr;
|
||||||
&[data-active-tab='article'] {
|
&[data-active-tab='article'] {
|
||||||
|
#article-authors,
|
||||||
|
.article-informations,
|
||||||
.sidebar .search-field,
|
.sidebar .search-field,
|
||||||
.table-matieres {
|
.table-matieres {
|
||||||
@apply hidden;
|
@apply hidden;
|
||||||
|
|
@ -18,6 +20,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&[data-active-tab='references'] {
|
&[data-active-tab='references'] {
|
||||||
|
#article-authors,
|
||||||
.article-informations,
|
.article-informations,
|
||||||
.article-content,
|
.article-content,
|
||||||
.sidebar .index-panel,
|
.sidebar .index-panel,
|
||||||
|
|
@ -26,6 +29,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&[data-active-tab='table-of-contents'] {
|
&[data-active-tab='table-of-contents'] {
|
||||||
|
#article-authors,
|
||||||
.article-informations,
|
.article-informations,
|
||||||
.article-content,
|
.article-content,
|
||||||
.sidebar .index-panel {
|
.sidebar .index-panel {
|
||||||
|
|
@ -33,6 +37,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&[data-active-tab='informations'] {
|
&[data-active-tab='informations'] {
|
||||||
|
#article-authors,
|
||||||
.article-content,
|
.article-content,
|
||||||
.table-matieres,
|
.table-matieres,
|
||||||
.sidebar .index-panel {
|
.sidebar .index-panel {
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
get_header();
|
get_header();
|
||||||
$revueID = get_field('related_revue', get_the_ID());
|
$revueID = get_field('related_revue', get_the_ID());
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="page--single-articles" data-revue-id="<?php echo get_the_ID(); ?>">
|
<div class="page--single-articles" data-revue-id="<?php echo get_the_ID(); ?>">
|
||||||
<?php if (have_posts()) : ?>
|
<?php if (have_posts()) : ?>
|
||||||
<?php while (have_posts()) : the_post(); ?>
|
<?php while (have_posts()) : the_post(); ?>
|
||||||
<?php get_template_part('template-parts/post-header'); ?>
|
<?php get_template_part('template-parts/post-header'); ?>
|
||||||
|
|
||||||
<?php get_template_part('template-parts/articles/article-toolbar'); ?>
|
<?php get_template_part('template-parts/articles/article-toolbar'); ?>
|
||||||
|
|
||||||
<div class="content-wrapper" data-active-tab="article">
|
<div class="content-wrapper" data-active-tab="article">
|
||||||
<aside class="sidebar">
|
<aside class="sidebar">
|
||||||
<div class="search-field">
|
<div class="search-field">
|
||||||
|
|
@ -20,6 +20,10 @@ $revueID = get_field('related_revue', get_the_ID());
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div class="content-area">
|
<div class="content-area">
|
||||||
|
<?php get_template_part('template-parts/articles/article-authors', null, array(
|
||||||
|
'postId' => get_the_ID()
|
||||||
|
)); ?>
|
||||||
|
|
||||||
<?php get_template_part('template-parts/articles/article-informations', null, array(
|
<?php get_template_part('template-parts/articles/article-informations', null, array(
|
||||||
'revueID' => $revueID
|
'revueID' => $revueID
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
@ -27,12 +31,14 @@ $revueID = get_field('related_revue', get_the_ID());
|
||||||
<?php get_template_part('template-parts/revues/table-matiere-revue', null, array(
|
<?php get_template_part('template-parts/revues/table-matiere-revue', null, array(
|
||||||
'revueID' => $revueID
|
'revueID' => $revueID
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
<?php get_template_part('template-parts/articles/article-content', null, array(
|
<?php get_template_part('template-parts/articles/article-content', null, array(
|
||||||
'ID' => get_the_ID()
|
'ID' => get_the_ID()
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
16
template-parts/articles/article-authors.php
Normal file
16
template-parts/articles/article-authors.php
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div id="article-authors" class="article-authors">
|
||||||
|
|
||||||
|
<?php get_template_part('template-parts/authors/authors-list', null, array(
|
||||||
|
'postId' => get_the_ID()
|
||||||
|
)); ?>
|
||||||
|
|
||||||
|
<?php get_template_part('template-parts/authors/authors-last-publications', null, array(
|
||||||
|
'postId' => get_the_ID()
|
||||||
|
)); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
@ -4,17 +4,22 @@ $articleContent = get_the_content($articleID);
|
||||||
$articleTitle = get_the_title($articleID);
|
$articleTitle = get_the_title($articleID);
|
||||||
$citeReference = get_field('cite_reference', $articleID);
|
$citeReference = get_field('cite_reference', $articleID);
|
||||||
$tags = get_the_terms($articleID, 'etiquettes');
|
$tags = get_the_terms($articleID, 'etiquettes');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article class="article-content">
|
<article class="article-content">
|
||||||
<ul class="article-tags-list">
|
<?php if ($tags) : ?>
|
||||||
<?php foreach ($tags as $tag) : ?>
|
<ul class="article-tags-list">
|
||||||
<li class="article-tag">
|
<?php foreach ($tags as $tag) : ?>
|
||||||
<?php echo $tag->name; ?>
|
<li class="article-tag">
|
||||||
</li>
|
<?php echo $tag->name; ?>
|
||||||
<?php endforeach; ?>
|
</li>
|
||||||
</ul>
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php the_content(); ?>
|
<?php the_content(); ?>
|
||||||
|
|
||||||
<?php if ($citeReference) : ?>
|
<?php if ($citeReference) : ?>
|
||||||
<p id="cite-reference">
|
<p id="cite-reference">
|
||||||
<?php echo $citeReference; ?>
|
<?php echo $citeReference; ?>
|
||||||
|
|
|
||||||
33
template-parts/authors/authors-last-publications.php
Normal file
33
template-parts/authors/authors-last-publications.php
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
$postId = $args['postId'];
|
||||||
|
$authors = [];
|
||||||
|
$isArticle = is_singular('articles');
|
||||||
|
|
||||||
|
if ($isArticle) {
|
||||||
|
$authors = get_field('authors', $postId);
|
||||||
|
} else {
|
||||||
|
$authors = getRevueAuthors($postId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($authors)) return;
|
||||||
|
|
||||||
|
$authorsLastPosts = get_posts(array(
|
||||||
|
'post_type' => $isArticle ? 'articles' : 'revues',
|
||||||
|
'author' => $authors,
|
||||||
|
'posts_per_page' => 6,
|
||||||
|
'orderby' => 'date',
|
||||||
|
'order' => 'DESC',
|
||||||
|
));
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php foreach ($authorsLastPosts as $post) : ?>
|
||||||
|
<?php get_template_part('template-parts/articles/card-article', null, array(
|
||||||
|
'ID' => $post->ID,
|
||||||
|
)); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php wp_reset_postdata(); ?>
|
||||||
32
template-parts/authors/authors-list.php
Normal file
32
template-parts/authors/authors-list.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
$postId = $args['postId'];
|
||||||
|
$isArticle = is_singular('articles');
|
||||||
|
$componentTitle = $isArticle ? 'Auteur·e·s de l\'article' : 'Auteur·e·s de la revue';
|
||||||
|
$articleTitle = get_the_title($postId);
|
||||||
|
$authors = [];
|
||||||
|
|
||||||
|
if ($isArticle) {
|
||||||
|
$authors = get_field('authors', $postId);
|
||||||
|
} else {
|
||||||
|
$authors = getRevueAuthors($postId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($authors)) return;
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
<section class="revue-authors-list">
|
||||||
|
<h3 class="revue-authors-list__title"><?php echo $componentTitle; ?></h3>
|
||||||
|
<?php if ($articleTitle) : ?>
|
||||||
|
<p class="revue-authors-list__article-title"><?php echo $articleTitle; ?></p>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php foreach ($authors as $authorID) : ?>
|
||||||
|
<?php get_template_part(
|
||||||
|
'template-parts/authors/card-author',
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'ID' => $authorID,
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</section>
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
<?php
|
|
||||||
$revueID = $args['revueID'];
|
|
||||||
$authors = getRevueAuthors($revueID);
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
||||||
<section class="revue-authors-list">
|
|
||||||
<h3 class="revue-authors-list__title">Auteur·e·s de la revue</h3>
|
|
||||||
<?php foreach ($authors as $authorID) : ?>
|
|
||||||
<?php get_template_part(
|
|
||||||
'template-parts/authors/card-author',
|
|
||||||
null,
|
|
||||||
array(
|
|
||||||
'ID' => $authorID,
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</section>
|
|
||||||
Loading…
Reference in New Issue
Block a user