Compare commits

..

No commits in common. "92084f78265448bcfac93e4583cb2096e47ff50c" and "bb842dedc4fe7757bd8c5eb9bb2115960d76a09a" have entirely different histories.

10 changed files with 15 additions and 140 deletions

View File

@ -1,26 +0,0 @@
{
"name": "acf/gallery",
"title": "Galerie",
"category": "carhop-blocks",
"multiple": false,
"icon": {
"foreground": "#136f63",
"src": "groups"
},
"keywords": [
"galerie",
"photos",
"images"
],
"supports": {
"align": [
"full"
]
},
"acf": {
"mode": "auto",
"renderTemplate": "gallery.php"
},
"viewScript": "file:./view.js",
"align": "full"
}

View File

@ -1,42 +0,0 @@
<?php
$gallery = get_field('gallery');
// Charger le script JavaScript
wp_enqueue_script('carhop-gallery-view');
?>
<section class="block-gallery gallery content-section">
<div class="gallery__slider">
<?php if ($gallery && is_array($gallery)) : ?>
<div class="swiper gallery-swiper">
<div class="swiper-wrapper">
<?php foreach ($gallery as $image) : ?>
<div class="swiper-slide">
<div class="gallery-card">
<div class="gallery-card__image">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="swiper-pagination-fraction"></div>
<div class="swiper-pagination"></div>
<div class="swiper-controls">
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
</div>
<?php endif; ?>
</div>
</section>

View File

@ -1,36 +0,0 @@
document.addEventListener("DOMContentLoaded", function () {
const galleries = document.querySelectorAll(".block-gallery");
if (!galleries) return;
const currentBlock = document.querySelector(".block-gallery");
if (!currentBlock) return;
const swiperFraction = currentBlock.querySelector(".swiper-pagination-fraction");
const slides = currentBlock.querySelectorAll(".swiper-slide");
const slideCount = slides.length;
swiperFraction.textContent = `Article n°1 sur ${slideCount}`;
new Swiper(".gallery-swiper", {
slidesPerView: 2,
spaceBetween: 30,
loop: true,
grabCursor: true,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
clickable: true,
renderBullet: function (index, className) {
return `<button class="${className}"></button>`;
},
},
on: {
slideChange: (swiper) => {
const slidesCount = swiper?.slides?.length;
swiperFraction.textContent = `Photo n°${swiper.realIndex + 1} sur ${slidesCount}`;
},
},
});
});

View File

@ -11,7 +11,7 @@
"supports": {
"html": false
},
"textdomain": "carhop-blocks",
"textdomain": "deliblocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '4148e87939fccf7f9ff3');
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-primitives'), 'version' => '4d7a8310574bcf753578');

View File

@ -41,7 +41,7 @@ const trash = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx
\************************/
/***/ ((module) => {
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#ffffff"},"backgroundOrientation":{"type":"string","default":"left","enum":["left","right"]}},"usesContext":["postType","postId"]}');
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/chapter-section","version":"0.1.0","title":" Section Chapitre","category":"carhop-blocks","icon":"smiley","description":"Example block scaffolded with Create Block tool.","example":{},"supports":{"html":false},"textdomain":"deliblocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","viewScript":"file:./view.js","render":"file:./render.php","attributes":{"align":{"type":"string","default":"full"},"coverUrl":{"type":"string"},"coverAlt":{"type":"string"},"coverId":{"type":"number"},"coverSize":{"type":"string","default":"large","enum":["small","medium","grande","large"]},"disposition":{"type":"string","default":"left","enum":["left","right"]},"hasBackgroundColor":{"type":"boolean","default":false},"backgroundColor":{"type":"string","default":"#ffffff"},"backgroundOrientation":{"type":"string","default":"left","enum":["left","right"]}},"usesContext":["postType","postId"]}');
/***/ }),
@ -238,16 +238,16 @@ function Edit({
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
className: "chapter-section__innerblocks",
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks, {
template: [["carhop-blocks/heading", {
innerBlocks: [["core/heading", {
template: [["core/heading", {
className: "chapter-section__title",
placeholder: "Chapter Title",
content: "Un titre précis "
}]]
}], ["core/paragraph", {
className: "chapter-section__title",
placeholder: "Chapter Title",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse augue augue, sagittis quis mauris in, consequat vehicula est. Aliquam quis nulla ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras bibendum eget lorem eget aliquet. Fusce vel consequat neque. "
}]],
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "carhop-blocks/cta", "carhop-blocks/heading"]
allowedBlocks: ["core/heading", "core/paragraph", "core/list", "core/button", "core/buttons", "carhop-blocks/cta"]
})
})
}), coverUrl && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("img", {

File diff suppressed because one or more lines are too long

View File

@ -179,19 +179,14 @@ export default function Edit({ attributes, setAttributes, ...props }) {
<div className="chapter-section__innerblocks">
<InnerBlocks
template={[
[
"carhop-blocks/heading",
{
innerBlocks: [
[
"core/heading",
{
className: "chapter-section__title",
placeholder: "Chapter Title",
content: "Un titre précis ",
},
],
],
},
],
[
"core/paragraph",
{
@ -209,7 +204,6 @@ export default function Edit({ attributes, setAttributes, ...props }) {
"core/button",
"core/buttons",
"carhop-blocks/cta",
"carhop-blocks/heading",
]}
/>
</div>

View File

@ -48,18 +48,6 @@ function carhop_register_blocks()
register_block_type(__DIR__ . '/blocks/decorative-shapes/build');
register_block_type(__DIR__ . '/blocks/narrative-card/build');
register_block_type(__DIR__ . '/blocks/scroll-story-block/build');
register_block_type(__DIR__ . '/acf-blocks/gallery');
// Enregistrer le script pour le bloc gallery
wp_register_script(
'carhop-gallery-view',
plugins_url('acf-blocks/gallery/view.js', __FILE__),
array(),
filemtime(__DIR__ . '/acf-blocks/gallery/view.js'),
true
);
}
add_action('init', 'carhop_register_blocks');

View File

@ -26,8 +26,7 @@ $authors = get_posts(array(
<?php $comities_related_authors = get_posts(array(
'post_type' => 'auteurs',
'posts_per_page' => -1,
'meta_key' => 'last_name',
'orderby' => 'meta_value',
'orderby' => 'title',
'order' => 'ASC',
'meta_query' => array(
array(
@ -53,10 +52,8 @@ $authors = get_posts(array(
$author_description = get_field('description', $author->ID);
$author_email = get_field('email', $author->ID);
$is_director = $author->ID === 476 ? true : false;
?>
<li class="comity-type__item author-card <?php echo $is_director ? 'author-card--director' : ''; ?>">
<li class="comity-type__item author-card ">
<div class="author-card__profile-picture">
<?php if ($author_thumbnail) : ?>
<img src="<?php echo $author_thumbnail['url']; ?>" alt="<?php echo $author_thumbnail['alt']; ?>">