diff --git a/footer.php b/footer.php index 620fea0..15555fe 100644 --- a/footer.php +++ b/footer.php @@ -1,171 +1,173 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/front-page.php b/front-page.php old mode 100755 new mode 100644 diff --git a/functions.php b/functions.php index b9b0b9b..12325b1 100644 --- a/functions.php +++ b/functions.php @@ -16,4 +16,3 @@ require_once(__DIR__ . '/includes/wysiwyg.php'); require_once(__DIR__ . '/includes/search.php'); require_once(__DIR__ . '/includes/rooting.php'); require_once(__DIR__ . '/includes/forms.php'); -require_once(__DIR__ . '/includes/wpml.php'); diff --git a/header.php b/header.php index d3ac399..e68a9cb 100644 --- a/header.php +++ b/header.php @@ -8,10 +8,10 @@ + current-language=""> @@ -35,10 +35,10 @@ switch_to_blog(1) - + diff --git a/includes/errorlog.php b/includes/errorlog.php old mode 100755 new mode 100644 diff --git a/includes/forms/export-paper-publication-entries.php b/includes/forms/export-paper-publication-entries.php index 31fca26..c9511bd 100644 --- a/includes/forms/export-paper-publication-entries.php +++ b/includes/forms/export-paper-publication-entries.php @@ -7,6 +7,8 @@ function add_menu_item($menu_items) return $menu_items; } + + function homegrade_stats_option_page() { ?> @@ -88,6 +90,9 @@ function generate_order_datas_to_csv() $document_id_nl = $document['id_nl'] ?? null; $document_quantity_nl = $document['quantity_nl'] ?? null; + $dateCreatedRaw = $entry['date_created'] ?? ''; + $dateCreated = $dateCreatedRaw ? date('d / m / Y', strtotime($dateCreatedRaw)) : ''; + if (!$document_quantity_fr && !$document_quantity_nl) { continue; } @@ -103,6 +108,7 @@ function generate_order_datas_to_csv() 'company_type' => $companyType, 'zipCode' => $zipCode, 'userLanguage' => $userLanguage, + 'order_date' => $dateCreated, ]; array_push($output_formatted_entries, $document_formatted_order_nl); } @@ -119,6 +125,7 @@ function generate_order_datas_to_csv() 'company_type' => $companyType, 'zipCode' => $zipCode, 'userLanguage' => $userLanguage, + 'order_date' => $dateCreated, ]; array_push($output_formatted_entries, $document_formatted_order_fr); } @@ -136,7 +143,7 @@ function generate_order_datas_to_csv() } // Ajouter les en-têtes du CSV - fputcsv($file, ['Publication', 'Quantité', 'Langue de la publication', 'Thématique', 'ID de la brochure', 'Type d\'organisme', 'Code Postal', 'Langue de l\'utilisateur']); + fputcsv($file, ['Publication', 'Quantité', 'Langue de la publication', 'Thématique', 'ID de la brochure', 'Type d\'organisme', 'Code Postal', 'Langue de l\'utilisateur', 'Date de la commande']); // Boucler sur chaque entrée formatée et l'écrire dans le CSV foreach ($output_formatted_entries as $entry) { diff --git a/includes/logos.php b/includes/logos.php old mode 100755 new mode 100644 diff --git a/includes/navwalker.php b/includes/navwalker.php index 950d7b2..dab3f5b 100644 --- a/includes/navwalker.php +++ b/includes/navwalker.php @@ -68,19 +68,17 @@ function add_custom_item_to_menu($items, $args) switch_to_blog(2); // $home_url_metiers_patrimoine = get_home_url(); $home_url_metiers_patrimoine = get_the_permalink(43); - // switch_to_blog(1); restore_current_blog(); - + $items .= '
  • '; $items .= ''; $items .= __('Artisans du patrimoine', 'homegrade'); $items .= ''; $items .= '
  • '; - - + + /* WPML NAV SWITCHER */ ob_start(); - // switch_to_blog(1); restore_current_blog(); // do_action('wpml_language_switcher', array('flags' => false, 'translated' => false, 'link_current' => true)); do_action('wpml_add_language_selector'); diff --git a/includes/post_types.php b/includes/post_types.php index ebb0ce6..464f6da 100644 --- a/includes/post_types.php +++ b/includes/post_types.php @@ -1,204 +1,204 @@ -labels; - $labels->name = 'News'; - $labels->singular_name = 'News'; - $labels->add_new = 'Ajouter une Actu'; - $labels->add_new_item = 'Ajouter une Actu'; - $labels->edit_item = 'Editer l\'actualité'; - $labels->new_item = 'News'; - $labels->view_item = 'Voir l\'actualité'; - $labels->search_items = 'Chercher une Actualité'; - $labels->not_found = 'Pas de News trouvée'; - $labels->not_found_in_trash = 'Pas de News trouvée dans la corbeille'; - $labels->all_items = 'Toutes les Actus'; - $labels->menu_name = 'News'; - $labels->name_admin_bar = 'News'; -} -add_action('init', 'cp_change_post_object'); - - -// Change Defaults Posts Icon in menu bar - -function change_menu_icon() -{ - - // Access global variables. - global $menu; - - foreach ($menu as $key => $val) { - - if (__('News', 'homegrade-theme__texte-backoffice') == $val[0]) { - $menu[$key][6] = 'dashicons-welcome-widgets-menus'; - } - } -} -add_action('admin_menu', 'change_menu_icon'); - -// #### POST TYPES -function create_posttype() -{ - - if (get_current_blog_id() != 1) { - return; - } - // **** CONSEILS - register_post_type( - 'conseils', - array( - 'labels' => array( - 'name' => __('Conseils', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Conseil', 'homegrade-theme__texte-backoffice') - ), - 'template' => [ - array('homegrade-content-blocks/chapter-header'), - array('core/paragraph', ['placeholder' => 'Add truc Description…',]), - ], - 'hierarchical' => true, - 'public' => true, - 'has_archive' => false, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-pressthis', - 'menu_position' => 2, - 'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'), - - // 'supports' => array('title', 'custom-fields', 'editor'), - ) - ); - - // **** BROCHURES - register_post_type( - 'brochures', - array( - 'labels' => array( - 'name' => __('Brochures', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice') - ), - 'hierarchical' => true, - 'show_in_rest' => true, - 'public' => true, - 'has_archive' => false, - 'menu_icon' => 'dashicons-book', - 'menu_position' => 2, - 'position' => 2, - 'supports' => array('custom-fields', 'page-attributes', 'title'), - ) - ); - - // **** QUESTIONS - register_post_type( - 'questions', - array( - 'labels' => array( - 'name' => __('Questions', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Question', 'homegrade-theme__texte-backoffice') - ), - 'public' => true, - 'has_archive' => false, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-editor-help', - 'menu_position' => 2.1, - 'supports' => array('title', 'custom-fields', 'editor', 'excerpt', 'revisions'), - - // 'rewrite' => array('slug' => 'questions'), - // 'rewrite' => array('slug' => 'questions/%thematiques%'), - ) - ); - - // **** FICHES-INFOS - register_post_type( - 'fiches-infos', - array( - 'labels' => array( - 'name' => __('Fiches info', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Fiches Info', 'homegrade-theme__texte-backoffice') - ), - 'public' => true, - 'has_archive' => false, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-info-outline', - 'menu_position' => 2.1, - 'supports' => array('title', 'custom-fields'), - ) - ); - - // **** VOCABULAIRE - register_post_type( - 'vocabulaire', - array( - 'labels' => array( - 'name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice') - ), - 'public' => true, - 'has_archive' => true, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-testimonial', - 'menu_position' => 5.1, - 'supports' => array('title', 'custom-fields'), - ) - ); - - // **** JOBS - register_post_type( - 'jobs', - array( - 'labels' => array( - 'name' => __('Jobs', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Job', 'homegrade-theme__texte-backoffice') - ), - 'rewrite' => array('slug' => 'job'), - 'public' => true, - 'has_archive' => true, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-id-alt', - 'menu_position' => 5.1, - 'supports' => array('title', 'editor', 'custom-fields', 'page-attributes'), - - ) - ); - - // **** VIDEOS / WEBINAIRES - register_post_type( - 'videos-webinaires', - array( - 'labels' => array( - 'name' => __('Webinaires', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Webinaire', 'homegrade-theme__texte-backoffice') - ), - 'public' => true, - 'has_archive' => true, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-video-alt2', - 'menu_position' => 5.1, - 'supports' => array('title', 'custom-fields'), - 'supports' => array('title', 'custom-fields', 'excerpt', 'thumbnail'), - - ) - ); - - // **** VIDEOS / WEBINAIRES - register_post_type( - 'parcours', - array( - 'labels' => array( - 'name' => __('Parcours', 'homegrade-theme__texte-backoffice'), - 'singular_name' => __('Parcours', 'homegrade-theme__texte-backoffice') - ), - 'public' => true, - 'has_archive' => true, - 'hierarchical' => true, - 'show_in_rest' => true, - 'menu_icon' => 'dashicons-forms', - 'supports' => array('title', 'custom-fields'), - 'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'), - - ) - ); -} - -add_action('init', 'create_posttype'); +labels; + $labels->name = 'News'; + $labels->singular_name = 'News'; + $labels->add_new = 'Ajouter une Actu'; + $labels->add_new_item = 'Ajouter une Actu'; + $labels->edit_item = 'Editer l\'actualité'; + $labels->new_item = 'News'; + $labels->view_item = 'Voir l\'actualité'; + $labels->search_items = 'Chercher une Actualité'; + $labels->not_found = 'Pas de News trouvée'; + $labels->not_found_in_trash = 'Pas de News trouvée dans la corbeille'; + $labels->all_items = 'Toutes les Actus'; + $labels->menu_name = 'News'; + $labels->name_admin_bar = 'News'; +} +add_action('init', 'cp_change_post_object'); + + +// Change Defaults Posts Icon in menu bar + +function change_menu_icon() +{ + + // Access global variables. + global $menu; + + foreach ($menu as $key => $val) { + + if (__('News', 'homegrade-theme__texte-backoffice') == $val[0]) { + $menu[$key][6] = 'dashicons-welcome-widgets-menus'; + } + } +} +add_action('admin_menu', 'change_menu_icon'); + +// #### POST TYPES +function create_posttype() +{ + + if (get_current_blog_id() != 1) { + return; + } + // **** CONSEILS + register_post_type( + 'conseils', + array( + 'labels' => array( + 'name' => __('Conseils', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Conseil', 'homegrade-theme__texte-backoffice') + ), + 'template' => [ + array('homegrade-content-blocks/chapter-header'), + array('core/paragraph', ['placeholder' => 'Add truc Description…',]), + ], + 'hierarchical' => true, + 'public' => true, + 'has_archive' => false, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-pressthis', + 'menu_position' => 2, + 'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'), + + // 'supports' => array('title', 'custom-fields', 'editor'), + ) + ); + + // **** BROCHURES + register_post_type( + 'brochures', + array( + 'labels' => array( + 'name' => __('Brochures', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Brochure', 'homegrade-theme__texte-backoffice') + ), + 'hierarchical' => true, + 'show_in_rest' => true, + 'public' => true, + 'has_archive' => false, + 'menu_icon' => 'dashicons-book', + 'menu_position' => 2, + 'position' => 2, + 'supports' => array('custom-fields', 'page-attributes', 'title'), + ) + ); + + // **** QUESTIONS + register_post_type( + 'questions', + array( + 'labels' => array( + 'name' => __('Questions', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Question', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => false, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-editor-help', + 'menu_position' => 2.1, + 'supports' => array('title', 'custom-fields', 'editor', 'excerpt', 'revisions'), + + // 'rewrite' => array('slug' => 'questions'), + // 'rewrite' => array('slug' => 'questions/%thematiques%'), + ) + ); + + // **** FICHES-INFOS + register_post_type( + 'fiches-infos', + array( + 'labels' => array( + 'name' => __('Fiches info', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Fiches Info', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => false, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-info-outline', + 'menu_position' => 2.1, + 'supports' => array('title', 'custom-fields'), + ) + ); + + // **** VOCABULAIRE + register_post_type( + 'vocabulaire', + array( + 'labels' => array( + 'name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Vocabulaire', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => true, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-testimonial', + 'menu_position' => 5.1, + 'supports' => array('title', 'custom-fields'), + ) + ); + + // **** JOBS + register_post_type( + 'jobs', + array( + 'labels' => array( + 'name' => __('Jobs', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Job', 'homegrade-theme__texte-backoffice') + ), + 'rewrite' => array('slug' => 'job'), + 'public' => true, + 'has_archive' => true, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-id-alt', + 'menu_position' => 5.1, + 'supports' => array('title', 'editor', 'custom-fields', 'page-attributes'), + + ) + ); + + // **** VIDEOS / WEBINAIRES + register_post_type( + 'videos-webinaires', + array( + 'labels' => array( + 'name' => __('Webinaires', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Webinaire', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => true, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-video-alt2', + 'menu_position' => 5.1, + 'supports' => array('title', 'custom-fields'), + 'supports' => array('title', 'custom-fields', 'excerpt', 'thumbnail'), + + ) + ); + + // **** VIDEOS / WEBINAIRES + register_post_type( + 'parcours', + array( + 'labels' => array( + 'name' => __('Parcours', 'homegrade-theme__texte-backoffice'), + 'singular_name' => __('Parcours', 'homegrade-theme__texte-backoffice') + ), + 'public' => true, + 'has_archive' => true, + 'hierarchical' => true, + 'show_in_rest' => true, + 'menu_icon' => 'dashicons-forms', + 'supports' => array('title', 'custom-fields'), + 'supports' => array('title', 'editor', 'page-attributes', 'thumbnail', 'revisions', 'excerpt'), + + ) + ); +} + +add_action('init', 'create_posttype'); diff --git a/includes/taxonomy.php b/includes/taxonomy.php index 043f1c0..3fa4a10 100644 --- a/includes/taxonomy.php +++ b/includes/taxonomy.php @@ -42,9 +42,14 @@ function undo_create_term($term_id, $tt_id, $taxonomy) REGISTER TAXONOMIES --------------------*/ -function homegrade_add_custom_taxonomies() +function homegrade_add_homegrade_custom_taxonomies() { +$current_blog_id = get_current_blog_id(); +// write_log("Current blog ID: " . $current_blog_id); +// if ($current_blog_id !== 1) { +// return; // Skip if not on the main site +// } // ————— Thématiques ————— register_taxonomy('thematiques', ['questions', 'conseils', 'brochures', 'fiches-infos', 'videos-webinaires'], array( @@ -104,7 +109,6 @@ function homegrade_add_custom_taxonomies() 'name' => ' Général', 'slug' => 'general', ], - )); // ————— mots-clés ————— @@ -131,7 +135,7 @@ function homegrade_add_custom_taxonomies() )); } -add_action('init', 'homegrade_add_custom_taxonomies', 0); +add_action('init', 'homegrade_add_homegrade_custom_taxonomies', 0); /* ----------------------- HIDE THEMATIQUE METABOX diff --git a/includes/utilities.php b/includes/utilities.php index 4acacfa..5867914 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -196,8 +196,8 @@ function build_page_chapter_index($blocks) if ($block['blockName'] == 'homegrade-content-blocks/content-heading' && isset($block['attrs']['title']) && isset($block['attrs']['headingLevel']) && $block['attrs']['headingLevel'] == "h2") { array_push($chapterBlockIndex, [ 'block-type' => $block['blockName'], - 'anchor' => "#" . esc_html($block['attrs']['idName']), - 'title' => esc_html($block['attrs']['title']), + 'anchor' => "#" . strip_tags($block['attrs']['idName']), + 'title' => strip_tags($block['attrs']['title']), ]); } if ($block['blockName'] == 'homegrade-content-blocks/chapitrage-thematique') { diff --git a/includes/wysiwyg.php b/includes/wysiwyg.php old mode 100755 new mode 100644 diff --git a/resources/css/admin-style.css b/resources/css/admin-style.css index a64e979..cf60f01 100644 --- a/resources/css/admin-style.css +++ b/resources/css/admin-style.css @@ -224,3 +224,23 @@ @apply bg-patrimoine-sante-securite; } } + +// Maybe Refactor ? +ol { + @apply list-decimal list-inside; + + /* font-family: 'Railway', sans-serif; */ + li { + list-style-type: decimal !important; + list-style-position: inside !important; + position: relative !important; + padding-left: 1.5em !important; + } + li:marker { + position: absolute !important; + left: 0 !important; + } + .block-editor-rich-text__editable { + display: inline-block !important; + } +} diff --git a/resources/css/blocks/aides-financieres.css b/resources/css/blocks/aides-financieres.css old mode 100755 new mode 100644 diff --git a/resources/css/blocks/content-page-header.css b/resources/css/blocks/content-page-header.css index 3bf531d..e20c8ab 100644 --- a/resources/css/blocks/content-page-header.css +++ b/resources/css/blocks/content-page-header.css @@ -1,5 +1,5 @@ .block-content-page-header { - @apply py-8 md:py-16 flex gap-12 justify-between mx-auto; + @apply py-8 md:py-16 lg:flex gap-12 justify-between mx-auto; .section_titling { @apply px-0 !mb-1; diff --git a/resources/css/blocks/demarches-administratives.css b/resources/css/blocks/demarches-administratives.css old mode 100755 new mode 100644 diff --git a/resources/css/blocks/home-header.css b/resources/css/blocks/home-header.css old mode 100755 new mode 100644 diff --git a/resources/css/blocks/lightbox-gallery.css b/resources/css/blocks/lightbox-gallery.css index 38fd7d9..4f41a5e 100644 --- a/resources/css/blocks/lightbox-gallery.css +++ b/resources/css/blocks/lightbox-gallery.css @@ -1,11 +1,31 @@ .lightbox-gallery { @apply grid sm:grid-cols-2 lg:grid-cols-3 gap-6; img { - @apply h-full w-full object-cover max-h-80; + @apply h-full w-full object-cover max-h-80 rounded-lg; } &__picture { @apply pointer-events-none; } + &__trigger { + @apply block relative; + cursor: zoom-in; + /* content: url('../resources/img/graphic-assets/icone-external-link-purple.svg'); */ + + &:after { + transition: all 0.3s ease; + content: ''; + @apply bg-contain bg-center w-16 h-16 top-1/2 right-1/2 absolute z-40 content-['']; + @apply opacity-0; + transform: translateY(10px); + translate: 50% -50%; + background-image: url('../resources/img/graphic-assets/icone-focus-galerie.svg'); + } + + &:hover:after { + transform: translateY(0px); + @apply opacity-100; + } + } } .lightbox { @@ -56,20 +76,22 @@ } } &__container { - @apply relative flex justify-center items-center bg-white; + @apply relative flex justify-center items-center bg-white rounded-xl; width: 90%; height: fit-content; min-height: 90vh; @apply my-4 mx-auto; } - &__current-picture { img { - @apply h-full w-full max-w-xl; + @apply h-full w-full max-w-xl rounded-lg; max-height: 60vh; } } + &__current-picture-description { + @apply text-center text-neutral-800 pt-2; + } } @keyframes lightboxIn { diff --git a/resources/css/blocks/show-thematiques.css b/resources/css/blocks/show-thematiques.css old mode 100755 new mode 100644 index baf291d..02dd6db --- a/resources/css/blocks/show-thematiques.css +++ b/resources/css/blocks/show-thematiques.css @@ -81,87 +81,3 @@ pt-16; } } - -.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-visible { - @apply opacity-100; - filter: invert(13%) sepia(71%) saturate(4425%) hue-rotate(338deg) brightness(109%) - contrast(117%); - } - &:focus-visible { - @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-5 h-5 !mx-2 opacity-100 bg-white !border-2 !border-solid border-black; -} -.swiper-pagination-bullet:focus-visible { - 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/resources/css/components/informative-message.css b/resources/css/components/informative-message.css new file mode 100644 index 0000000..7159117 --- /dev/null +++ b/resources/css/components/informative-message.css @@ -0,0 +1,6 @@ +.informative-message { + @apply bg-primary text-white p-8 col-span-4 rounded-3xl flex justify-center; + img { + @apply mr-2; + } +} diff --git a/resources/css/components/previous-next-posts.css b/resources/css/components/previous-next-posts.css index fb2ba9a..de4f217 100644 --- a/resources/css/components/previous-next-posts.css +++ b/resources/css/components/previous-next-posts.css @@ -2,6 +2,7 @@ .previous-next-parcours, .previous-next-questions { @apply grid md:grid-cols-2 gap-x-6 gap-y-3 mx-auto max-w-screen-xl !px-6 xl:px-24 my-16; + &__previous, &__next { @apply flex gap-4 bg-white rounded-lg shadowed !py-4 px-6 items-center; @@ -12,6 +13,10 @@ @apply -translate-y-1 !bg-white; } } + + &__post-thumbnail { + @apply w-20 h-20 object-cover rounded-lg; + } &__previous { @apply text-left justify-end; &:after { diff --git a/resources/css/components/side-card.css b/resources/css/components/side-card.css new file mode 100644 index 0000000..d22d9eb --- /dev/null +++ b/resources/css/components/side-card.css @@ -0,0 +1,22 @@ +.side-card { + @apply py-4 px-6 w-fit bg-white shadowed text-neutral-900 + font-bold rounded-2xl flex items-center justify-center my-5 gap-6; + + transition: transform 0.3s; + &__title { + @apply leading-snug; + } + &__icon { + @apply w-16 h-16; + } + + &:after { + @apply content-[''] w-3 h-3 block bg-no-repeat bg-center bg-contain mt-1 ml-4; + background-image: url('../resources/img/pictogrammes/Homegrade_back_icon.svg'); + rotate: 180deg; + } + + &:hover { + @apply translate-x-2; + } +} diff --git a/resources/css/layout/header.css b/resources/css/layout/header.css index 5cdb0f9..bbe157b 100644 --- a/resources/css/layout/header.css +++ b/resources/css/layout/header.css @@ -1,8 +1,7 @@ /* Handling background page scroll */ body:has(header .menu-renovateur .sub-menu--open) { + @apply overflow-hidden; @media screen and (max-width: 960px) { - @apply overflow-hidden; - /* FIXING BUG ON SAFARI */ .menu-renovateur__mobile-menu-toggle, main { diff --git a/resources/css/layout/menu-homegrade.css b/resources/css/layout/menu-homegrade.css index 01bb8a3..f172e93 100644 --- a/resources/css/layout/menu-homegrade.css +++ b/resources/css/layout/menu-homegrade.css @@ -9,8 +9,8 @@ h-fit py-2 px-4 - pl-10 - md:pl-24 + lg:pl-0 + xl:pl-24 xl:px-8 2xl:px-32 my-0; @@ -61,7 +61,7 @@ &__navlist { @apply w-full - max-w-screen-2xl mx-auto lg:flex justify-center pr-0; + max-w-screen-2xl mx-auto lg:flex justify-center items-center pr-0; /* Highlight using list element */ li.current-page-parent > a, @@ -74,6 +74,7 @@ text-center rounded-xl; @apply w-fit lg:mx-0; + line-height: 1; button, a { @@ -96,6 +97,23 @@ outline-offset: 8px; } + &#menu-item-artisan-du-patrimoine { + @apply bg-white text-sm text-neutral-900 font-bold rounded-full mr-1 + 2xl:mr-8 mt-4 lg:mt-0; + transition: all 0.3s ease-out; + &:focus-within, + &:hover { + @apply text-primary translate-x-1; + } + a { + @apply flex items-center justify-center !py-1; + } + a:before { + @apply w-6 h-6 mr-2 bg-contain bg-center bg-no-repeat content-['']; + background-image: url('../resources/img/pictogrammes/Homegrade_artisans-patrimoine.svg'); + } + } + /* IF SUBMENU CHILD */ .menu-item__submenu-toggle { @apply pr-4; @@ -118,6 +136,12 @@ transform: translateY(20%) rotate(225deg); } } + /* .wpml-ls-legacy-list-horizontal { + @apply p-0; + } + .wpml-ls { + @apply !p-0; + } */ } /* &__burger-menu-toggle { @apply lg:hidden diff --git a/resources/css/layout/menu-mobile-brand.css b/resources/css/layout/menu-mobile-brand.css index 8e744d4..626b05a 100644 --- a/resources/css/layout/menu-mobile-brand.css +++ b/resources/css/layout/menu-mobile-brand.css @@ -82,7 +82,7 @@ header#main-header { } } -@media screen and (max-width: 1024px) { +@media screen and (max-width: 960px) { .menu-renovateur:not([opened]) { @apply h-0 opacity-0; transition: all 0.3s ease-in-out; diff --git a/resources/css/layout/menu-renovateur.css b/resources/css/layout/menu-renovateur.css index de22a79..7d74de2 100644 --- a/resources/css/layout/menu-renovateur.css +++ b/resources/css/layout/menu-renovateur.css @@ -3,8 +3,9 @@ px-4 xl:px-8 relative - flex - flex-wrap + lg:flex + flex-nowrap + xl:flex-wrap items-center justify-between lg:justify-center @@ -23,6 +24,7 @@ @apply order-1 mr-2 md:mr-12 + lg:mr-0 xl:mr-auto w-[140px] md:w-[190px] @@ -35,13 +37,10 @@ @apply !opacity-90 rounded-md; } } - /* &__main-elements { - @apply w-full bg-red-200 flex justify-between items-center; - } */ &__navlist { @apply w-fit - md:pl-14 + xl:pl-14 lg:mx-auto lg:flex justify-center; @@ -169,7 +168,7 @@ } &__submenu-toggle, > a { - @apply p-6 rounded-3xl + @apply lg:p-4 xl:p-6 rounded-3xl flex items-center; } @@ -305,7 +304,7 @@ .menu-item { &__submenu-toggle, > a { - @apply p-3; + @apply p-1 xl:p-3; } } } diff --git a/resources/css/pages/single-conseils.css b/resources/css/pages/single-conseils.css index 8478506..424f364 100644 --- a/resources/css/pages/single-conseils.css +++ b/resources/css/pages/single-conseils.css @@ -5,15 +5,20 @@ .conseils_wrapper { @apply lg:flex gap-x-8 max-w-screen-2xl mx-auto pb-12; + aside { + @apply lg:sticky + left-0 + h-fit + lg:max-w-md + top-4; + } .chapter_index { @apply bg-gray w-full - lg:max-w-md p-8 - h-fit - lg:sticky - left-0 - top-4 + + mb-4 + /* lg:sticky */ rounded-2xl; &__title { diff --git a/resources/img/demo-img/chauffage.jpg b/resources/img/demo-img/chauffage.jpg old mode 100755 new mode 100644 diff --git a/resources/img/illustrations/homegrade_brochure-impression-domicile.svg b/resources/img/illustrations/homegrade_brochure-impression-domicile.svg index 547e1a6..281ca01 100644 --- a/resources/img/illustrations/homegrade_brochure-impression-domicile.svg +++ b/resources/img/illustrations/homegrade_brochure-impression-domicile.svg @@ -1,75 +1,55 @@ - + - + - - - - - - + + + + + - - - - + + + + + + + - - - - + + + + + - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/resources/js/app.js b/resources/js/app.js index ecdf6d3..7842c31 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,4 +1,4 @@ -import editorInit from './editor'; +import editorInit from './editor-shortcode'; import menuInit from './menus'; import SchemaBulletPointsInit from './schema-bullet-points'; import taxonomyThematiqueFaqInit from './taxonomy-thematique-(faq)'; @@ -29,5 +29,4 @@ window.addEventListener('DOMContentLoaded', (event) => { // NOTIFICATIONS notificationsInit(); LightBoxSingle.init(); - }); diff --git a/resources/js/editor.js b/resources/js/editor-shortcode.js similarity index 100% rename from resources/js/editor.js rename to resources/js/editor-shortcode.js diff --git a/single-conseils.php b/single-conseils.php index b4c1619..23367fc 100644 --- a/single-conseils.php +++ b/single-conseils.php @@ -1,127 +1,119 @@ - - - - slug; - ?> - -
    "> - - - - - post_content); - $chapterBlockIndex = build_page_chapter_index($blocks); // see utilities.php - $queryArgs = array( - 'post_type' => 'brochures', - 'posts_per_page' => 1, - 'status' => 'publish', - 'tax_query' => array( - array( - 'taxonomy' => 'thematiques', - 'field' => 'term_id', - 'terms' => $currentThematique->term_id, - 'include_children' => false, - ) - ) - ); - $relatedBrochuresPosts = get_posts($queryArgs); - $relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null; - - $hasManualDocument = get_field('manual_source_document') ?? null; - $manualSrcDocument = get_field('manual_document_link'); - - $relatedDocumentUrl = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['source_document']) ? $manualSrcDocument['source_document']['url'] : $relatedBrochure['url'] ?? null; - $relatedDocumentCtaTitle = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['button_title']) ? $manualSrcDocument['button_title'] : __("Télécharger la brochure ", "homegrade-theme__texte-fonctionnel"); - - get_template_part('template-components/post-conseils/chapter-header', null, array( - 'postID' => get_the_ID(), - 'subtitle' => __("Les conseillers Homegrade vous guident", "homegrade-theme__texte-fonctionnel"), - 'title' => get_the_title(get_the_ID()), - 'ctaUrl' => $relatedDocumentUrl, - 'ctaTitle' => $relatedDocumentCtaTitle, - 'hasInfoCapsule' => true, - )); - - ?> - - - - -
    - - - - -
    "> - -
    - - -
    -
    - - - - - - - - - + + + slug; + ?> + +
    "> + + + + + post_content); + $chapterBlockIndex = build_page_chapter_index($blocks); // see utilities.php + $queryArgs = array( + 'post_type' => 'brochures', + 'posts_per_page' => 1, + 'status' => 'publish', + 'tax_query' => array( + array( + 'taxonomy' => 'thematiques', + 'field' => 'term_id', + 'terms' => $currentThematique->term_id, + 'include_children' => false, + ) + ) + ); + $relatedBrochuresPosts = get_posts($queryArgs); + $relatedBrochure = get_field('brochure_pdf', $relatedBrochuresPosts[0]->ID) ?? null; + + $hasManualDocument = get_field('manual_source_document') ?? null; + $manualSrcDocument = get_field('manual_document_link'); + + $relatedDocumentUrl = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['source_document']) ? $manualSrcDocument['source_document']['url'] : $relatedBrochure['url'] ?? null; + $relatedDocumentCtaTitle = ($hasManualDocument && $manualSrcDocument && $manualSrcDocument['button_title']) ? $manualSrcDocument['button_title'] : __("Télécharger la brochure ", "homegrade-theme__texte-fonctionnel"); + + get_template_part('template-components/post-conseils/chapter-header', null, array( + 'postID' => get_the_ID(), + 'subtitle' => __("Les conseillers Homegrade vous guident", "homegrade-theme__texte-fonctionnel"), + 'title' => get_the_title(get_the_ID()), + 'ctaUrl' => $relatedDocumentUrl, + 'ctaTitle' => $relatedDocumentCtaTitle, + 'hasInfoCapsule' => true, + )); + ?> + + +
    + + + + +
    "> + +
    + + +
    +
    + + + +slug; post_parent !== 0 ? get_post($currentPage->post_parent) : null; - $grandParentPage = $parentPage->post_parent ? get_post($parentPage->post_parent) : null; + $grandParentPage = $parentPage && $parentPage->post_parent ? get_post($parentPage->post_parent) : null; ?>
      diff --git a/template-components/header/menu-homegrade.php b/template-components/header/menu-homegrade.php index a418996..0aebc39 100644 --- a/template-components/header/menu-homegrade.php +++ b/template-components/header/menu-homegrade.php @@ -3,18 +3,17 @@ ?> \ No newline at end of file diff --git a/template-components/header/menu-renovateur.php b/template-components/header/menu-renovateur.php index cbfab4d..fade258 100644 --- a/template-components/header/menu-renovateur.php +++ b/template-components/header/menu-renovateur.php @@ -1,12 +1,9 @@ taxonomy !== 'nav_menu') die(); - - $menuitems = wp_get_nav_menu_items($menu->term_id, array('order' => 'DESC')); $logoID = get_theme_mod('custom_logo'); $logoSRC = wp_get_attachment_image_src($logoID, 'full'); @@ -224,5 +221,5 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full'); \ No newline at end of file diff --git a/template-components/header/mobile-brand.php b/template-components/header/mobile-brand.php index 884a15f..81d7d5a 100644 --- a/template-components/header/mobile-brand.php +++ b/template-components/header/mobile-brand.php @@ -1,5 +1,5 @@ @@ -41,5 +41,5 @@ $logoSRC = wp_get_attachment_image_src($logoID, 'full'); \ No newline at end of file diff --git a/template-components/header/search-module.php b/template-components/header/search-module.php index 1ef1091..bb3040a 100644 --- a/template-components/header/search-module.php +++ b/template-components/header/search-module.php @@ -1,5 +1,5 @@