Compare commits
31 Commits
24417f09e5
...
f3837404d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3837404d7 | ||
|
|
7e927e168e | ||
|
|
4a054947f3 | ||
|
|
23eb4184af | ||
|
|
77de397e0c | ||
|
|
e8e57aa7e9 | ||
|
|
c4d0f66b5d | ||
|
|
34f1e27e3c | ||
|
|
2e2df71ecd | ||
|
|
487e9f8abd | ||
|
|
297f573507 | ||
|
|
eb1a731ca9 | ||
|
|
5ffe427cc2 | ||
|
|
c101758371 | ||
|
|
50a19fca8c | ||
|
|
2ba5f40892 | ||
|
|
213a4f078e | ||
|
|
ef0fafd101 | ||
|
|
257673bb2e | ||
|
|
1ff55bb638 | ||
|
|
d0133e4aad | ||
|
|
405097cbb0 | ||
|
|
b6bf2de725 | ||
|
|
965f097507 | ||
|
|
86864d3132 | ||
|
|
f06fe21a5a | ||
|
|
7f6be681fe | ||
|
|
20398a32d9 | ||
|
|
8c5dd8cb02 | ||
|
|
ea5e3b13cd | ||
|
|
13930d6449 |
|
|
@ -14,16 +14,16 @@ body {
|
||||||
|
|
||||||
#wp-submit {
|
#wp-submit {
|
||||||
--tw-border-opacity: 1;
|
--tw-border-opacity: 1;
|
||||||
border-color: rgb(19 111 99 / var(--tw-border-opacity, 1));
|
border-color: rgb(19 111 99 / var(--tw-border-opacity));
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(19 111 99 / var(--tw-bg-opacity, 1));
|
background-color: rgb(19 111 99 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav a,
|
#nav a,
|
||||||
#backtoblog a {
|
#backtoblog a {
|
||||||
/* color: var(--red) !important; */
|
/* color: var(--red) !important; */
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(19 111 99 / var(--tw-text-opacity, 1));
|
color: rgb(19 111 99 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
#loginform {
|
#loginform {
|
||||||
|
|
@ -32,6 +32,6 @@ body {
|
||||||
|
|
||||||
.wp-pwd span {
|
.wp-pwd span {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(19 111 99 / var(--tw-text-opacity, 1));
|
color: rgb(19 111 99 / var(--tw-text-opacity));
|
||||||
/* color: var(--red) !important; */
|
/* color: var(--red) !important; */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ add_action('rest_api_init', function () {
|
||||||
'callback' => 'build_posts',
|
'callback' => 'build_posts',
|
||||||
'permission_callback' => '__return_true',
|
'permission_callback' => '__return_true',
|
||||||
));
|
));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -26,7 +25,7 @@ function build_posts($request)
|
||||||
$auteur = esc_html($request->get_param('auteur'));
|
$auteur = esc_html($request->get_param('auteur'));
|
||||||
$sort_by = esc_html($request->get_param('sort_by'));
|
$sort_by = esc_html($request->get_param('sort_by'));
|
||||||
$recherche = esc_html($request->get_param('recherche'));
|
$recherche = esc_html($request->get_param('recherche'));
|
||||||
|
|
||||||
|
|
||||||
// Construire les arguments de la query WordPress
|
// Construire les arguments de la query WordPress
|
||||||
$args = array(
|
$args = array(
|
||||||
|
|
@ -73,14 +72,20 @@ function build_posts($request)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtre par auteur
|
// Filtre par auteur (authors = relation multiple, main_author = auteur principal)
|
||||||
if (!empty($auteur) && $auteur != '1') {
|
if (!empty($auteur) && $auteur != '1') {
|
||||||
$args['meta_query'] = array(
|
$args['meta_query'] = array(
|
||||||
|
'relation' => 'OR',
|
||||||
array(
|
array(
|
||||||
'key' => 'authors', // Ajustez selon votre structure
|
'key' => 'authors',
|
||||||
|
'value' => '"' . $auteur . '"',
|
||||||
|
'compare' => 'LIKE',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'key' => 'main_author',
|
||||||
'value' => $auteur,
|
'value' => $auteur,
|
||||||
'compare' => 'LIKE'
|
'compare' => 'LIKE',
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,9 +101,9 @@ function build_posts($request)
|
||||||
ob_start();
|
ob_start();
|
||||||
if ($posts_query->have_posts()) :
|
if ($posts_query->have_posts()) :
|
||||||
while ($posts_query->have_posts()) : $posts_query->the_post();
|
while ($posts_query->have_posts()) : $posts_query->the_post();
|
||||||
get_template_part('template-parts/components/cards/post-card', null, array(
|
get_template_part('template-parts/components/cards/post-card', null, array(
|
||||||
'ID' => get_the_ID(),
|
'ID' => get_the_ID(),
|
||||||
));
|
));
|
||||||
endwhile;
|
endwhile;
|
||||||
else :
|
else :
|
||||||
echo '<p>Aucun article trouvé.</p>';
|
echo '<p>Aucun article trouvé.</p>';
|
||||||
|
|
@ -118,4 +123,3 @@ function build_posts($request)
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ function handle_posts_numerotation_remapping($post_type)
|
||||||
function hasPostTypeNumerotation($post_type)
|
function hasPostTypeNumerotation($post_type)
|
||||||
{
|
{
|
||||||
switch ($post_type) {
|
switch ($post_type) {
|
||||||
|
case 'articles':
|
||||||
case 'analyses-etudes':
|
case 'analyses-etudes':
|
||||||
case 'expositions':
|
case 'expositions':
|
||||||
case 'outils-pedagogiques':
|
case 'outils-pedagogiques':
|
||||||
|
|
@ -381,7 +382,7 @@ function get_authors_linked_to_posts(array $post_ids)
|
||||||
foreach ($post_ids as $post_id) {
|
foreach ($post_ids as $post_id) {
|
||||||
$post_authors = get_field('authors', $post_id);
|
$post_authors = get_field('authors', $post_id);
|
||||||
if (empty($post_authors)) continue;
|
if (empty($post_authors)) continue;
|
||||||
|
|
||||||
foreach ($post_authors as $author) {
|
foreach ($post_authors as $author) {
|
||||||
$author_id = is_object($author) ? $author->ID : (int) $author;
|
$author_id = is_object($author) ? $author->ID : (int) $author;
|
||||||
if ($author_id) {
|
if ($author_id) {
|
||||||
|
|
@ -399,4 +400,22 @@ function get_authors_linked_to_posts(array $post_ids)
|
||||||
'orderby' => 'title',
|
'orderby' => 'title',
|
||||||
'order' => 'ASC',
|
'order' => 'ASC',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function get_current_post_numerotation($post_id)
|
||||||
|
{
|
||||||
|
$current_blog_id = get_current_blog_id();
|
||||||
|
|
||||||
|
if ($current_blog_id === 1) {
|
||||||
|
return get_post_meta($post_id, 'post_numerotation', true);
|
||||||
|
}
|
||||||
|
if ($current_blog_id === 2) {
|
||||||
|
$related_revue = get_field('related_revue', $post_id);
|
||||||
|
$related_revue_issue_number = $related_revue ? get_field('issue_number', $related_revue) : null;
|
||||||
|
|
||||||
|
return $related_revue_issue_number;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
@import './components/post-tag.css';
|
@import './components/post-tag.css';
|
||||||
@import './components/content-wrapper.css';
|
@import './components/content-wrapper.css';
|
||||||
@import './components/content-area.css';
|
@import './components/content-area.css';
|
||||||
|
@import './components/authors-list.css';
|
||||||
|
|
||||||
/* ########### EDITOR CONTENT ############ */
|
/* ########### EDITOR CONTENT ############ */
|
||||||
@import './editor-content/entry-content.css';
|
@import './editor-content/entry-content.css';
|
||||||
|
|
@ -99,7 +100,8 @@
|
||||||
@import './blocks/highlight-timeline-step.css';
|
@import './blocks/highlight-timeline-step.css';
|
||||||
@import './blocks/highlight-timeline.css';
|
@import './blocks/highlight-timeline.css';
|
||||||
@import './blocks/press-ressources.css';
|
@import './blocks/press-ressources.css';
|
||||||
|
@import './blocks/document-card.css';
|
||||||
|
@import './blocks/wp-block-file.css';
|
||||||
@import './blocks/wp-block-heading.css';
|
@import './blocks/wp-block-heading.css';
|
||||||
@import './blocks/wp-block-list.css';
|
@import './blocks/wp-block-list.css';
|
||||||
@import './blocks/wp-block-list-is-iconed-list.css';
|
@import './blocks/wp-block-list-is-iconed-list.css';
|
||||||
|
|
@ -107,6 +109,7 @@
|
||||||
@import './blocks/wp-block-details.css';
|
@import './blocks/wp-block-details.css';
|
||||||
@import './blocks/wp-block-image.css';
|
@import './blocks/wp-block-image.css';
|
||||||
@import './blocks/wp-block-buttons.css';
|
@import './blocks/wp-block-buttons.css';
|
||||||
|
@import './blocks/explore-tags.css';
|
||||||
|
|
||||||
@import './blocks/variants.css';
|
@import './blocks/variants.css';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,10 @@ h2.chapter-section__title {
|
||||||
font-family: 'Nunito Sans', sans-serif !important;
|
font-family: 'Nunito Sans', sans-serif !important;
|
||||||
}
|
}
|
||||||
.subtitle-big {
|
.subtitle-big {
|
||||||
@apply text-4xl md:text-5xl font-normal uppercase fjalla pb-6;
|
@apply text-4xl md:!text-5xl font-normal uppercase fjalla pb-6;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
@screen lg {
|
@screen lg {
|
||||||
line-height: 1.3;
|
line-height: 1.3 !important;
|
||||||
}
|
}
|
||||||
/* text-rendering: geometricPrecision; */
|
/* text-rendering: geometricPrecision; */
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,17 @@
|
||||||
&--variant-backgrounded {
|
&--variant-backgrounded {
|
||||||
background-color: var(--content-box-background-color, transparent);
|
background-color: var(--content-box-background-color, transparent);
|
||||||
}
|
}
|
||||||
|
&--variant-framed-backgrounded {
|
||||||
|
@apply border border-carhop-green-600;
|
||||||
|
background-color: var(--content-box-background-color, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
&.alignwide, &.aligncontained {
|
&.alignwide,
|
||||||
|
&.aligncontained {
|
||||||
@apply !mx-auto;
|
@apply !mx-auto;
|
||||||
}
|
}
|
||||||
&.aligncontained {
|
&.aligncontained {
|
||||||
@apply !max-w-screen-lg ;
|
@apply !max-w-screen-lg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* &.alignwide {
|
/* &.alignwide {
|
||||||
@apply max-w-screen-lg;
|
@apply max-w-screen-lg;
|
||||||
|
|
@ -58,16 +60,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__innerblocks {
|
&__innerblocks {
|
||||||
@apply mx-auto px-4 md:px-8;
|
@apply mx-auto px-4 md:px-8;
|
||||||
>:not(.alignwide):not(.alignfull) {
|
> :not(.alignwide):not(.alignfull) {
|
||||||
@apply max-w-screen-lg mx-auto ;
|
@apply max-w-screen-lg mx-auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
&.alignwide .content-box__innerblocks{
|
&.alignwide .content-box__innerblocks {
|
||||||
>:not(.alignfull) {
|
> :not(.alignfull) {
|
||||||
@apply max-w-screen-xl mx-auto ;
|
@apply max-w-screen-xl mx-auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h3 {
|
h3 {
|
||||||
/* @apply title-small font-bold; */
|
/* @apply title-small font-bold; */
|
||||||
|
|
@ -139,6 +140,7 @@ body.wp-admin.post-type-articles .content-box,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.single-activites .content-box,
|
||||||
body.wp-admin.post-type-page .content-box,
|
body.wp-admin.post-type-page .content-box,
|
||||||
body.page .content-box {
|
body.page .content-box {
|
||||||
@apply py-16;
|
@apply py-16;
|
||||||
|
|
|
||||||
47
resources/css/blocks/document-card.css
Normal file
47
resources/css/blocks/document-card.css
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
.wp-block-carhop-blocks-document-card {
|
||||||
|
@apply border border-solid border-primary p-8 bg-white grid items-center mb-6;
|
||||||
|
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
@apply content-[''] block !w-20 !h-20 bg-center bg-no-repeat;
|
||||||
|
transition: transform 0.3s ease-in-out;
|
||||||
|
background-image: url('../resources/img/carhop-fleche-full-green_down.svg') !important;
|
||||||
|
transform: translateY(-5px);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:after {
|
||||||
|
transform: translateY(14px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file_info {
|
||||||
|
@apply flex items-center text-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-block-carhop-blocks-heading {
|
||||||
|
@apply !pb-4;
|
||||||
|
.carhop-heading__innerblocks {
|
||||||
|
@apply !gap-2;
|
||||||
|
}
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
@apply nunito !normal-case !tracking-wide;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
@apply !text-3xl;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ .file_info {
|
||||||
|
@apply !mt-4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
@apply mb-4;
|
||||||
|
}
|
||||||
|
}
|
||||||
54
resources/css/blocks/explore-tags.css
Normal file
54
resources/css/blocks/explore-tags.css
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
.explore-tags {
|
||||||
|
@apply bg-carhop-purple-100 py-24 px-4 md:px-12 xl:px-24;
|
||||||
|
&.alignfull {
|
||||||
|
@apply !my-0;
|
||||||
|
}
|
||||||
|
.inner {
|
||||||
|
@apply max-w-screen-2xl mx-auto;
|
||||||
|
@apply lg:flex gap-16 xl:gap-32;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__subtitle {
|
||||||
|
br {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
@screen lg {
|
||||||
|
br {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tag-list {
|
||||||
|
@apply flex gap-6 flex-wrap;
|
||||||
|
|
||||||
|
&__tag {
|
||||||
|
@apply text-lg font-normal border border-primary p-4 h-fit flex items-center gap-2;
|
||||||
|
svg {
|
||||||
|
transition: transform 0.3s ease-in-out;
|
||||||
|
@apply w-8 h-8;
|
||||||
|
circle {
|
||||||
|
@apply fill-primary stroke-transparent;
|
||||||
|
}
|
||||||
|
path {
|
||||||
|
@apply stroke-white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
@apply bg-primary text-white;
|
||||||
|
svg {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
circle {
|
||||||
|
@apply fill-white;
|
||||||
|
}
|
||||||
|
path {
|
||||||
|
@apply stroke-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-website-carhop .explore-tags {
|
||||||
|
@apply bg-carhop-orange-50;
|
||||||
|
}
|
||||||
38
resources/css/blocks/wp-block-file.css
Normal file
38
resources/css/blocks/wp-block-file.css
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
.wp-block-file {
|
||||||
|
@apply text-primary font-semibold !text-lg flex gap-2 items-center;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
a:not([download]) {
|
||||||
|
&:hover {
|
||||||
|
@apply underline underline-offset-8;
|
||||||
|
}
|
||||||
|
&:after {
|
||||||
|
content: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a[download] {
|
||||||
|
@apply bg-transparent !text-white !no-underline inline-flex items-center gap-12 relative w-10 h-10 ml-4;
|
||||||
|
color: transparent !important;
|
||||||
|
font-size: 0; /* Réduit l'espace occupé */
|
||||||
|
text-indent: -9999px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
@apply w-10 h-10 bg-transparent absolute top-0 left-0;
|
||||||
|
background-image: url('../resources/img/icons/button-arrow-down-small.svg');
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
content: ' ';
|
||||||
|
display: block;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
a[download] {
|
||||||
|
transform: translateY(3px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -17,4 +17,6 @@
|
||||||
border-left: none !important;
|
border-left: none !important;
|
||||||
border-right: none !important;
|
border-right: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@apply mb-12;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,30 @@
|
||||||
@apply text-2xl uppercase font-medium tracking-normal;
|
@apply text-2xl uppercase font-medium tracking-normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.author-card__author-status {
|
||||||
|
@apply flex items-center gap-2;
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
@apply block w-6 h-6 bg-no-repeat bg-center;
|
||||||
|
background-image: url('../resources/img/icons/icon-plume2.svg');
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--author:before {
|
||||||
|
background-image: url('../resources/img/icons/carhop-plume2.svg');
|
||||||
|
}
|
||||||
|
&--main-author:before {
|
||||||
|
@apply w-8 h-8;
|
||||||
|
transform: translateY(-5px);
|
||||||
|
background-image: url('../resources/img/icons/carhop-auteur-principal.svg');
|
||||||
|
}
|
||||||
|
&--publication-director:before {
|
||||||
|
@apply w-6 h-6;
|
||||||
|
background-image: url('../resources/img/icons/carhop-auteur-directeur.svg');
|
||||||
|
}
|
||||||
|
}
|
||||||
.author-card__articles-amount {
|
.author-card__articles-amount {
|
||||||
@apply text-primary font-normal flex items-center gap-2;
|
@apply text-primary font-normal flex items-center gap-2;
|
||||||
|
|
||||||
|
|
|
||||||
12
resources/css/components/authors-list.css
Normal file
12
resources/css/components/authors-list.css
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
.authors-list {
|
||||||
|
@apply mb-20;
|
||||||
|
&__title {
|
||||||
|
@apply text-3xl font-medium mb-4 uppercase;
|
||||||
|
}
|
||||||
|
&__article-title {
|
||||||
|
@apply mb-8 underline underline-offset-8 decoration-1 opacity-90;
|
||||||
|
}
|
||||||
|
.author-card {
|
||||||
|
@apply mb-8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,9 @@
|
||||||
@apply grid gap-6;
|
@apply grid gap-6;
|
||||||
grid-template-columns: 1fr 3fr;
|
grid-template-columns: 1fr 3fr;
|
||||||
}
|
}
|
||||||
|
&.post-card--has-numerotation.post-card--has-thumbnail {
|
||||||
|
grid-template-columns: 1fr 3fr;
|
||||||
|
}
|
||||||
|
|
||||||
&__thumbnail {
|
&__thumbnail {
|
||||||
@apply bg-white border border-solid border-primary p-2 h-fit grayscale hover:grayscale-0;
|
@apply bg-white border border-solid border-primary p-2 h-fit grayscale hover:grayscale-0;
|
||||||
|
|
@ -25,7 +28,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
h3.card__title {
|
h3.card__title {
|
||||||
@apply mb-6;
|
@apply mb-6 text-2xl uppercase;
|
||||||
}
|
}
|
||||||
.card__details {
|
.card__details {
|
||||||
@apply flex flex-col gap-3;
|
@apply flex flex-col gap-3;
|
||||||
|
|
@ -52,22 +55,32 @@
|
||||||
|
|
||||||
&__authors {
|
&__authors {
|
||||||
/* @apply flex flex-wrap gap-2; */
|
/* @apply flex flex-wrap gap-2; */
|
||||||
@apply flex flex-wrap gap-x-8 gap-y-2;
|
@apply flex flex-wrap gap-x-6 gap-y-2;
|
||||||
li {
|
li {
|
||||||
@apply text-lg flex items-center gap-2;
|
@apply text-lg flex items-center gap-2;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
|
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
|
||||||
content: '';
|
content: '';
|
||||||
@apply filter-primary;
|
/* @apply filter-primary; */
|
||||||
}
|
}
|
||||||
|
|
||||||
&.author::before {
|
&.author::before {
|
||||||
background-image: url('../resources/img/icons/carhop-plume2.svg');
|
background-image: url('../resources/img/icons/carhop-plume2.svg');
|
||||||
}
|
}
|
||||||
|
&.main-author::before {
|
||||||
|
width: 2.15rem;
|
||||||
|
height: 2.15rem;
|
||||||
|
transform: translateY(-5px);
|
||||||
|
background-image: url('../resources/img/icons/carhop-auteur-principal.svg');
|
||||||
|
}
|
||||||
&.editor::before {
|
&.editor::before {
|
||||||
background-image: url('../resources/img/icons/carhop-bookmark.svg');
|
background-image: url('../resources/img/icons/carhop-bookmark.svg');
|
||||||
}
|
}
|
||||||
|
&.publication-director::before {
|
||||||
|
@apply w-8 h-8;
|
||||||
|
background-image: url('../resources/img/icons/carhop-auteur-directeur.svg');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&__details-text {
|
&__details-text {
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,28 @@
|
||||||
@apply uppercase font-medium text-4xl md:text-5xl lg:text-5xl text-white;
|
@apply uppercase font-medium text-4xl md:text-5xl lg:text-5xl text-white;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
&__main-author {
|
&__main-author,
|
||||||
|
&__first-author {
|
||||||
@apply text-white font-light tracking-wide flex items-center gap-3 mt-4;
|
@apply text-white font-light tracking-wide flex items-center gap-3 mt-4;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
|
@apply w-6 h-6 block bg-no-repeat bg-center bg-contain;
|
||||||
content: '';
|
content: '';
|
||||||
background-image: url('../resources/img/icons/carhop-plume2.svg');
|
|
||||||
filter: invert(1) brightness(0) saturate(100%) invert(100%);
|
filter: invert(1) brightness(0) saturate(100%) invert(100%);
|
||||||
}
|
}
|
||||||
&:hover {
|
&:hover {
|
||||||
@apply underline underline-offset-8;
|
@apply underline underline-offset-8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__first-author::before {
|
||||||
|
background-image: url('../resources/img/icons/carhop-plume2.svg');
|
||||||
|
}
|
||||||
|
&__main-author::before {
|
||||||
|
@apply w-8 h-8;
|
||||||
|
transform: translateY(-5px);
|
||||||
|
background-image: url('../resources/img/icons/carhop-auteur-principal.svg');
|
||||||
|
}
|
||||||
&__inner {
|
&__inner {
|
||||||
@apply mx-auto grid gap-24;
|
@apply mx-auto grid gap-24;
|
||||||
@screen xl {
|
@screen xl {
|
||||||
|
|
|
||||||
|
|
@ -43,3 +43,42 @@ body {
|
||||||
.block-editor-block-list__block.wp-block-carhop-blocks-heading {
|
.block-editor-block-list__block.wp-block-carhop-blocks-heading {
|
||||||
@apply mx-auto;
|
@apply mx-auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wp-block-file {
|
||||||
|
.wp-block-file__content-wrapper {
|
||||||
|
@apply flex gap-2 items-center;
|
||||||
|
}
|
||||||
|
[data-wp-block-attribute-key='fileName'] {
|
||||||
|
@apply underline-offset-8;
|
||||||
|
}
|
||||||
|
[data-wp-block-attribute-key='downloadButtonText'] {
|
||||||
|
@apply relative w-10 h-10 bg-transparent inline-flex items-center gap-12;
|
||||||
|
color: transparent !important;
|
||||||
|
font-size: 0; /* Réduit l'espace occupé */
|
||||||
|
text-indent: -9999px;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
@apply w-10 h-10 bg-transparent absolute top-0 left-0;
|
||||||
|
background-image: url('../resources/img/icons/button-arrow-down-small.svg');
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
content: ' ';
|
||||||
|
display: block;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* @apply text-primary font-semibold !text-lg flex gap-2 items-center;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
|
a:not([download]) {
|
||||||
|
&:hover {
|
||||||
|
@apply underline underline-offset-8;
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
}
|
||||||
|
|
||||||
|
.wp-block-carhop-blocks-document-card:focus:after {
|
||||||
|
@apply !static;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,3 +98,11 @@ details {
|
||||||
@apply text-primary;
|
@apply text-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h3.wp-block-heading:has(+ .wp-block-table) {
|
||||||
|
@apply nunito text-base tracking-widest;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .wp-block-table + h3.wp-block-heading {
|
||||||
|
@apply mt-16;
|
||||||
|
} */
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,10 @@
|
||||||
@apply flex gap-4;
|
@apply flex gap-4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-area .alignfull {
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
margin: 0 calc(-50vw + 50% + 24.26%) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,11 @@
|
||||||
@apply hidden;
|
@apply hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&[data-active-tab='informations'] {
|
||||||
|
#post-authors,
|
||||||
|
.post-content {
|
||||||
|
@apply hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
resources/img/carhop-fleche-full-green_down.svg
Normal file
6
resources/img/carhop-fleche-full-green_down.svg
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg id="fleche-full" xmlns="http://www.w3.org/2000/svg" width="77" height="77" viewBox="0 0 77 77">
|
||||||
|
<path d="M39.5,50.8v-23.1" style="fill: none; stroke: #146f63; stroke-width: 2px;"/>
|
||||||
|
<path d="M25.4,36.1l14.2,14.7,14.2-14.7" style="fill: none; stroke: #146f63; stroke-width: 2px;"/>
|
||||||
|
<circle cx="38.5" cy="38.5" r="37.5" style="fill: none; stroke: #146f63; stroke-width: 2px;"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
14
resources/img/icons/carhop-auteur-directeur.svg
Normal file
14
resources/img/icons/carhop-auteur-directeur.svg
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<svg width="26" height="27" viewBox="0 0 26 27" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_3654_30453)">
|
||||||
|
<path d="M19.5281 6.71179H0.765625V10.1059V26.2339H19.5281V6.71179Z" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M19.5258 21.5909H25.2348V0.766235H5.22656V6.71175" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M16.463 11.8988L15.1714 12.7799V17.4995L7.07031 22.0046L8.0562 13.2012L12.3131 10.9487L12.3819 9.30908" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M7.07031 22.0046L10.4254 16.9631" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M3.21875 22.8245H7.0706" stroke="#136F63" stroke-width="2"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_3654_30453">
|
||||||
|
<rect width="26" height="27" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 750 B |
13
resources/img/icons/carhop-auteur-principal.svg
Normal file
13
resources/img/icons/carhop-auteur-principal.svg
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<svg width="29" height="28" viewBox="0 0 29 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_3654_19489)">
|
||||||
|
<path d="M17.466 13.1028L15.7614 14.2747V20.5661L5.08594 26.5718L6.37884 14.8313L11.991 11.8285L12.0849 9.64587" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M5.08594 26.5719L9.50636 19.8557" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M0 27.2676H5.08493" stroke="#136F63" stroke-width="2"/>
|
||||||
|
<path d="M22.6816 1.03366L17.375 6.41455L22.6816 11.7954L27.9881 6.41455L22.6816 1.03366Z" stroke="#136F63" stroke-width="2"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_3654_19489">
|
||||||
|
<rect width="29" height="28" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 671 B |
|
|
@ -1,140 +1,159 @@
|
||||||
|
|
||||||
//post-grid__toolbar-actions
|
//post-grid__toolbar-actions
|
||||||
|
|
||||||
export default function archivesInit() {
|
export default function archivesInit() {
|
||||||
|
const isArchivePage = document.querySelector('body.archive');
|
||||||
|
if (!isArchivePage) return;
|
||||||
|
|
||||||
const isArchivePage = document.querySelector('body.archive');
|
const toolbar = document.querySelector('.post-grid__toolbar');
|
||||||
if (!isArchivePage) return;
|
if (!toolbar) return;
|
||||||
|
|
||||||
|
const postGridToolbarActions = toolbar.querySelector('.post-grid__toolbar-actions');
|
||||||
const toolbar = document.querySelector('.post-grid__toolbar');
|
const currentPostType = postGridToolbarActions?.getAttribute(
|
||||||
if (!toolbar) return;
|
'data-post-type',
|
||||||
|
) as string;
|
||||||
const postGridToolbarActions = toolbar.querySelector('.post-grid__toolbar-actions');
|
const etiquettesSelect = toolbar.querySelector(
|
||||||
const currentPostType = postGridToolbarActions?.getAttribute('data-post-type') as string;
|
'select[name="etiquettes"]',
|
||||||
const etiquettesSelect = toolbar.querySelector('select[name="etiquettes"]') as HTMLSelectElement;
|
) as HTMLSelectElement;
|
||||||
const auteursSelect = toolbar.querySelector('select[name="auteurs"]') as HTMLSelectElement;
|
const auteursSelect = toolbar.querySelector(
|
||||||
const sortBySelect = toolbar.querySelector('select[name="sort_by"]') as HTMLSelectElement;
|
'select[name="auteurs"]',
|
||||||
const rechercheInput = toolbar.querySelector('.search-bar input') as HTMLInputElement;
|
) as HTMLSelectElement;
|
||||||
|
const sortBySelect = toolbar.querySelector(
|
||||||
console.log('currentPostType', currentPostType);
|
'select[name="sort_by"]',
|
||||||
console.log('etiquettesSelect', etiquettesSelect);
|
) as HTMLSelectElement;
|
||||||
console.log('auteursSelect', auteursSelect);
|
const rechercheInput = toolbar.querySelector('.search-bar input') as HTMLInputElement;
|
||||||
console.log('sortBySelect', sortBySelect);
|
|
||||||
console.log('rechercheInput', rechercheInput);
|
|
||||||
|
|
||||||
// Évite les courses: annule les requêtes précédentes et ignore les réponses obsolètes
|
// Évite les courses: annule les requêtes précédentes et ignore les réponses obsolètes
|
||||||
let currentAbortController: AbortController | null = null;
|
let currentAbortController: AbortController | null = null;
|
||||||
let lastRequestId = 0;
|
let lastRequestId = 0;
|
||||||
|
|
||||||
|
// Debounce simple pour la recherche
|
||||||
|
function debounce<T extends (...args: any[]) => void>(fn: T, waitMs: number) {
|
||||||
|
let timeoutId: number | undefined;
|
||||||
|
return (...args: Parameters<T>) => {
|
||||||
|
if (timeoutId) window.clearTimeout(timeoutId);
|
||||||
|
timeoutId = window.setTimeout(() => fn(...args), waitMs);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Debounce simple pour la recherche
|
async function hydratePosts() {
|
||||||
function debounce<T extends (...args: any[]) => void>(fn: T, waitMs: number) {
|
const etiquetteValue = etiquettesSelect?.value ?? '';
|
||||||
let timeoutId: number | undefined;
|
const auteurValue = auteursSelect?.value ?? '';
|
||||||
return (...args: Parameters<T>) => {
|
const sortByValue = sortBySelect?.value ?? '';
|
||||||
if (timeoutId) window.clearTimeout(timeoutId);
|
const rechercheValue = rechercheInput?.value ?? '';
|
||||||
timeoutId = window.setTimeout(() => fn(...args), waitMs);
|
const postTypeValue = currentPostType ?? '';
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
async function hydratePosts() {
|
const params = new URLSearchParams({
|
||||||
|
etiquette: etiquetteValue,
|
||||||
const etiquetteValue = etiquettesSelect?.value ?? '';
|
auteur: auteurValue,
|
||||||
const auteurValue = auteursSelect?.value ?? '';
|
sort_by: sortByValue,
|
||||||
const sortByValue = sortBySelect?.value ?? '';
|
recherche: rechercheValue,
|
||||||
const rechercheValue = rechercheInput?.value ?? '';
|
post_type: postTypeValue,
|
||||||
const postTypeValue = currentPostType ?? '';
|
|
||||||
|
|
||||||
|
|
||||||
const params = new URLSearchParams({
|
|
||||||
etiquette: etiquetteValue,
|
|
||||||
auteur: auteurValue,
|
|
||||||
sort_by: sortByValue,
|
|
||||||
recherche: rechercheValue,
|
|
||||||
post_type: postTypeValue,
|
|
||||||
});
|
|
||||||
console.log(params.toString());
|
|
||||||
const url = `/wp-json/carhop-datas/v1/build/posts?${params.toString()}`;
|
|
||||||
|
|
||||||
|
|
||||||
// Annule la précédente et prépare un nouvel identifiant
|
|
||||||
if (currentAbortController) currentAbortController.abort();
|
|
||||||
currentAbortController = new AbortController();
|
|
||||||
const requestId = ++lastRequestId;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetch(url, { signal: currentAbortController.signal });
|
|
||||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
console.log('data', data);
|
|
||||||
|
|
||||||
// Ignore si une requête plus récente a été envoyée
|
|
||||||
if (requestId !== lastRequestId) return;
|
|
||||||
|
|
||||||
const articlesContainer = document.querySelector('.post-grid__list');
|
|
||||||
if (!articlesContainer) return;
|
|
||||||
articlesContainer.innerHTML = data.html_template;
|
|
||||||
|
|
||||||
updatePostCount(data.post_count);
|
|
||||||
} catch (error) {
|
|
||||||
if ((error as any)?.name === 'AbortError') return;
|
|
||||||
console.error('Erreur lors de la récupération des articles:', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const hydratePostsDebounced = debounce(hydratePosts, 150);
|
|
||||||
|
|
||||||
function resetCurrentFilters() {
|
|
||||||
if (!etiquettesSelect || !auteursSelect || !rechercheInput) return;
|
|
||||||
|
|
||||||
etiquettesSelect.value = '';
|
|
||||||
auteursSelect.value = '';
|
|
||||||
rechercheInput.value = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function setFilterByActivebutton(button: HTMLButtonElement) {
|
|
||||||
const filterByButtons = document.querySelectorAll('.search-by button');
|
|
||||||
if (!filterByButtons) return;
|
|
||||||
filterByButtons.forEach((button) => {
|
|
||||||
button.setAttribute('aria-selected', 'false');
|
|
||||||
});
|
|
||||||
button.setAttribute('aria-selected', 'true');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function handleFilterPostsBy() {
|
|
||||||
const filterByButtons = document.querySelectorAll('.search-by button');
|
|
||||||
if (!filterByButtons) return;
|
|
||||||
filterByButtons.forEach((button) => {
|
|
||||||
button.addEventListener('click', (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setFilterByActivebutton(button as HTMLButtonElement);
|
|
||||||
resetCurrentFilters();
|
|
||||||
hydratePosts(); // immédiat sur action explicite
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
auteursSelect.addEventListener('change', (e) => {
|
|
||||||
hydratePosts();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
etiquettesSelect.addEventListener('change', (e) => {
|
const url = `/wp-json/carhop-datas/v1/build/posts?${params.toString()}`;
|
||||||
hydratePosts();
|
|
||||||
});
|
|
||||||
|
|
||||||
sortBySelect.addEventListener('change', (e) => {
|
// Annule la précédente et prépare un nouvel identifiant
|
||||||
hydratePosts(); // immédiat pour le tri
|
if (currentAbortController) currentAbortController.abort();
|
||||||
});
|
currentAbortController = new AbortController();
|
||||||
rechercheInput.addEventListener('input', (e) => {
|
const requestId = ++lastRequestId;
|
||||||
hydratePostsDebounced(); // debounce pour la saisie rapide
|
|
||||||
});
|
|
||||||
handleFilterPostsBy();
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(url, { signal: currentAbortController.signal });
|
||||||
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
postGridToolbarActions.addEventListener('click', (e) => {
|
console.log('data', data);
|
||||||
|
|
||||||
|
// Ignore si une requête plus récente a été envoyée
|
||||||
|
if (requestId !== lastRequestId) return;
|
||||||
|
|
||||||
|
const articlesContainer = document.querySelector('.post-grid__list');
|
||||||
|
if (!articlesContainer) return;
|
||||||
|
articlesContainer.innerHTML = data.html_template;
|
||||||
|
|
||||||
|
updatePostCount(data.post_count);
|
||||||
|
} catch (error) {
|
||||||
|
if ((error as any)?.name === 'AbortError') return;
|
||||||
|
console.error('Erreur lors de la récupération des articles:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const hydratePostsDebounced = debounce(hydratePosts, 150);
|
||||||
|
|
||||||
|
function resetCurrentFilters() {
|
||||||
|
if (!etiquettesSelect || !auteursSelect || !rechercheInput) return;
|
||||||
|
|
||||||
|
etiquettesSelect.value = '';
|
||||||
|
auteursSelect.value = '';
|
||||||
|
rechercheInput.value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function setFilterByActivebutton(button: HTMLButtonElement) {
|
||||||
|
const filterByButtons = document.querySelectorAll('.search-by button');
|
||||||
|
if (!filterByButtons) return;
|
||||||
|
filterByButtons.forEach((button) => {
|
||||||
|
button.setAttribute('aria-selected', 'false');
|
||||||
|
});
|
||||||
|
button.setAttribute('aria-selected', 'true');
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleFilterPostsBy() {
|
||||||
|
const filterByButtons = document.querySelectorAll('.search-by button');
|
||||||
|
if (!filterByButtons) return;
|
||||||
|
filterByButtons.forEach((button) => {
|
||||||
|
button.addEventListener('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
setFilterByActivebutton(button as HTMLButtonElement);
|
||||||
|
resetCurrentFilters();
|
||||||
|
hydratePosts(); // immédiat sur action explicite
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auteursSelect.addEventListener('change', (e) => {
|
||||||
|
hydratePosts();
|
||||||
|
});
|
||||||
|
|
||||||
|
etiquettesSelect.addEventListener('change', (e) => {
|
||||||
|
hydratePosts();
|
||||||
|
});
|
||||||
|
|
||||||
|
sortBySelect.addEventListener('change', (e) => {
|
||||||
|
hydratePosts(); // immédiat pour le tri
|
||||||
|
});
|
||||||
|
rechercheInput.addEventListener('input', (e) => {
|
||||||
|
hydratePostsDebounced(); // debounce pour la saisie rapide
|
||||||
|
});
|
||||||
|
handleFilterPostsBy();
|
||||||
|
|
||||||
|
postGridToolbarActions.addEventListener('click', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePostCount(count: number) {
|
||||||
|
const postCount = document.querySelector('.post-count__count');
|
||||||
|
if (!postCount) return;
|
||||||
|
postCount.innerHTML = count.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
function scrollToPostsGridIfHasInitialFilter() {
|
||||||
|
const postsGrid = document.querySelector('.post-grid');
|
||||||
|
const hasInitialFilter = postsGrid?.classList.contains('has-initial-filter');
|
||||||
|
if (!hasInitialFilter || !postsGrid) return;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
postsGrid.scrollIntoView({ behavior: 'smooth' });
|
||||||
|
}, 200);
|
||||||
|
setTimeout(() => {
|
||||||
|
const etiquettesSelect = document.querySelector(
|
||||||
|
'.post-grid__toolbar-actions select[name="etiquettes"]',
|
||||||
|
) as HTMLSelectElement;
|
||||||
|
if (!etiquettesSelect) return;
|
||||||
|
etiquettesSelect.focus();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
scrollToPostsGridIfHasInitialFilter();
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -30,14 +30,9 @@ $postType = get_post_type();
|
||||||
)); ?>
|
)); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php endwhile; ?>
|
<?php endwhile; ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php echo do_blocks('<!-- wp:carhop-blocks/explore-tags /-->'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,54 @@
|
||||||
$postId = $args['postId'];
|
$postId = $args['postId'];
|
||||||
$componentTitle = 'Auteur·e·s de l\'article';
|
$componentTitle = 'Auteur·e·s de l\'article';
|
||||||
$authors = get_field('authors', $postId);
|
$authors = get_field('authors', $postId);
|
||||||
|
$has_main_author = get_field('has_main_author', $postId);
|
||||||
|
$main_author = get_field('main_author', $postId);
|
||||||
|
|
||||||
|
$show_author_status = $has_main_author && $main_author ? true : false;
|
||||||
|
|
||||||
|
$has_publication_direction = get_field('has_publication_direction', $postId);
|
||||||
|
$publication_directors = get_field('publication_directors', $postId);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<section class="authors-list">
|
<section class="authors-list">
|
||||||
<h3 class="authors-list__title"><?php echo $componentTitle; ?></h3>
|
<h3 class="authors-list__title"><?php echo $componentTitle; ?></h3>
|
||||||
|
|
||||||
<?php foreach ($authors as $author) : ?>
|
|
||||||
|
|
||||||
|
<?php if ($has_main_author && $main_author) : ?>
|
||||||
|
<?php get_template_part(
|
||||||
|
'template-parts/components/cards/author-card',
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'ID' => $main_author->ID,
|
||||||
|
'show_author_status' => $show_author_status,
|
||||||
|
'author_status' => 'main-author',
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php foreach ($authors as $author) : ?>
|
||||||
<?php get_template_part(
|
<?php get_template_part(
|
||||||
'template-parts/components/cards/author-card',
|
'template-parts/components/cards/author-card',
|
||||||
null,
|
null,
|
||||||
array(
|
array(
|
||||||
'ID' => $author->ID,
|
'ID' => $author->ID,
|
||||||
|
'show_author_status' => $show_author_status,
|
||||||
|
'author_status' => 'author',
|
||||||
)
|
)
|
||||||
); ?>
|
); ?>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($has_publication_direction && $publication_directors) : ?>
|
||||||
|
<h3 class="authors-list__title"><?php echo "Sous la direction de"; ?></h3>
|
||||||
|
<?php foreach ($publication_directors as $publication_director) : ?>
|
||||||
|
|
||||||
|
<?php get_template_part(
|
||||||
|
'template-parts/components/cards/author-card',
|
||||||
|
null,
|
||||||
|
array(
|
||||||
|
'ID' => $publication_director->ID,
|
||||||
|
'show_author_status' => $show_author_status,
|
||||||
|
'author_status' => 'publication-director',
|
||||||
|
)
|
||||||
|
); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -4,22 +4,23 @@ $posts_query = $args['posts_query'] ?? null;
|
||||||
$post_count = $posts_query->post_count;
|
$post_count = $posts_query->post_count;
|
||||||
$current_post_type_obj = get_post_type_object($current_post_type);
|
$current_post_type_obj = get_post_type_object($current_post_type);
|
||||||
|
|
||||||
|
$etiquette_active_filter_slug = $args['etiquette_active_filter_slug'] ?? null;
|
||||||
|
|
||||||
$post_ids = wp_list_pluck($posts_query->posts, 'ID');
|
$post_ids = wp_list_pluck($posts_query->posts, 'ID');
|
||||||
|
|
||||||
$types = get_terms(array(
|
$types = get_terms(array(
|
||||||
'taxonomy' => 'type',
|
'taxonomy' => 'type',
|
||||||
'hide_empty' => true,
|
'hide_empty' => true,
|
||||||
));
|
));
|
||||||
|
|
||||||
$authors = get_authors_linked_to_posts($post_ids);
|
$authors = get_authors_linked_to_posts($post_ids);
|
||||||
$tags = get_terms(array(
|
$tags = get_terms(array(
|
||||||
'taxonomy' => 'etiquettes',
|
'taxonomy' => 'etiquettes',
|
||||||
'hide_empty' => true,
|
'hide_empty' => true,
|
||||||
'object_ids' => $post_ids,
|
'object_ids' => $post_ids,
|
||||||
));
|
));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="post-grid__toolbar">
|
<div class="post-grid__toolbar">
|
||||||
<div class="search-by">
|
<div class="search-by">
|
||||||
|
|
@ -39,7 +40,7 @@ $tags = get_terms(array(
|
||||||
<select name="etiquettes">
|
<select name="etiquettes">
|
||||||
<option value=""><?php _e('Tous les tags', 'dynamiques'); ?></option>
|
<option value=""><?php _e('Tous les tags', 'dynamiques'); ?></option>
|
||||||
<?php foreach ($tags as $tag) : ?>
|
<?php foreach ($tags as $tag) : ?>
|
||||||
<option value="<?php echo $tag->slug; ?>"><?php echo $tag->name; ?></option>
|
<option value="<?php echo $tag->slug; ?>" <?php selected($etiquette_active_filter_slug, $tag->slug); ?>><?php echo $tag->name; ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -71,4 +72,4 @@ $tags = get_terms(array(
|
||||||
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
|
<option value="date_asc"><?php _e('Numéros anciens en premier', 'dynamiques'); ?></option>
|
||||||
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
|
<option value="title_asc"><?php _e('Par ordre alphabétique', 'dynamiques'); ?></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -3,21 +3,43 @@ $post_amount = $args['post_amount'] ?? -1;
|
||||||
$grid_title = $args['grid_title'] ?? 'Trouver une publication';
|
$grid_title = $args['grid_title'] ?? 'Trouver une publication';
|
||||||
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
$current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||||
|
|
||||||
$posts_query = new WP_Query(array(
|
// Récupérer le paramètre etiquette de l'URL
|
||||||
|
$etiquette_slug = isset($_GET['etiquette']) ? sanitize_text_field($_GET['etiquette']) : '';
|
||||||
|
|
||||||
|
|
||||||
|
// Construire les arguments de la query
|
||||||
|
$query_args = array(
|
||||||
'post_type' => $current_post_type,
|
'post_type' => $current_post_type,
|
||||||
'posts_per_page' => $post_amount
|
'posts_per_page' => $post_amount,
|
||||||
));
|
'post_status' => 'publish',
|
||||||
|
);
|
||||||
|
|
||||||
|
// Si on a une étiquette, ajouter le filtre taxonomy
|
||||||
|
if (!empty($etiquette_slug)) {
|
||||||
|
$query_args['tax_query'] = array(
|
||||||
|
array(
|
||||||
|
'taxonomy' => 'etiquettes',
|
||||||
|
'field' => 'slug',
|
||||||
|
'terms' => $etiquette_slug,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$posts_query = new WP_Query($query_args);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<section class="post-grid content-section">
|
<section class="post-grid content-section <?php echo !empty($etiquette_slug) ? 'has-initial-filter' : '' ?>">
|
||||||
<h2 class="find-publication__title title-small"><?php echo $grid_title; ?></h2>
|
<h2 class="find-publication__title title-small"><?php echo $grid_title; ?></h2>
|
||||||
<div class="content-section__inner">
|
<div class="content-section__inner">
|
||||||
|
|
||||||
<?php get_template_part('template-parts/components/archive/post-grid-toolbar', null, array(
|
<?php get_template_part('template-parts/components/archive/post-grid-toolbar', null, array(
|
||||||
'posts_query' => $posts_query,
|
'posts_query' => $posts_query,
|
||||||
'current_post_type' => $current_post_type,
|
'current_post_type' => $current_post_type,
|
||||||
)); ?>
|
'etiquette_active_filter_slug' => $etiquette_slug,
|
||||||
|
)); ?>
|
||||||
|
|
||||||
<ul class="post-grid__list">
|
<ul class="post-grid__list">
|
||||||
<?php if (isset($posts_query) && $posts_query->have_posts()) : ?>
|
<?php if (isset($posts_query) && $posts_query->have_posts()) : ?>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
$ID = $args['ID'];
|
$ID = $args['ID'] ?? get_the_ID();
|
||||||
|
|
||||||
$name = get_the_title($ID);
|
$name = get_the_title($ID);
|
||||||
$link = get_the_permalink($ID);
|
$link = get_the_permalink($ID);
|
||||||
$profilePicture = get_field('profile_thumbnail', $ID);
|
$profilePicture = get_field('profile_thumbnail', $ID);
|
||||||
|
|
@ -7,6 +8,23 @@ $profilePictureUrl = $profilePicture['url'] ?? '';
|
||||||
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
$profilePictureAlt = $profilePicture['alt'] ?? '';
|
||||||
$description = get_field('description', $ID);
|
$description = get_field('description', $ID);
|
||||||
|
|
||||||
|
$show_author_status = $args['show_author_status'] ?? false;
|
||||||
|
$author_status = $args['author_status'] ?? 'author';
|
||||||
|
$author_status_label = '';
|
||||||
|
|
||||||
|
switch ($author_status) {
|
||||||
|
case 'main-author':
|
||||||
|
$author_status_label = 'Auteur·e principal';
|
||||||
|
break;
|
||||||
|
case 'publication-director':
|
||||||
|
$author_status_label = 'Directeur·e de publication';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case 'author':
|
||||||
|
$author_status_label = 'Auteur·e';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$is_carhop_member = get_field('is_carhop_member', $ID);
|
$is_carhop_member = get_field('is_carhop_member', $ID);
|
||||||
$carhop_member_id = get_field('carhop_member', $ID);
|
$carhop_member_id = get_field('carhop_member', $ID);
|
||||||
|
|
||||||
|
|
@ -32,6 +50,11 @@ if ($is_carhop_member && isset($carhop_member_id)) {
|
||||||
</div>
|
</div>
|
||||||
<div class="author-card__infos">
|
<div class="author-card__infos">
|
||||||
<h3 class="author-card__name"><?php echo $name; ?></h3>
|
<h3 class="author-card__name"><?php echo $name; ?></h3>
|
||||||
|
<?php if ($show_author_status) : ?>
|
||||||
|
<div class="author-card__author-status author-card__author-status--<?php echo $author_status; ?>">
|
||||||
|
<?php echo $author_status_label; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ $current_post_type = $args['current_post_type'] ?? get_post_type();
|
||||||
$title = get_the_title($ID);
|
$title = get_the_title($ID);
|
||||||
$showExcerpt = $args['show_excerpt'] ?? false;
|
$showExcerpt = $args['show_excerpt'] ?? false;
|
||||||
|
|
||||||
|
$showTags = $args['showTags'] ?? true;
|
||||||
|
|
||||||
$excerpt = get_the_excerpt($ID);
|
$excerpt = get_the_excerpt($ID);
|
||||||
$link = get_the_permalink($ID);
|
$link = get_the_permalink($ID);
|
||||||
|
|
||||||
|
|
@ -13,8 +15,14 @@ $thumbnail_url = get_the_post_thumbnail_url($ID) ?? null;
|
||||||
$date = get_the_date('F Y', $ID);
|
$date = get_the_date('F Y', $ID);
|
||||||
|
|
||||||
$authors = get_field('authors', $ID);
|
$authors = get_field('authors', $ID);
|
||||||
|
$has_main_author = get_field('has_main_author', $ID);
|
||||||
|
$main_author = get_field('main_author', $ID);
|
||||||
$editors = get_field('editors', $ID);
|
$editors = get_field('editors', $ID);
|
||||||
|
|
||||||
|
$has_publication_direction = get_field('has_publication_direction', $ID);
|
||||||
|
$publication_directors = get_field('publication_directors', $ID);
|
||||||
|
|
||||||
|
|
||||||
$numerotation = get_post_meta($ID, 'post_numerotation', true);
|
$numerotation = get_post_meta($ID, 'post_numerotation', true);
|
||||||
$tags = get_the_terms($ID, 'etiquettes');
|
$tags = get_the_terms($ID, 'etiquettes');
|
||||||
|
|
||||||
|
|
@ -44,12 +52,21 @@ $tags = get_the_terms($ID, 'etiquettes');
|
||||||
|
|
||||||
<?php if ($authors) : ?>
|
<?php if ($authors) : ?>
|
||||||
<ul class="post-card__authors">
|
<ul class="post-card__authors">
|
||||||
|
<?php if ($has_main_author && $main_author) : ?>
|
||||||
|
<li class="main-author"><?php echo $main_author->post_title; ?></li>
|
||||||
|
<?php endif; ?>
|
||||||
<?php foreach ($authors as $author) : ?>
|
<?php foreach ($authors as $author) : ?>
|
||||||
<li class="author"><?php echo $author->post_title; ?></li>
|
<li class="author"><?php echo $author->post_title; ?></li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php foreach ($editors as $editor) : ?>
|
|
||||||
<li class="editor"><?php echo $editor->post_title; ?></li>
|
<?php if ($has_publication_direction && $publication_directors) : ?>
|
||||||
<?php endforeach; ?>
|
<?php foreach ($publication_directors as $publication_director) : ?>
|
||||||
|
<li class="publication-director">Sous la direction de <?php echo $publication_director->post_title; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($editors) : ?>
|
||||||
|
<li class="editor"><?php echo $editors; ?></li>
|
||||||
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -58,7 +75,7 @@ $tags = get_the_terms($ID, 'etiquettes');
|
||||||
<?php the_post_thumbnail('medium'); ?>
|
<?php the_post_thumbnail('medium'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($tags) : ?>
|
<?php if ($showTags && $tags) : ?>
|
||||||
<ul class="tag-list">
|
<ul class="tag-list">
|
||||||
<?php foreach ($tags as $tag) : ?>
|
<?php foreach ($tags as $tag) : ?>
|
||||||
<li class="tag-list__tag"><?php echo $tag->name; ?></li>
|
<li class="tag-list__tag"><?php echo $tag->name; ?></li>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,11 @@ if ($current_post_type_supports_type) {
|
||||||
|
|
||||||
<?php if ($hasNumerotation) : ?>
|
<?php if ($hasNumerotation) : ?>
|
||||||
<?php
|
<?php
|
||||||
$numerotation = get_post_meta($current_post_id, 'post_numerotation', true); ?>
|
$numerotation = get_current_post_numerotation($current_post_id);
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
<p class="content-meta__revue-issue content-meta__revue-issue--green">
|
<p class="content-meta__revue-issue content-meta__revue-issue--green">
|
||||||
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
|
<span class="revue-issue-number revue-meta__label sr-only">Numéro</span>
|
||||||
<?php echo $numerotation; ?>
|
<?php echo $numerotation; ?>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
// get_template_part('template-parts/authors/authors-last-publications', null, array(
|
// get_template_part('template-parts/authors/authors-last-publications', null, array(
|
||||||
// 'postId' => get_the_ID()
|
// 'postId' => get_the_ID()
|
||||||
// ));
|
// ));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -5,7 +5,12 @@ $post_id = get_the_ID();
|
||||||
$postTitle = get_the_title($post_id);
|
$postTitle = get_the_title($post_id);
|
||||||
$hasNumerotation = hasPostTypeNumerotation($post_id);
|
$hasNumerotation = hasPostTypeNumerotation($post_id);
|
||||||
$hasThumbnail = has_post_thumbnail();
|
$hasThumbnail = has_post_thumbnail();
|
||||||
|
|
||||||
$authors = get_field('authors', $ID);
|
$authors = get_field('authors', $ID);
|
||||||
|
$has_main_author = get_field('has_main_author', $ID);
|
||||||
|
$main_author = get_field('main_author', $ID);
|
||||||
|
|
||||||
|
|
||||||
$post_date_info_label = $args['post_date_info_label'] ?? 'Parution';
|
$post_date_info_label = $args['post_date_info_label'] ?? 'Parution';
|
||||||
$thumbnail_position = $args['thumbnail_position'] ?? 'left';
|
$thumbnail_position = $args['thumbnail_position'] ?? 'left';
|
||||||
$has_thumbnail_overlay = $args['has_thumbnail_overlay'] ?? false;
|
$has_thumbnail_overlay = $args['has_thumbnail_overlay'] ?? false;
|
||||||
|
|
@ -45,8 +50,13 @@ $has_thumbnail_overlay = $args['has_thumbnail_overlay'] ?? false;
|
||||||
)); ?>
|
)); ?>
|
||||||
|
|
||||||
<h1 class="post-header__title"> <?php echo $postTitle; ?></h1>
|
<h1 class="post-header__title"> <?php echo $postTitle; ?></h1>
|
||||||
<?php if ($authors && is_array($authors) && count($authors) > 0) : ?>
|
|
||||||
<a class="post-header__main-author" href="<?php echo get_the_permalink($authors[0]->ID); ?>">
|
<?php if ($has_main_author && $main_author) : ?>
|
||||||
|
<a class="post-header__main-author" href="<?php echo get_the_permalink($main_author->ID); ?>">
|
||||||
|
<?php echo $main_author->post_title; ?>
|
||||||
|
</a>
|
||||||
|
<?php elseif ($authors && is_array($authors) && count($authors) > 0) : ?>
|
||||||
|
<a class="post-header__first-author" href="<?php echo get_the_permalink($authors[0]->ID); ?>">
|
||||||
<?php echo $authors[0]->post_title; ?>
|
<?php echo $authors[0]->post_title; ?>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user