From 075e722a6d03966622c1768e0d69245bab2014e3 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 20 Dec 2023 10:07:34 +0100 Subject: [PATCH] moving acf blocks to plugin --- .../aides-financieres/aides-financieres.css | 43 ---------- .../aides-financieres/aides-financieres.php | 55 ------------ .../home/aides-financieres/block.json | 20 ----- .../home/demarches-administratives/block.json | 27 ------ .../demarches-administratives.css | 24 ------ .../demarches-administratives.php | 45 ---------- template-blocks/home/home-header/block.json | 27 ------ .../home/home-header/home-header.css | 66 --------------- .../home/home-header/home-header.php | 20 ----- template-blocks/home/latest-news/block.json | 20 ----- .../home/latest-news/latest-news.css | 17 ---- .../home/latest-news/latest-news.php | 62 -------------- .../home/questions-frequentes/block.json | 17 ---- .../questions-frequentes.css | 7 -- .../questions-frequentes.php | 72 ---------------- .../home/show-thematiques/block.json | 17 ---- .../show-thematiques/show-thematiques.css | 83 ------------------- .../home/show-thematiques/show-thematiques.js | 65 --------------- .../show-thematiques/show-thematiques.php | 79 ------------------ 19 files changed, 766 deletions(-) delete mode 100755 template-blocks/home/aides-financieres/aides-financieres.css delete mode 100755 template-blocks/home/aides-financieres/aides-financieres.php delete mode 100644 template-blocks/home/aides-financieres/block.json delete mode 100644 template-blocks/home/demarches-administratives/block.json delete mode 100755 template-blocks/home/demarches-administratives/demarches-administratives.css delete mode 100755 template-blocks/home/demarches-administratives/demarches-administratives.php delete mode 100644 template-blocks/home/home-header/block.json delete mode 100755 template-blocks/home/home-header/home-header.css delete mode 100755 template-blocks/home/home-header/home-header.php delete mode 100644 template-blocks/home/latest-news/block.json delete mode 100644 template-blocks/home/latest-news/latest-news.css delete mode 100644 template-blocks/home/latest-news/latest-news.php delete mode 100644 template-blocks/home/questions-frequentes/block.json delete mode 100644 template-blocks/home/questions-frequentes/questions-frequentes.css delete mode 100644 template-blocks/home/questions-frequentes/questions-frequentes.php delete mode 100644 template-blocks/home/show-thematiques/block.json delete mode 100755 template-blocks/home/show-thematiques/show-thematiques.css delete mode 100644 template-blocks/home/show-thematiques/show-thematiques.js delete mode 100755 template-blocks/home/show-thematiques/show-thematiques.php diff --git a/template-blocks/home/aides-financieres/aides-financieres.css b/template-blocks/home/aides-financieres/aides-financieres.css deleted file mode 100755 index bff3564..0000000 --- a/template-blocks/home/aides-financieres/aides-financieres.css +++ /dev/null @@ -1,43 +0,0 @@ -#block-aides-financieres { - .section_titling { - @apply max-w-screen-md; - } - .card-large-content { - @apply lg:grid grid-cols-2 gap-12; - - &__renolution-details { - /* .logo_renolution { */ - .renolution__logo { - @apply p-6 mb-8 bg-white shadowed w-fit rounded-3xl; - } - .renolution__title { - @apply text-lg font-bold text-secondary pb-3; - } - .cta { - @apply mt-8; - } - .renolution__guide-external-links { - @apply grid grid-cols-2 gap-12 pt-6; - .question_title { - @apply text-black font-bold pt-6 pb-2; - } - .question_explanation { - @apply text-sm; - } - .question_url { - @apply block text-sm text-black font-bold mt-2 py-2; - &:hover { - @apply text-secondary; - } - img { - @apply inline-block ml-1 -mt-1; - } - } - } - } - - &__renolution-illustration-picture { - @apply ml-auto; - } - } -} diff --git a/template-blocks/home/aides-financieres/aides-financieres.php b/template-blocks/home/aides-financieres/aides-financieres.php deleted file mode 100755 index f916dff..0000000 --- a/template-blocks/home/aides-financieres/aides-financieres.php +++ /dev/null @@ -1,55 +0,0 @@ - - - -
- -
-

