Compare commits

..

No commits in common. "15a6976c4ceadc56aaf58ac2fa3d357a16154efc" and "40b3c9814186aa609a3c54944d94d4ac7f4eed7b" have entirely different histories.

17 changed files with 25 additions and 275 deletions

View File

@ -8,7 +8,6 @@ $current_post_type = get_post_type();
<main id="content" class="site-content flex-grow"> <main id="content" class="site-content flex-grow">
<?php get_template_part('template-parts/post-types/fonds-archives/archive-header'); ?> <?php get_template_part('template-parts/post-types/fonds-archives/archive-header'); ?>
<?php get_template_part('template-parts/components/collective-acess-button'); ?>
<!-- #### ARCHIVE POST GRID #### --> <!-- #### ARCHIVE POST GRID #### -->

View File

@ -35,7 +35,13 @@ function build_posts($request)
'posts_per_page' => $posts_per_page, 'posts_per_page' => $posts_per_page,
); );
write_log(array(
'post_type' => $post_type,
'etiquette' => $etiquette,
'auteur' => $auteur,
'sort_by' => $sort_by,
'recherche' => $recherche,
));
// Gestion du tri // Gestion du tri
switch ($sort_by) { switch ($sort_by) {

View File

@ -442,25 +442,3 @@ function get_current_post_numerotation($post_id)
return null; return null;
} }
function is_a_collections_page()
{
$collection_parent_page_id = 83;
$current_page_id = (int) get_queried_object_id();
if ($collection_parent_page_id === $current_page_id || $is_fond_archive_fonds_archives) {
return true;
}
if ($current_page_id) {
$ancestors = get_post_ancestors($current_page_id, 'page');
if (in_array($collection_parent_page_id, array_map('intval', $ancestors), true)) {
return true;
}
}
return false;
}

View File

@ -6,9 +6,6 @@
while (have_posts()) : while (have_posts()) :
the_post(); the_post();
the_content(); the_content();
if (is_a_collections_page()) {
get_template_part('template-parts/components/collective-acess-button');
}
?> ?>

View File

@ -50,8 +50,7 @@
@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'; @import './components/authors-list.css';
@import './components/collective-access-button.css';
@import './components/slider-card.css';
@import './components/buttons/load-more.css'; @import './components/buttons/load-more.css';
/* ########### EDITOR CONTENT ############ */ /* ########### EDITOR CONTENT ############ */

View File