-

-
-
-
- - -

-

- - - - - - -
- - - -
- -
\ No newline at end of file diff --git a/template-blocks/home/aides-financieres/block.json b/template-blocks/home/aides-financieres/block.json deleted file mode 100644 index 9639b9b..0000000 --- a/template-blocks/home/aides-financieres/block.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "acf/aides-financieres", - "title": "Aides Financières", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "schedule" - }, - "keywords": [ - "aides financières", - "aide", - "Financières", - "Renolution" - ], - "acf": { - "mode": "auto", - "renderTemplate": "aides-financieres.php" - } -} \ No newline at end of file diff --git a/template-blocks/home/demarches-administratives/block.json b/template-blocks/home/demarches-administratives/block.json deleted file mode 100644 index e00dab3..0000000 --- a/template-blocks/home/demarches-administratives/block.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "acf/demarches-administratives", - "title": "Démarches Administratives", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "schedule" - }, - "keywords": [ - "Couverture", - "home", - "Accueil", - "Section d'accueil", - "Header" - ], - "supports": { - "align": [ - "full" - ] - }, - "acf": { - "mode": "auto", - "renderTemplate": "demarches-administratives.php" - }, - "align": "full" -} \ No newline at end of file diff --git a/template-blocks/home/demarches-administratives/demarches-administratives.css b/template-blocks/home/demarches-administratives/demarches-administratives.css deleted file mode 100755 index bdab248..0000000 --- a/template-blocks/home/demarches-administratives/demarches-administratives.css +++ /dev/null @@ -1,24 +0,0 @@ -#block-demarches-administratives { - &.card-large-content-container--has-illustration { - @apply pt-64; - } - - .card-large-content--has-illustration { - @apply pt-28; - } - .card-large-content__top-illustration { - transform: translate(-50%, -70%); - } - .card-large-content__links-container { - @apply grid-cols-1 - md:grid-cols-2 - lg:grid-cols-4 - gap-x-12; - .card-large-content__link { - /* @apply flex flex-col; */ - .cta { - @apply self-end px-6 w-full text-center md:w-fit; - } - } - } -} diff --git a/template-blocks/home/demarches-administratives/demarches-administratives.php b/template-blocks/home/demarches-administratives/demarches-administratives.php deleted file mode 100755 index 640b842..0000000 --- a/template-blocks/home/demarches-administratives/demarches-administratives.php +++ /dev/null @@ -1,45 +0,0 @@ -'; -// print_r($demarches_administratives_links); -// echo ''; - -?> - - -
- -
- -
-

-

-

-
- - -
-
\ No newline at end of file diff --git a/template-blocks/home/home-header/block.json b/template-blocks/home/home-header/block.json deleted file mode 100644 index f773d83..0000000 --- a/template-blocks/home/home-header/block.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "acf/home-header", - "title": "Section d'accueil", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "schedule" - }, - "keywords": [ - "Couverture", - "home", - "Accueil", - "Section d'accueil", - "Header" - ], - "supports": { - "align": [ - "full" - ] - }, - "acf": { - "mode": "auto", - "renderTemplate": "home-header.php" - }, - "align": "full" -} \ No newline at end of file diff --git a/template-blocks/home/home-header/home-header.css b/template-blocks/home/home-header/home-header.css deleted file mode 100755 index 4936d9c..0000000 --- a/template-blocks/home/home-header/home-header.css +++ /dev/null @@ -1,66 +0,0 @@ -.home-header { - @apply max-w-screen-xl mx-auto px-6 lg:px-16 pt-16 xl:pt-20 - mb-24; - isolation: isolate; - - /* relative */ - /* bg-red-100 */ - /* aspect-ratio: 1.5; */ - - /* min-height: 80vh; */ - /* background-color: #fbfff5a6; */ - &__titling { - @apply max-w-[580px] - relative - z-10 - lg:absolute - mb-[-100px] - lg:mb-0; - } - &__title { - @apply text-3xl md:text-4xl font-medium pb-6 pt-16; - line-height: 1.2; - } - - &__scroll-down-indicator { - @apply bg-primary rounded-full flex justify-center items-center mt-6; - width: 80px; - height: 80px; - &__arrow { - animation: bouncingArrow 1s infinite alternate cubic-bezier(0.01, 0.61, 0.67, 0.99); - /* cubic-bezier(0.01, 0.61, 0.39, 1); */ - /* cubic-bezier(0.18, 0.89, 0.3, 1); */ - } - } - - &__fresque { - @apply w-full; - z-index: -1; - @apply bg-purple-50; - img { - @apply w-full h-full max-h-full object-contain; - /* object-position: 100% 100%; */ - @screen lg { - /* object-position: 100% 0%; */ - } - } - @media (max-aspect-ratio: 16 / 9) { - img { - /* @apply bg-red-100; */ - } - } - @media (min-aspect-ratio: 16 / 9) { - img { - /* @apply bg-green-100; */ - } - } - } -} -@keyframes bouncingArrow { - 0% { - transform: translateY(4px); - } - 100% { - transform: translateY(-6px); - } -} diff --git a/template-blocks/home/home-header/home-header.php b/template-blocks/home/home-header/home-header.php deleted file mode 100755 index c1f5b17..0000000 --- a/template-blocks/home/home-header/home-header.php +++ /dev/null @@ -1,20 +0,0 @@ - - - -
-
-

- -

-

- - - -
-
- -
-
\ No newline at end of file diff --git a/template-blocks/home/latest-news/block.json b/template-blocks/home/latest-news/block.json deleted file mode 100644 index 74c91c8..0000000 --- a/template-blocks/home/latest-news/block.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "acf/latest-news", - "title": "Dernières News", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "welcome-widgets-menus" - }, - "keywords": [ - "News", - "dernières", - "actus", - "latest" - ], - "acf": { - "mode": "auto", - "renderTemplate": "latest-news.php" - } -} \ No newline at end of file diff --git a/template-blocks/home/latest-news/latest-news.css b/template-blocks/home/latest-news/latest-news.css deleted file mode 100644 index 50912eb..0000000 --- a/template-blocks/home/latest-news/latest-news.css +++ /dev/null @@ -1,17 +0,0 @@ -.section_latest_news { - @apply py-24; - .section_titling { - @apply max-w-md mx-auto; - } - .articles_container { - @apply grid - grid-cols-1 - sm:grid-cols-2 - xl:grid-cols-4 - max-w-screen-2xl - px-8 - py-16 - gap-8 - mx-auto; - } -} diff --git a/template-blocks/home/latest-news/latest-news.php b/template-blocks/home/latest-news/latest-news.php deleted file mode 100644 index fe89e6b..0000000 --- a/template-blocks/home/latest-news/latest-news.php +++ /dev/null @@ -1,62 +0,0 @@ - - -
-
-

-