@ -3,17 +3,9 @@ a {
@apply text-primary; @apply text-primary;
} }
body{
max-width: 100vw;
overflow-x: hidden;
}
main { main {
/* Causing issues with the article sidebar index sticky positioning */ /* Causing issues with the article sidebar index sticky positioning */
/* overflow-x: hidden; */ /* overflow-x: hidden; */
/* overflow-y: clip; */
max-width: 100vw;
& > :last-child { & > :last-child {
margin-bottom: 0px !important; margin-bottom: 0px !important;

View File

@ -59,12 +59,12 @@
&.alignwide, &.alignwide,
&.aligncontained { &.aligncontained {
@apply md:!mx-auto; @apply !mx-auto;
} }
&.aligncontained { &.aligncontained {
/* max-width: calc(960px - 4rem) !important; */ /* max-width: calc(960px - 4rem) !important; */
@apply !max-w-screen-lg ; @apply !max-w-screen-lg;
} }
&.alignwide { &.alignwide {
@media (max-width: 767px) { @media (max-width: 767px) {

View File

@ -1,5 +1,5 @@
.featured-news { .featured-news {
@apply bg-carhop-blue-50 py-20 !my-0 px-4 md:px-10 ; @apply bg-carhop-blue-50 py-20 !my-0;
.swiper-actions-wrapper, .swiper-actions-wrapper,
.swiper-pagination-fraction, .swiper-pagination-fraction,
@ -7,11 +7,6 @@
@apply px-4 md:px-20; @apply px-4 md:px-20;
} }
.swiper-pagination,
.swiper-pagination-fraction{
@apply !px-0;
}
.swiper-wrapper { .swiper-wrapper {
@apply items-end; @apply items-end;
} }

View File

@ -1,10 +0,0 @@
.collective-access-button {
@apply bg-white text-primary px-4 py-4 block w-32 shadow-2xl ;
@apply w-fit top-1/2 right-0 z-50 fixed;
box-sizing: content-box;
transform-origin: center top;
transform: translateY(0%) rotate(-90deg) translateY(55%);
}

View File

@ -83,8 +83,7 @@
height: 1px; height: 1px;
} }
&__input.search-module__search-form__input { &__input {
box-sizing: border-box; box-sizing: border-box;
@apply block max-w-full w-full flex-grow !py-4 !border-white px-4 !pl-12 focus-visible:ring-primary focus-visible:ring-2; @apply block max-w-full w-full flex-grow !py-4 !border-white px-4 !pl-12 focus-visible:ring-primary focus-visible:ring-2;
@apply border rounded-none; @apply border rounded-none;
@ -94,10 +93,6 @@
border-bottom-left-radius: 999px; border-bottom-left-radius: 999px;
border: 1px solid; */ border: 1px solid; */
&:focus-visible {
@apply !pl-12
}
/* box-shadow: 0 0 1px 0px white inset, 0 0 1px 0px white; */ /* box-shadow: 0 0 1px 0px white inset, 0 0 1px 0px white; */
} }
button[type='submit'] { button[type='submit'] {
@ -113,7 +108,7 @@
&__searchbar-group { &__searchbar-group {
@apply w-full flex flex-col md:flex-row gap-y-4 relative; @apply w-full flex flex-col md:flex-row gap-y-4 relative;
&:before { &:before {
@apply content-[''] absolute inset-0 bg-contain bg-center bg-no-repeat w-6 h-6 left-4 top-1/2 -translate-y-1/2 z-20; @apply content-[''] absolute inset-0 bg-contain bg-center bg-no-repeat w-6 h-6 left-4 top-1/2 -translate-y-1/2;
background-image: url('../resources/img/icons/carhop-rechercher.svg'); background-image: url('../resources/img/icons/carhop-rechercher.svg');
filter: invert(1); filter: invert(1);
} }
@ -131,12 +126,3 @@
body:has(.search-module[opened]) main { body:has(.search-module[opened]) main {
filter: blur(2px) brightness(0.8); filter: blur(2px) brightness(0.8);
} }
body.front-end form:not(:has(.gfield)) {
.search-module__search-form__input:focus-visible,
.search-module__search-form__input{
@apply !pl-12
}
}

View File

@ -1,86 +0,0 @@
.slider-card {
@apply p-6 relative !flex flex-col pt-16;
svg {
@apply absolute top-0 left-0 w-full h-full overflow-visible;
z-index: -1;
path {
stroke-width: 0;
vector-effect: non-scaling-stroke;
}
}
&:hover {
svg {
path {
stroke-width: 6px;
}
}
&:after {
opacity: 1;
}
.slider-card__link-button {
svg {
@apply translate-x-2;
}
}
}
&__link-button {
@apply block mt-8;
width: 100px;
height: 100px;
svg {
transition: transform 0.3s ease-in-out;
path,
circle {
@apply stroke-primary;
}
}
}
.content-meta {
@apply text-primary;
}
&__title {
@apply text-2xl font-medium uppercase pb-4 ;
}
&__link{
/* @apply mb-12;
&:has(+ .slider-card__date) {
@apply mb-0;
} */
}
*:has(+ .slider-card__cover) {
@apply mb-16;
}
&__tags {
@apply flex flex-wrap gap-4 pt-4;
}
&__cover {
@apply w-40 h-40 absolute border-primary border bottom-12 right-12 hidden lg:block;
transform: rotate(-3deg);
img {
@apply w-full h-full object-cover p-3;
}
}
.cta--go {
@apply text-primary mt-auto;
}
&:has(.slider-card__link:hover) {
.cta--go {
img {
@apply translate-x-2;
}
}
}
}

View File

@ -343,7 +343,7 @@ body:has(.primary-menu-container .sub-menu-open) {
.menu-item-object-custom.item-catalogue { .menu-item-object-custom.item-catalogue {
a { a {
@apply flex lg:flex-col items-center lg:justify-center gap-4; @apply flex flex-col items-center justify-center gap-4;
} }
a:before { a:before {
@apply content-[''] block bg-contain bg-center bg-no-repeat; @apply content-[''] block bg-contain bg-center bg-no-repeat;

View File

@ -82,7 +82,7 @@ $media_types_list = array(
<?php <?php
$amount = $media_type['amount']; $amount = $media_type['amount'];
$media_type = $media_type['acf_fc_layout']; $media_type = $media_type['acf_fc_layout'];
write_log($media_type);
if (!$amount || !$media_type) continue; if (!$amount || !$media_type) continue;
?> ?>
<li class="media-type media-type--<?php echo esc_attr($media_type); ?>"><?php echo $amount . ' ' . ($media_types_list[$media_type] ?? $media_type) . ($amount > 1 ? 's' : ''); ?></li> <li class="media-type media-type--<?php echo esc_attr($media_type); ?>"><?php echo $amount . ' ' . ($media_types_list[$media_type] ?? $media_type) . ($amount > 1 ? 's' : ''); ?></li>

View File

@ -36,28 +36,6 @@ $description = get_field('description', $ID);
$birth_death_date = get_field('birth_death_date', $ID); $birth_death_date = get_field('birth_death_date', $ID);
if($current_post_type === 'analyses-etudes'){
$type_analyse_etude = get_the_terms($ID, 'type-analyse-etude')[0] ?? null;
if($type_analyse_etude->slug === 'analyse'){
$link_type = get_field('link_type', $ID);
$target = '_blank' ;
switch($link_type){
case 'pdf':
$link = get_field('pdf', $ID)['url'] ?? '';
break;
case 'link':
$link = get_field('link', $ID)['url'] ?? '';
break;
default:
$link = get_the_permalink($ID);
break;
}
}
}
?> ?>
<a class="post-card post-card--<?php echo $current_post_type . ' ' . ($has_post_thumbnail ? 'post-card--has-thumbnail' : ''); ?> card" href="<?php echo esc_url($link); ?>" target="<?php echo $target; ?>"> <a class="post-card post-card--<?php echo $current_post_type . ' ' . ($has_post_thumbnail ? 'post-card--has-thumbnail' : ''); ?> card" href="<?php echo esc_url($link); ?>" target="<?php echo $target; ?>">

View File

@ -1,60 +0,0 @@
<?php
$postID = $args['ID'];
$isSwiperSlide = $args['isSwiperSlide'] ?? false;
$showCover = $args['showCover'] ?? false;
$cover = get_the_post_thumbnail_url($postID);
$current_post_type = get_post_type($postID);
$showTags= $args['showTags'] ?? true;
?>
<div class="slider-card <?php echo $isSwiperSlide ? 'swiper-slide' : ''; ?>">
<?php get_template_part('template-parts/components/content-meta', null, array(
'current_post_type' => $current_post_type,
'current_post_id' => $postID
)); ?>
<a href="<?php echo get_the_permalink($postID); ?>" class="slider-card__link">
<h4 class="slider-card__title"><?php echo get_the_title($postID); ?></h4>
</a>
<?php if ($showTags) : ?>
<ul class="slider-card__tags">
<?php
$terms = get_the_terms($postID, 'etiquettes');
if ($terms): ?>
<?php foreach ($terms as $term): ?>
<li class="slider-card__tag slider-tag">
<a href="<?php echo add_query_arg('etiquette', $term->slug, get_post_type_archive_link('articles')); ?>">
<?php echo esc_html($term->name); ?>
</a>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<?php endif; ?>
<time datetime="<?php echo get_the_date('c', $postID); ?>" class="slider-card__date"><?php echo get_the_date('d F Y', $postID); ?></time>
<?php if ($showCover && isset($cover) && $cover) : ?>
<div class="slider-card__cover">
<img src="<?php echo $cover; ?>" alt="<?php echo get_the_title($postID); ?>">
</div>
<?php endif; ?>
<?php get_template_part('template-parts/components/cta--go', null, array(
'url' => get_the_permalink($postID),
'label' => 'Lire la revue',
'target' => '_self',
)); ?>
<?php
$svg_path = get_template_directory() . '/resources/img/elements/fond-biseau.svg';
if (file_exists($svg_path)) {
echo file_get_contents($svg_path);
}
?>
</div>

View File

@ -1,15 +0,0 @@
<?php
/**
* Collective Access Button
*
* @package Carhop
* @subpackage Components
* @since 1.0.0
*/
?>
<a href="https://collectiveaccess.org" class="collective-access-button" target="_blank">
<span class="collective-access-button-text">
Collective Access
</span>
</a>

View File

@ -3,31 +3,20 @@ $current_post_id = $args['current_post_id'] ?? get_the_ID();
$current_post_type = $args['current_post_type'] ?? null; $current_post_type = $args['current_post_type'] ?? null;
$type = null; $type = null;
$current_post_type_supports_type = get_post_type_supports_type($current_post_type); $current_post_type_supports_type = get_post_type_supports_type($current_post_type);
$is_dynamiques_post_type = $current_post_type === 'revues' || $current_post_type === 'articles';
$hasNumerotation = hasPostTypeNumerotation($current_post_type); $hasNumerotation = hasPostTypeNumerotation($current_post_type);
if ($is_dynamiques_post_type) { if ($current_post_type_supports_type) {
$current_post_type_obj = get_post_type_object($current_post_type);
$dynamiques_post_type_labels = array(
'revues' => __('Revue', 'carhop'),
'articles' => __('Article', 'carhop'),
);
$type = $current_post_type_obj->labels->singular_name ?? $dynamiques_post_type_labels[$current_post_type] ?? null;
}
else if ($current_post_type_supports_type) {
// $type = isset($types_terms[0]) ? $types_terms[0] : null; // $type = isset($types_terms[0]) ? $types_terms[0] : null;
$type_term = get_post_specific_type_terms($current_post_id)[0] ?? null; $type_term = get_post_specific_type_terms($current_post_id)[0] ?? null;
if ($type_term) { if ($type_term) {
$type = $type_term->name; $type = $type_term->name;
} }
} // $current_post_type === 'analyses-etudes' && is_array($type) && !empty($type) && isset($type[0]->name
} else {
else {
$current_post_type_obj = get_post_type_object($current_post_type); $current_post_type_obj = get_post_type_object($current_post_type);
$type = $current_post_type_obj->labels->singular_name ?? null; $type = $current_post_type_obj->labels->singular_name;
} }
?> ?>
@ -39,6 +28,8 @@ else {
<?php if ($hasNumerotation) : ?> <?php if ($hasNumerotation) : ?>
<?php <?php
$numerotation = get_current_post_numerotation($current_post_id); $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">