-
- -
- 4, - 'post_type' => 'post', - 'orderby' => 'post_date', - 'order' => 'DESC', - 'post_status' => 'publish' // Show only the published posts - ); - $recentNewsPosts = new WP_Query($args); - - // echo '
';
-		// print_r($recentNewsPosts);
-		// echo '
'; - - ?> - - have_posts()) : while ($recentNewsPosts->have_posts()) : $recentNewsPosts->the_post(); ?> - ID, 'full', array('class' => 'card-news__thumbnail')); - $news_type = get_the_terms($post->ID, "news_type") ?? null; - - get_template_part( - 'template-components/cards/card-news', - null, - array( - 'card_variant' => 'activite', - 'post_ID' => $post->ID, - 'post_title' => get_the_title(), - 'post_thumbnail' => $post_thumbnail, - 'news_type' => $news_type, - 'post_date' => $post_date, - ) - ); - ?> - - -
- '_wp_page_template', - 'meta_value' => "template-archive-news.php" - ); - $relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null; - ?> - - - - - -
\ No newline at end of file diff --git a/template-blocks/home/questions-frequentes/block.json b/template-blocks/home/questions-frequentes/block.json deleted file mode 100644 index 9af4ef7..0000000 --- a/template-blocks/home/questions-frequentes/block.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "acf/questions-frequentes", - "title": "Questions Fréquentes", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "schedule" - }, - "keywords": [ - "Questions Fréquentes" - ], - "acf": { - "mode": "auto", - "renderTemplate": "questions-frequentes.php" - } -} \ No newline at end of file diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.css b/template-blocks/home/questions-frequentes/questions-frequentes.css deleted file mode 100644 index 6fd1742..0000000 --- a/template-blocks/home/questions-frequentes/questions-frequentes.css +++ /dev/null @@ -1,7 +0,0 @@ -#block-questions-frequentes { - @apply py-28 px-8; -} - -.questions-frequentes-grid { - @apply grid md:grid-cols-2 lg:grid-cols-3 gap-8 gap-x-8 max-w-screen-xl mx-auto; -} diff --git a/template-blocks/home/questions-frequentes/questions-frequentes.php b/template-blocks/home/questions-frequentes/questions-frequentes.php deleted file mode 100644 index 0738956..0000000 --- a/template-blocks/home/questions-frequentes/questions-frequentes.php +++ /dev/null @@ -1,72 +0,0 @@ - 1, - 'post_status' => 'publish', - 'post_type' => 'questions', - 'include_children' => true, - 'tax_query' => array( - array( - 'taxonomy' => 'thematiques', - 'field' => 'slug', - 'terms' => $post_thematique->slug, - 'include_children' => true, - ) - ) - - ); - $posts = new WP_Query($automatic_query_args); - return $posts->posts[0] ?? null; - } -} - -?> - -
-
-

-

-
-
- 'thematiques', - 'hide_empty' => false, - 'parent' => 0 - )); - - foreach ($thematique_terms as $key => $thematique) { - if ( - $thematique->slug === "renovation-circulaire" - || $thematique->slug === "circulaire-renovatie" - || $thematique->slug === "au-quotidien" - || $thematique->slug === "dagelijks" - || $thematique->slug === "aides-financieres" - || $thematique->slug === "financiele-steun" - ) continue; - - // $thematique_datas = get_term_by('slug', $thematique->slug, 'thematiques'); - - $manual_data = get_field($thematique->slug . '_manual_data'); - $post_datas = $manual_data ? $manual_data : get_automatic_post($thematique); - - get_template_part( - 'template-components/cards/card-frequent-question', - null, - array( - 'thematique' => $thematique, - 'post_ID' => $post_datas->ID, - 'post_title' => $post_datas->post_title, - 'post_excerpt' => $post_datas->post_excerpt, - // 'post_url' => $post_datas->post_excerpt, - ) - ); - } - ?> -
- -
\ No newline at end of file diff --git a/template-blocks/home/show-thematiques/block.json b/template-blocks/home/show-thematiques/block.json deleted file mode 100644 index 08f9ef2..0000000 --- a/template-blocks/home/show-thematiques/block.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "acf/show-thematiques", - "title": "Thématiques", - "category": "homegrade-page-home", - "multiple": false, - "icon": { - "foreground": "#DF1E1E", - "src": "schedule" - }, - "keywords": [ - "Thématiques" - ], - "acf": { - "mode": "auto", - "renderTemplate": "show-thematiques.php" - } -} \ No newline at end of file diff --git a/template-blocks/home/show-thematiques/show-thematiques.css b/template-blocks/home/show-thematiques/show-thematiques.css deleted file mode 100755 index 7d19f98..0000000 --- a/template-blocks/home/show-thematiques/show-thematiques.css +++ /dev/null @@ -1,83 +0,0 @@ -.swiper-content { - @apply lg:px-24 relative max-w-screen-2xl mx-auto; - /* @apply bg-fuchsia-100; */ -} -.swiper-container { - height: auto; - @apply px-3 overflow-hidden; - /* @apply bg-yellow-50; */ -} - -.swiper-wrapper { - @apply pt-24 pb-16 w-full flex-col lg:flex-row gap-y-20; -} - -.swiper-slide { - @apply h-auto; - .card-thematique { - @apply h-full; - } -} - -.thematique-button-next, -.thematique-button-prev { - @apply absolute top-1/2 z-50 opacity-80 hidden lg:block; - width: 60px; - height: 60px; - &:hover, - &:focus { - @apply opacity-100; - filter: invert(13%) sepia(71%) saturate(4425%) hue-rotate(338deg) brightness(109%) - contrast(117%); - } - &:focus { - @apply rounded-full; - } -} -.thematique-button-next { - @apply right-0 transform; -} -.thematique-button-prev { - @apply left-0; -} -.swiper-pagination { - @apply hidden lg:block; -} -.swiper-pagination-bullet { - @apply w-3 h-3 mx-2 opacity-100 bg-white !border-2 !border-solid border-black opacity-80; -} -.swiper-pagination-bullet:focus { - outline-offset: 4px; -} -.swiper-pagination-bullet-active { - @apply bg-secondary !border-secondary opacity-100; -} - -/* .swiper-slide { - background-color: red !important; - text-align: center; - font-size: 18px; - background: #fff; - display: flex; - justify-content: center; - align-items: center; -} - -.swiper-slide img { - display: block; - width: 100%; - height: 100%; - object-fit: cover; -} */ -.section-show-thematiques { - @apply pt-8 pb-8 px-8 md:px-16; - .thematiques-container { - @apply grid - grid-cols-3 - gap-8 - gap-y-32 - max-w-screen-xl - mx-auto - pt-16; - } -} diff --git a/template-blocks/home/show-thematiques/show-thematiques.js b/template-blocks/home/show-thematiques/show-thematiques.js deleted file mode 100644 index 0a2ae1c..0000000 --- a/template-blocks/home/show-thematiques/show-thematiques.js +++ /dev/null @@ -1,65 +0,0 @@ -window.addEventListener('DOMContentLoaded', (event) => { - const cardThematiques = document.querySelectorAll('.swiper-slide .card-thematique'); - - function swiperCheckBreakpoints() { - const hasSwiper = thematiquesSwiper.__swiper__ === true; - - if (window.innerWidth < 960 && hasSwiper) { - thematiquesSwiper.destroy(true, true); - } - if (window.innerWidth >= 960 && !hasSwiper) { - initiateSwiper(); - } - } - - function initiateSwiper() { - thematiquesSwiper = new Swiper('.swiper-container', { - grabCursor: false, - slidesPerView: 3, - spaceBetween: 30, - a11y: { - enabled: true, - prevSlideMessage: textTranslations.previousSlide, - nextSlideMessage: textTranslations.nextSlide, - slideRole: '', - slideLabelMessage: textTranslations.slideLabel, - }, - // loop: true, - // centeredSlides: true, - keyboard: { - enabled: true, - }, - navigation: { - nextEl: '.thematique-button-next', - prevEl: '.thematique-button-prev', - }, - pagination: { - el: '.swiper-pagination', - clickable: true, - renderBullet: function (index, className) { - const ariaLabel = cardThematiques[index].getAttribute('data-taxonomy'); - - // return ``; - return `
`; - }, - }, - breakpoints: { - // when window width is >= 320px - - // when window width is >= 480px - 320: { - slidesPerView: 2, - }, - // when window width is >= 640px - 1100: { - slidesPerView: 3, - }, - }, - // a11y: false, - }); - } - initiateSwiper(); - swiperCheckBreakpoints(); - - window.addEventListener('resize', swiperCheckBreakpoints); -}); diff --git a/template-blocks/home/show-thematiques/show-thematiques.php b/template-blocks/home/show-thematiques/show-thematiques.php deleted file mode 100755 index d7efe1f..0000000 --- a/template-blocks/home/show-thematiques/show-thematiques.php +++ /dev/null @@ -1,79 +0,0 @@ - 'thematiques', - 'parent' => 0, - 'hide_empty' => false, -)); - -?> - -
- -
-

-

-
- -
- - - - -
- - - - -
- - - - - slug === "renovation-circulaire" - || $term->slug === "circulaire-renovatie" - || $term->slug === "au-quotidien" - || $term->slug === "dagelijks" - || $term->slug === "aides-financieres" - || $term->slug === "financiele-steun" - - ) continue; ?> -
- $term, - ) - ); - ?> -
- - -
- -
- - - - -
- - - - -
- - - -
\ No newline at end of file