Compare commits
No commits in common. "237bf0ef31beefe113c6e3e270df4019145eb3ba" and "66844703597505492fdd11dbba1fa943680d741d" have entirely different histories.
237bf0ef31
...
6684470359
|
|
@ -82,33 +82,6 @@ function carhop_create_posttype()
|
|||
'taxonomies' => array('category'),
|
||||
)
|
||||
);
|
||||
|
||||
// Communiqué de presse — affiché sous le menu « Presse » (parent créé dans le thème)
|
||||
register_post_type(
|
||||
'communique-presse',
|
||||
array(
|
||||
'labels' => array(
|
||||
'name' => __('Communiqués de presse'),
|
||||
'singular_name' => __('Communiqué de presse'),
|
||||
'add_new' => __('Ajouter un communiqué'),
|
||||
'add_new_item' => __('Ajouter un communiqué de presse'),
|
||||
'edit_item' => __('Modifier le communiqué'),
|
||||
'new_item' => __('Nouveau communiqué'),
|
||||
'view_item' => __('Voir le communiqué'),
|
||||
'search_items' => __('Rechercher un communiqué'),
|
||||
'not_found' => __('Aucun communiqué trouvé'),
|
||||
'not_found_in_trash' => __('Aucun communiqué dans la corbeille'),
|
||||
'all_items' => __('Communiqués de presse'),
|
||||
'menu_name' => __('Communiqués de presse'),
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'rewrite' => array('slug' => 'communiques-presse'),
|
||||
'show_in_rest' => true,
|
||||
'show_in_menu' => 'carhop-presse',
|
||||
'supports' => array('title', 'custom-fields'),
|
||||
)
|
||||
);
|
||||
}
|
||||
add_action('init', 'carhop_create_posttype');
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@
|
|||
],
|
||||
"supports": {
|
||||
"align": [
|
||||
"full",
|
||||
"wide"
|
||||
"full"
|
||||
]
|
||||
},
|
||||
"acf": {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ $teamMembers = get_posts(array(
|
|||
'posts_per_page' => -1,
|
||||
));
|
||||
|
||||
|
||||
$placeholder_thumbnail_counter = 0;
|
||||
$personnalized_order = get_field('personnalized_order');
|
||||
$members_manually_sorted = get_field('members_manually_sorted');
|
||||
|
|
@ -16,7 +17,7 @@ if ($personnalized_order) {
|
|||
|
||||
?>
|
||||
|
||||
<section <?php echo get_block_wrapper_attributes(array('class' => 'team-authors content-section')); ?>>
|
||||
<section class="team-authors content-section" <?php echo get_block_wrapper_attributes(); ?>>
|
||||
<div class="container">
|
||||
<ul class="comity-type__list">
|
||||
<?php foreach ($teamMembers as $member) : ?>
|
||||
|
|
|
|||
|
|
@ -921,28 +921,6 @@ return array(
|
|||
'style' => 'file:./style-index.css',
|
||||
'viewScript' => 'file:./view.js'
|
||||
),
|
||||
'press-ressources' => array(
|
||||
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
||||
'apiVersion' => 3,
|
||||
'name' => 'carhop-blocks/press-ressources',
|
||||
'version' => '0.1.0',
|
||||
'title' => 'Ressources pour la presse',
|
||||
'category' => 'carhop-blocks',
|
||||
'icon' => 'smiley',
|
||||
'description' => 'Ressources pour la presse',
|
||||
'example' => array(
|
||||
|
||||
),
|
||||
'supports' => array(
|
||||
'html' => false
|
||||
),
|
||||
'textdomain' => 'carhop-blocks',
|
||||
'editorScript' => 'file:./index.js',
|
||||
'editorStyle' => 'file:./index.css',
|
||||
'style' => 'file:./style-index.css',
|
||||
'render' => 'file:./render.php',
|
||||
'viewScript' => 'file:./view.js'
|
||||
),
|
||||
'scroll-story-block' => array(
|
||||
'$schema' => 'https://schemas.wp.org/trunk/block.json',
|
||||
'apiVersion' => 3,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "carhop-blocks/press-ressources",
|
||||
"version": "0.1.0",
|
||||
"title": "Ressources pour la presse",
|
||||
"category": "carhop-blocks",
|
||||
"icon": "smiley",
|
||||
"description": "Ressources pour la presse",
|
||||
"example": {},
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"textdomain": "carhop-blocks",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"render": "file:./render.php",
|
||||
"viewScript": "file:./view.js"
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/press-ressources/editor.scss ***!
|
||||
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-create-block-chapo {
|
||||
border: 1px dotted #f00;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-i18n', 'wp-server-side-render'), 'version' => 'cbf665ebc2b4e5ba373c');
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/press-ressources/editor.scss ***!
|
||||
\******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-create-block-chapo {
|
||||
border: 1px dotted #f00;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=index.css.map*/
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"press-ressources/index.css","mappings":";;;AAAA;;;;EAAA;AAMA;EACC;AAAD,C","sources":["webpack://carhop-blocks/./src/press-ressources/editor.scss"],"sourcesContent":["/**\n * The following styles get applied inside the editor only.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-create-block-chapo {\n\tborder: 1px dotted #f00;\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
||||
|
|
@ -1,327 +0,0 @@
|
|||
/******/ (() => { // webpackBootstrap
|
||||
/******/ "use strict";
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ "./src/press-ressources/block.json":
|
||||
/*!*****************************************!*\
|
||||
!*** ./src/press-ressources/block.json ***!
|
||||
\*****************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = /*#__PURE__*/JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"carhop-blocks/press-ressources","version":"0.1.0","title":"Ressources pour la presse","category":"carhop-blocks","icon":"smiley","description":"Ressources pour la presse","example":{},"supports":{"html":false},"textdomain":"carhop-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","render":"file:./render.php","viewScript":"file:./view.js"}');
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/press-ressources/edit.js":
|
||||
/*!**************************************!*\
|
||||
!*** ./src/press-ressources/edit.js ***!
|
||||
\**************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (/* binding */ Edit)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
|
||||
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor");
|
||||
/* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__);
|
||||
/* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./editor.scss */ "./src/press-ressources/editor.scss");
|
||||
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render");
|
||||
/* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3__);
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Edit() {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
||||
...(0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)({
|
||||
className: "alignwide"
|
||||
}),
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_3___default()), {
|
||||
block: "carhop-blocks/press-ressources"
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/press-ressources/editor.scss":
|
||||
/*!******************************************!*\
|
||||
!*** ./src/press-ressources/editor.scss ***!
|
||||
\******************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/press-ressources/index.js":
|
||||
/*!***************************************!*\
|
||||
!*** ./src/press-ressources/index.js ***!
|
||||
\***************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
|
||||
/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./style.scss */ "./src/press-ressources/style.scss");
|
||||
/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edit */ "./src/press-ressources/edit.js");
|
||||
/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block.json */ "./src/press-ressources/block.json");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "react/jsx-runtime");
|
||||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_3__.name, {
|
||||
icon: {
|
||||
src: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("svg", {
|
||||
width: "32",
|
||||
height: "32",
|
||||
viewBox: "0 0 32 32",
|
||||
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("path", {
|
||||
d: "M16 24L8 16L16 8L24 16L16 24Z"
|
||||
})
|
||||
})
|
||||
},
|
||||
edit: _edit__WEBPACK_IMPORTED_MODULE_2__["default"]
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/press-ressources/style.scss":
|
||||
/*!*****************************************!*\
|
||||
!*** ./src/press-ressources/style.scss ***!
|
||||
\*****************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
// extracted by mini-css-extract-plugin
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/block-editor":
|
||||
/*!*************************************!*\
|
||||
!*** external ["wp","blockEditor"] ***!
|
||||
\*************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["blockEditor"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/blocks":
|
||||
/*!********************************!*\
|
||||
!*** external ["wp","blocks"] ***!
|
||||
\********************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["blocks"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/i18n":
|
||||
/*!******************************!*\
|
||||
!*** external ["wp","i18n"] ***!
|
||||
\******************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["i18n"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "@wordpress/server-side-render":
|
||||
/*!******************************************!*\
|
||||
!*** external ["wp","serverSideRender"] ***!
|
||||
\******************************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["wp"]["serverSideRender"];
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "react/jsx-runtime":
|
||||
/*!**********************************!*\
|
||||
!*** external "ReactJSXRuntime" ***!
|
||||
\**********************************/
|
||||
/***/ ((module) => {
|
||||
|
||||
module.exports = window["ReactJSXRuntime"];
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
/************************************************************************/
|
||||
/******/ // The module cache
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
||||
/******/ if (cachedModule !== undefined) {
|
||||
/******/ return cachedModule.exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = __webpack_module_cache__[moduleId] = {
|
||||
/******/ // no module.id needed
|
||||
/******/ // no module.loaded needed
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = __webpack_modules__;
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/chunk loaded */
|
||||
/******/ (() => {
|
||||
/******/ var deferred = [];
|
||||
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
|
||||
/******/ if(chunkIds) {
|
||||
/******/ priority = priority || 0;
|
||||
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
|
||||
/******/ deferred[i] = [chunkIds, fn, priority];
|
||||
/******/ return;
|
||||
/******/ }
|
||||
/******/ var notFulfilled = Infinity;
|
||||
/******/ for (var i = 0; i < deferred.length; i++) {
|
||||
/******/ var [chunkIds, fn, priority] = deferred[i];
|
||||
/******/ var fulfilled = true;
|
||||
/******/ for (var j = 0; j < chunkIds.length; j++) {
|
||||
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
|
||||
/******/ chunkIds.splice(j--, 1);
|
||||
/******/ } else {
|
||||
/******/ fulfilled = false;
|
||||
/******/ if(priority < notFulfilled) notFulfilled = priority;
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ if(fulfilled) {
|
||||
/******/ deferred.splice(i--, 1)
|
||||
/******/ var r = fn();
|
||||
/******/ if (r !== undefined) result = r;
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ return result;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/compat get default export */
|
||||
/******/ (() => {
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = (module) => {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ () => (module['default']) :
|
||||
/******/ () => (module);
|
||||
/******/ __webpack_require__.d(getter, { a: getter });
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/define property getters */
|
||||
/******/ (() => {
|
||||
/******/ // define getter functions for harmony exports
|
||||
/******/ __webpack_require__.d = (exports, definition) => {
|
||||
/******/ for(var key in definition) {
|
||||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
||||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/make namespace object */
|
||||
/******/ (() => {
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = (exports) => {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ /* webpack/runtime/jsonp chunk loading */
|
||||
/******/ (() => {
|
||||
/******/ // no baseURI
|
||||
/******/
|
||||
/******/ // object to store loaded and loading chunks
|
||||
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||
/******/ var installedChunks = {
|
||||
/******/ "press-ressources/index": 0,
|
||||
/******/ "press-ressources/style-index": 0
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // no chunk on demand loading
|
||||
/******/
|
||||
/******/ // no prefetching
|
||||
/******/
|
||||
/******/ // no preloaded
|
||||
/******/
|
||||
/******/ // no HMR
|
||||
/******/
|
||||
/******/ // no HMR manifest
|
||||
/******/
|
||||
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
|
||||
/******/
|
||||
/******/ // install a JSONP callback for chunk loading
|
||||
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
||||
/******/ var [chunkIds, moreModules, runtime] = data;
|
||||
/******/ // add "moreModules" to the modules object,
|
||||
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||
/******/ var moduleId, chunkId, i = 0;
|
||||
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
||||
/******/ for(moduleId in moreModules) {
|
||||
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
||||
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ if(runtime) var result = runtime(__webpack_require__);
|
||||
/******/ }
|
||||
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
||||
/******/ for(;i < chunkIds.length; i++) {
|
||||
/******/ chunkId = chunkIds[i];
|
||||
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
||||
/******/ installedChunks[chunkId][0]();
|
||||
/******/ }
|
||||
/******/ installedChunks[chunkId] = 0;
|
||||
/******/ }
|
||||
/******/ return __webpack_require__.O(result);
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ var chunkLoadingGlobal = globalThis["webpackChunkcarhop_blocks"] = globalThis["webpackChunkcarhop_blocks"] || [];
|
||||
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
||||
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
||||
/******/ })();
|
||||
/******/
|
||||
/************************************************************************/
|
||||
/******/
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["press-ressources/style-index"], () => (__webpack_require__("./src/press-ressources/index.js")))
|
||||
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
||||
/******/
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=index.js.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,147 +0,0 @@
|
|||
<?php
|
||||
$wrapper_attributes = get_block_wrapper_attributes(['class' => 'press-ressources alignwide']);
|
||||
|
||||
$contact_persons = get_field('contact_persons', 'option');
|
||||
$ressources_graphiques = get_field('ressources_graphiques', 'option');
|
||||
|
||||
?>
|
||||
|
||||
<section <?php echo $wrapper_attributes; ?>>
|
||||
<div class="contact-persons">
|
||||
<div class="contact-persons__content">
|
||||
|
||||
<ul class="contact-persons__list">
|
||||
<?php foreach ($contact_persons as $person) : ?>
|
||||
<?php get_template_part('template-parts/cards/author-card', '', array('member_id' => $person->ID)); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="press-toolbar" class="press-toolbar">
|
||||
<div role="tablist" aria-labelledby="tablist-1" class="tablist">
|
||||
<button id="tab-1" type="button" role="tab" aria-selected="true" aria-controls="tabpanel-1" data-tab="communiques">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plan.svg" alt="">
|
||||
<span>Communiqués de presse</span>
|
||||
</button>
|
||||
|
||||
|
||||
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="ressources-graphiques">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
||||
<span>Ressources graphiques</span>
|
||||
</button>
|
||||
|
||||
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1" data-tab="presse-reviews">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt="">
|
||||
<span>Ce que la presse dit de nous</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ressources-tabs-grid ressources-grid-content-wrapper" data-active-tab="communiques">
|
||||
<div class="communiques-de-presse">
|
||||
<?php
|
||||
$communiques_de_presse = get_posts(array(
|
||||
'post_type' => 'communique-presse',
|
||||
'posts_per_page' => 10,
|
||||
));
|
||||
?>
|
||||
<h2 class="communiques-de-presse__title">Nos Communiqués de presse</h2>
|
||||
|
||||
|
||||
<div class="communiques-de-presse__list">
|
||||
|
||||
<?php foreach ($communiques_de_presse as $communique) : ?>
|
||||
<div class="communique-card">
|
||||
<h3><?php echo get_the_title($communique->ID); ?></h3>
|
||||
<p><?php echo get_the_date('d F Y', $communique->ID); ?></p>
|
||||
<a href="<?php echo get_permalink($communique->ID); ?>" class="button">Voir le communiqué</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ressources-graphiques">
|
||||
<h2 class="ressources-graphiques__title">Ressources</h2>
|
||||
|
||||
<ul class="contact-datas">
|
||||
<li class="contact-datas__item">
|
||||
<h3>contact direct</h3>
|
||||
<a href="mailto:info@carhop.be">info@carhop.be</a>
|
||||
<a href="tel:+3267485861">+32 67 48 58 61</a>
|
||||
</li>
|
||||
|
||||
<li class="contact-datas__item">
|
||||
<h3>Adresse postale</h3>
|
||||
<p>Avenue de la Houssière, 80
|
||||
<br>7090 Braine-le-Comte
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="contact-datas__item socials">
|
||||
<h3>Réseaux sociaux</h3>
|
||||
<?php echo carhop_display_social_links(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 class="ressources-graphiques__title is-style-stroked-after">Ressources graphiques</h2>
|
||||
|
||||
<?php if (isset($ressources_graphiques) && !empty($ressources_graphiques)) : ?>
|
||||
<ul class="download-list">
|
||||
<div class="list-heading" aria-hidden="true">
|
||||
<span>Type de fichier</span>
|
||||
<span>Format</span>
|
||||
<span>Poids</span>
|
||||
</div>
|
||||
<?php foreach ($ressources_graphiques as $ressource) : ?>
|
||||
|
||||
<?php if (!isset($ressource['file']) || empty($ressource['file'])) continue; ?>
|
||||
<li class="download-list__item">
|
||||
<a href="<?php echo esc_url($ressource['file']['url']); ?>" download>
|
||||
<span class="file-name"><?php echo $ressource['file']['title']; ?></span>
|
||||
<span class="file-format"><?php echo $ressource['file']['subtype']; ?></span>
|
||||
<span class="file-size"><?php echo size_format($ressource['file']['filesize']); ?></span>
|
||||
<span class="download-link">Télécharger</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<li class="download-list__item">
|
||||
<a href="/assets/carhop-logo-couleurs.jpg" download>
|
||||
<span class="file-name">Logo CARHOP (couleurs) en JPG</span>
|
||||
<span class="file-format">JPG</span>
|
||||
<span class="file-size">124 ko</span>
|
||||
<span class="download-link">Télécharger</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="sr-only">
|
||||
Liste des fichiers disponibles au téléchargement, avec leur format et leur poids.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="presse-reviews">
|
||||
<h2 class="presse-reviews__title"><?php echo get_the_title(1135); ?> </h2>
|
||||
<?php
|
||||
// Récupérer la page et simuler son contexte pour charger les scripts des blocs
|
||||
$page_1135 = get_post(1135);
|
||||
if ($page_1135) {
|
||||
global $post;
|
||||
$original_post = $post;
|
||||
$post = $page_1135;
|
||||
setup_postdata($post);
|
||||
|
||||
// Utiliser do_blocks() pour parser et rendre les blocs correctement
|
||||
// Cela déclenche le chargement des scripts view.js des blocs
|
||||
echo do_blocks($page_1135->post_content);
|
||||
|
||||
wp_reset_postdata();
|
||||
$post = $original_post;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/press-ressources/style.scss ***!
|
||||
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied both on the front of your site
|
||||
* and in the editor.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-create-block-chapo {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||
!*** css ./node_modules/.pnpm/css-loader@6.11.0_webpack@5.103.0/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/.pnpm/postcss-loader@6.2.1_postcss@8.5.6_webpack@5.103.0/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/.pnpm/sass-loader@16.0.6_sass@1.94.1_webpack@5.103.0/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/press-ressources/style.scss ***!
|
||||
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||
/**
|
||||
* The following styles get applied both on the front of your site
|
||||
* and in the editor.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
.wp-block-create-block-chapo {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style-index.css.map*/
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"press-ressources/style-index.css","mappings":";;;AAAA;;;;;EAAA;AAOA;EACC;EACA;EACA;AAAD,C","sources":["webpack://carhop-blocks/./src/press-ressources/style.scss"],"sourcesContent":["/**\n * The following styles get applied both on the front of your site\n * and in the editor.\n *\n * Replace them with your own styles or remove the file completely.\n */\n\n.wp-block-create-block-chapo {\n\tbackground-color: #21759b;\n\tcolor: #fff;\n\tpadding: 2px;\n}\n"],"names":[],"ignoreList":[],"sourceRoot":""}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<?php return array('dependencies' => array(), 'version' => '519a0e2709812a903d67');
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/******/ (() => { // webpackBootstrap
|
||||
/*!**************************************!*\
|
||||
!*** ./src/press-ressources/view.js ***!
|
||||
\**************************************/
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const toolbar = document.querySelector("#press-toolbar");
|
||||
if (!toolbar) return;
|
||||
const toolbarButtons = toolbar.querySelectorAll("button");
|
||||
const ressourcesGridContentWrapper = document.querySelector(".ressources-grid-content-wrapper");
|
||||
function setActiveTab(currentButton) {
|
||||
toolbarButtons.forEach(button => {
|
||||
button.setAttribute("aria-selected", "false");
|
||||
});
|
||||
currentButton.setAttribute("aria-selected", "true");
|
||||
ressourcesGridContentWrapper.setAttribute("data-active-tab", currentButton.getAttribute("data-tab"));
|
||||
}
|
||||
function initToolbar() {
|
||||
toolbarButtons.forEach(button => {
|
||||
button.addEventListener("click", function () {
|
||||
setActiveTab(button);
|
||||
});
|
||||
});
|
||||
}
|
||||
initToolbar();
|
||||
});
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=view.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"press-ressources/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,MAAMC,OAAO,GAAGF,QAAQ,CAACG,aAAa,CAAC,gBAAgB,CAAC;EACxD,IAAI,CAACD,OAAO,EAAE;EACd,MAAME,cAAc,GAAGF,OAAO,CAACG,gBAAgB,CAAC,QAAQ,CAAC;EACzD,MAAMC,4BAA4B,GAAGN,QAAQ,CAACG,aAAa,CAC1D,kCACD,CAAC;EAED,SAASI,YAAYA,CAACC,aAAa,EAAE;IACpCJ,cAAc,CAACK,OAAO,CAAEC,MAAM,IAAK;MAClCA,MAAM,CAACC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC;IAC9C,CAAC,CAAC;IAEFH,aAAa,CAACG,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC;IACnDL,4BAA4B,CAACK,YAAY,CACxC,iBAAiB,EACjBH,aAAa,CAACI,YAAY,CAAC,UAAU,CACtC,CAAC;EACF;EAEA,SAASC,WAAWA,CAAA,EAAG;IACtBT,cAAc,CAACK,OAAO,CAAEC,MAAM,IAAK;MAClCA,MAAM,CAACT,gBAAgB,CAAC,OAAO,EAAE,YAAY;QAC5CM,YAAY,CAACG,MAAM,CAAC;MACrB,CAAC,CAAC;IACH,CAAC,CAAC;EACH;EACAG,WAAW,CAAC,CAAC;AACd,CAAC,CAAC,C","sources":["webpack://carhop-blocks/./src/press-ressources/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\r\n\tconst toolbar = document.querySelector(\"#press-toolbar\");\r\n\tif (!toolbar) return;\r\n\tconst toolbarButtons = toolbar.querySelectorAll(\"button\");\r\n\tconst ressourcesGridContentWrapper = document.querySelector(\r\n\t\t\".ressources-grid-content-wrapper\"\r\n\t);\r\n\r\n\tfunction setActiveTab(currentButton) {\r\n\t\ttoolbarButtons.forEach((button) => {\r\n\t\t\tbutton.setAttribute(\"aria-selected\", \"false\");\r\n\t\t});\r\n\r\n\t\tcurrentButton.setAttribute(\"aria-selected\", \"true\");\r\n\t\tressourcesGridContentWrapper.setAttribute(\r\n\t\t\t\"data-active-tab\",\r\n\t\t\tcurrentButton.getAttribute(\"data-tab\")\r\n\t\t);\r\n\t}\r\n\r\n\tfunction initToolbar() {\r\n\t\ttoolbarButtons.forEach((button) => {\r\n\t\t\tbutton.addEventListener(\"click\", function () {\r\n\t\t\t\tsetActiveTab(button);\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\tinitToolbar();\r\n});\r\n"],"names":["document","addEventListener","toolbar","querySelector","toolbarButtons","querySelectorAll","ressourcesGridContentWrapper","setActiveTab","currentButton","forEach","button","setAttribute","getAttribute","initToolbar"],"ignoreList":[],"sourceRoot":""}
|
||||
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '025809f38879d8aa4d9f');
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '1f52d271b768de8e56d3');
|
||||
|
|
|
|||
|
|
@ -39,15 +39,15 @@ __webpack_require__.r(__webpack_exports__);
|
|||
|
||||
// Enregistrement du style de bloc
|
||||
|
||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/columns", {
|
||||
name: "sticky-columns",
|
||||
label: "Colonnes sticky"
|
||||
(0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockStyle)("core/column", {
|
||||
name: "sticky-column",
|
||||
label: "Colonne sticky"
|
||||
});
|
||||
|
||||
// Fonction pour vérifier si le style sticky-columns est appliqué
|
||||
const hasStickyColumnsStyle = attributes => {
|
||||
const hasStickyColumnStyle = attributes => {
|
||||
const className = attributes?.className || "";
|
||||
return className.includes("is-style-sticky-columns");
|
||||
return className.includes("is-style-sticky-column");
|
||||
};
|
||||
|
||||
// -----------------------------
|
||||
|
|
@ -55,7 +55,7 @@ const hasStickyColumnsStyle = attributes => {
|
|||
// -----------------------------
|
||||
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("blocks.getSaveElement", "carhop/sticky-columns-wrapper", (element, blockType, attributes) => {
|
||||
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||
if (blockType.name !== "core/columns" || !hasStickyColumnsStyle(attributes)) {
|
||||
if (blockType.name !== "core/column" || !hasStickyColumnStyle(attributes)) {
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
@ -64,59 +64,37 @@ const hasStickyColumnsStyle = attributes => {
|
|||
return element;
|
||||
}
|
||||
|
||||
// Envelopper chaque colonne individuellement dans une div avec la classe "test"
|
||||
const children = _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Children.toArray(element.props.children);
|
||||
const wrappedChildren = children.map((child, index) => {
|
||||
// Si c'est un élément React (une colonne), l'envelopper dans une div
|
||||
if (child && typeof child === "object" && child.type) {
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||
key: `sticky-column-wrapper-${index}`,
|
||||
className: "test"
|
||||
}, child);
|
||||
}
|
||||
// Sinon, retourner tel quel
|
||||
return child;
|
||||
});
|
||||
// Envelopper les enfants dans une div avec la classe "sticky-column-wrapper"
|
||||
const wrappedChildren = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||
className: "sticky-column-wrapper"
|
||||
}, element.props.children);
|
||||
|
||||
// Retourner l'élément avec les enfants enveloppés
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(element, {
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)(element.type, {
|
||||
...element.props,
|
||||
children: wrappedChildren
|
||||
});
|
||||
}, wrappedChildren);
|
||||
});
|
||||
|
||||
// -----------------------------
|
||||
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
||||
// Note: Le rendu côté serveur est géré par render.php
|
||||
// Pour l'éditeur, on utilise un filtre sur BlockEdit pour modifier le rendu
|
||||
// -----------------------------
|
||||
(0,_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__.addFilter)("editor.BlockEdit", "carhop/sticky-columns-editor-wrapper", (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__.createHigherOrderComponent)(BlockEdit => {
|
||||
return props => {
|
||||
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||
if (props.name !== "core/columns" || !hasStickyColumnsStyle(props.attributes)) {
|
||||
// Vérifier si c'est le bloc core/column et si le style sticky-column est appliqué
|
||||
if (props.name !== "core/column" || !hasStickyColumnStyle(props.attributes)) {
|
||||
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
|
||||
// Récupérer le rendu du bloc
|
||||
const blockEditElement = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||
console.log(props);
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||
className: "sticky-column-wrapper"
|
||||
}, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(BlockEdit, {
|
||||
...props
|
||||
});
|
||||
|
||||
// Si l'élément a des enfants (les inner blocks), on les enveloppe dans une div avec la classe "test"
|
||||
if (blockEditElement && blockEditElement.props && blockEditElement.props.children) {
|
||||
// Cloner l'élément et envelopper les enfants dans une div avec la classe "test"
|
||||
return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.cloneElement)(blockEditElement, {
|
||||
...blockEditElement.props,
|
||||
children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createElement)("div", {
|
||||
className: "test"
|
||||
}, blockEditElement.props.children)
|
||||
});
|
||||
}
|
||||
return blockEditElement;
|
||||
}));
|
||||
};
|
||||
}, "withStickyColumnsWrapper"));
|
||||
}, "withStickyColumnWrapper"));
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,18 +1,23 @@
|
|||
import { registerBlockStyle } from "@wordpress/blocks";
|
||||
import { addFilter } from "@wordpress/hooks";
|
||||
import { createElement, cloneElement, Children } from "@wordpress/element";
|
||||
import {
|
||||
createElement,
|
||||
Fragment,
|
||||
cloneElement,
|
||||
Children,
|
||||
} from "@wordpress/element";
|
||||
import { createHigherOrderComponent } from "@wordpress/compose";
|
||||
|
||||
// Enregistrement du style de bloc
|
||||
registerBlockStyle("core/columns", {
|
||||
name: "sticky-columns",
|
||||
label: "Colonnes sticky",
|
||||
registerBlockStyle("core/column", {
|
||||
name: "sticky-column",
|
||||
label: "Colonne sticky",
|
||||
});
|
||||
|
||||
// Fonction pour vérifier si le style sticky-columns est appliqué
|
||||
const hasStickyColumnsStyle = (attributes) => {
|
||||
const hasStickyColumnStyle = (attributes) => {
|
||||
const className = attributes?.className || "";
|
||||
return className.includes("is-style-sticky-columns");
|
||||
return className.includes("is-style-sticky-column");
|
||||
};
|
||||
|
||||
// -----------------------------
|
||||
|
|
@ -23,10 +28,7 @@ addFilter(
|
|||
"carhop/sticky-columns-wrapper",
|
||||
(element, blockType, attributes) => {
|
||||
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||
if (
|
||||
blockType.name !== "core/columns" ||
|
||||
!hasStickyColumnsStyle(attributes)
|
||||
) {
|
||||
if (blockType.name !== "core/column" || !hasStickyColumnStyle(attributes)) {
|
||||
return element;
|
||||
}
|
||||
|
||||
|
|
@ -35,68 +37,47 @@ addFilter(
|
|||
return element;
|
||||
}
|
||||
|
||||
// Envelopper chaque colonne individuellement dans une div avec la classe "test"
|
||||
const children = Children.toArray(element.props.children);
|
||||
const wrappedChildren = children.map((child, index) => {
|
||||
// Si c'est un élément React (une colonne), l'envelopper dans une div
|
||||
if (child && typeof child === "object" && child.type) {
|
||||
return createElement(
|
||||
"div",
|
||||
{ key: `sticky-column-wrapper-${index}`, className: "test" },
|
||||
child,
|
||||
);
|
||||
}
|
||||
// Sinon, retourner tel quel
|
||||
return child;
|
||||
});
|
||||
// Envelopper les enfants dans une div avec la classe "sticky-column-wrapper"
|
||||
const wrappedChildren = createElement(
|
||||
"div",
|
||||
{ className: "sticky-column-wrapper" },
|
||||
element.props.children,
|
||||
);
|
||||
|
||||
// Retourner l'élément avec les enfants enveloppés
|
||||
return cloneElement(element, {
|
||||
...element.props,
|
||||
children: wrappedChildren,
|
||||
});
|
||||
return createElement(
|
||||
element.type,
|
||||
{
|
||||
...element.props,
|
||||
children: wrappedChildren,
|
||||
},
|
||||
wrappedChildren,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
// -----------------------------
|
||||
// 2. Modifier l'affichage dans l'éditeur pour envelopper les colonnes dans une div avec la classe "test"
|
||||
// Note: Le rendu côté serveur est géré par render.php
|
||||
// Pour l'éditeur, on utilise un filtre sur BlockEdit pour modifier le rendu
|
||||
// -----------------------------
|
||||
addFilter(
|
||||
"editor.BlockEdit",
|
||||
"carhop/sticky-columns-editor-wrapper",
|
||||
createHigherOrderComponent((BlockEdit) => {
|
||||
return (props) => {
|
||||
// Vérifier si c'est le bloc core/columns et si le style sticky-columns est appliqué
|
||||
// Vérifier si c'est le bloc core/column et si le style sticky-column est appliqué
|
||||
if (
|
||||
props.name !== "core/columns" ||
|
||||
!hasStickyColumnsStyle(props.attributes)
|
||||
props.name !== "core/column" ||
|
||||
!hasStickyColumnStyle(props.attributes)
|
||||
) {
|
||||
return <BlockEdit {...props} />;
|
||||
}
|
||||
console.log(props);
|
||||
|
||||
// Récupérer le rendu du bloc
|
||||
const blockEditElement = <BlockEdit {...props} />;
|
||||
|
||||
// Si l'élément a des enfants (les inner blocks), on les enveloppe dans une div avec la classe "test"
|
||||
if (
|
||||
blockEditElement &&
|
||||
blockEditElement.props &&
|
||||
blockEditElement.props.children
|
||||
) {
|
||||
// Cloner l'élément et envelopper les enfants dans une div avec la classe "test"
|
||||
return cloneElement(blockEditElement, {
|
||||
...blockEditElement.props,
|
||||
children: createElement(
|
||||
"div",
|
||||
{ className: "test" },
|
||||
blockEditElement.props.children,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
return blockEditElement;
|
||||
return createElement(
|
||||
"div",
|
||||
{ className: "sticky-column-wrapper" },
|
||||
<BlockEdit {...props} />,
|
||||
);
|
||||
};
|
||||
}, "withStickyColumnsWrapper"),
|
||||
}, "withStickyColumnWrapper"),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "carhop-blocks/press-ressources",
|
||||
"version": "0.1.0",
|
||||
"title": "Ressources pour la presse",
|
||||
"category": "carhop-blocks",
|
||||
"icon": "smiley",
|
||||
"description": "Ressources pour la presse",
|
||||
"example": {},
|
||||
"supports": {
|
||||
"html": false
|
||||
},
|
||||
"textdomain": "carhop-blocks",
|
||||
"editorScript": "file:./index.js",
|
||||
"editorStyle": "file:./index.css",
|
||||
"style": "file:./style-index.css",
|
||||
"render": "file:./render.php",
|
||||
"viewScript": "file:./view.js"
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import { __ } from "@wordpress/i18n";
|
||||
import { useBlockProps } from "@wordpress/block-editor";
|
||||
import "./editor.scss";
|
||||
import ServerSideRender from "@wordpress/server-side-render";
|
||||
|
||||
export default function Edit() {
|
||||
return (
|
||||
<div {...useBlockProps({ className: "alignwide" })}>
|
||||
<ServerSideRender block="carhop-blocks/press-ressources" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
/**
|
||||
* The following styles get applied inside the editor only.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
|
||||
.wp-block-create-block-chapo {
|
||||
border: 1px dotted #f00;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { registerBlockType } from "@wordpress/blocks";
|
||||
import "./style.scss";
|
||||
|
||||
import Edit from "./edit";
|
||||
import metadata from "./block.json";
|
||||
|
||||
registerBlockType(metadata.name, {
|
||||
icon: {
|
||||
src: (
|
||||
<svg width="32" height="32" viewBox="0 0 32 32">
|
||||
<path d="M16 24L8 16L16 8L24 16L16 24Z" />
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
edit: Edit,
|
||||
});
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
<?php
|
||||
$wrapper_attributes = get_block_wrapper_attributes(['class' => 'press-ressources alignwide']);
|
||||
|
||||
$contact_persons = get_field('contact_persons', 'option');
|
||||
$ressources_graphiques = get_field('ressources_graphiques', 'option');
|
||||
|
||||
?>
|
||||
|
||||
<section <?php echo $wrapper_attributes; ?>>
|
||||
<div class="contact-persons">
|
||||
<div class="contact-persons__content">
|
||||
|
||||
<ul class="contact-persons__list">
|
||||
<?php foreach ($contact_persons as $person) : ?>
|
||||
<?php get_template_part('template-parts/cards/author-card', '', array('member_id' => $person->ID)); ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="press-toolbar" class="press-toolbar">
|
||||
<div role="tablist" aria-labelledby="tablist-1" class="tablist">
|
||||
<button id="tab-1" type="button" role="tab" aria-selected="true" aria-controls="tabpanel-1" data-tab="communiques">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plan.svg" alt="">
|
||||
<span>Communiqués de presse</span>
|
||||
</button>
|
||||
|
||||
|
||||
<button id="tab-2" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-2" tabindex="-1" data-tab="ressources-graphiques">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-plume.svg" alt="">
|
||||
<span>Ressources graphiques</span>
|
||||
</button>
|
||||
|
||||
<button id="tab-3" type="button" role="tab" aria-selected="false" aria-controls="tabpanel-3" tabindex="-1" data-tab="presse-reviews">
|
||||
<img class="icon" src="<?php echo get_template_directory_uri(); ?>/resources/img/icons/carhop-note-biographique.svg" alt="">
|
||||
<span>Ce que la presse dit de nous</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ressources-tabs-grid ressources-grid-content-wrapper" data-active-tab="communiques">
|
||||
<div class="communiques-de-presse">
|
||||
<?php
|
||||
$communiques_de_presse = get_posts(array(
|
||||
'post_type' => 'communique-presse',
|
||||
'posts_per_page' => 10,
|
||||
));
|
||||
?>
|
||||
<h2 class="communiques-de-presse__title">Nos Communiqués de presse</h2>
|
||||
|
||||
|
||||
<div class="communiques-de-presse__list">
|
||||
|
||||
<?php foreach ($communiques_de_presse as $communique) : ?>
|
||||
<div class="communique-card">
|
||||
<h3><?php echo get_the_title($communique->ID); ?></h3>
|
||||
<p><?php echo get_the_date('d F Y', $communique->ID); ?></p>
|
||||
<a href="<?php echo get_permalink($communique->ID); ?>" class="button">Voir le communiqué</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ressources-graphiques">
|
||||
<h2 class="ressources-graphiques__title">Ressources</h2>
|
||||
|
||||
<ul class="contact-datas">
|
||||
<li class="contact-datas__item">
|
||||
<h3>contact direct</h3>
|
||||
<a href="mailto:info@carhop.be">info@carhop.be</a>
|
||||
<a href="tel:+3267485861">+32 67 48 58 61</a>
|
||||
</li>
|
||||
|
||||
<li class="contact-datas__item">
|
||||
<h3>Adresse postale</h3>
|
||||
<p>Avenue de la Houssière, 80
|
||||
<br>7090 Braine-le-Comte
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li class="contact-datas__item socials">
|
||||
<h3>Réseaux sociaux</h3>
|
||||
<?php echo carhop_display_social_links(); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 class="ressources-graphiques__title is-style-stroked-after">Ressources graphiques</h2>
|
||||
|
||||
<?php if (isset($ressources_graphiques) && !empty($ressources_graphiques)) : ?>
|
||||
<ul class="download-list">
|
||||
<div class="list-heading" aria-hidden="true">
|
||||
<span>Type de fichier</span>
|
||||
<span>Format</span>
|
||||
<span>Poids</span>
|
||||
</div>
|
||||
<?php foreach ($ressources_graphiques as $ressource) : ?>
|
||||
|
||||
<?php if (!isset($ressource['file']) || empty($ressource['file'])) continue; ?>
|
||||
<li class="download-list__item">
|
||||
<a href="<?php echo esc_url($ressource['file']['url']); ?>" download>
|
||||
<span class="file-name"><?php echo $ressource['file']['title']; ?></span>
|
||||
<span class="file-format"><?php echo $ressource['file']['subtype']; ?></span>
|
||||
<span class="file-size"><?php echo size_format($ressource['file']['filesize']); ?></span>
|
||||
<span class="download-link">Télécharger</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<li class="download-list__item">
|
||||
<a href="/assets/carhop-logo-couleurs.jpg" download>
|
||||
<span class="file-name">Logo CARHOP (couleurs) en JPG</span>
|
||||
<span class="file-format">JPG</span>
|
||||
<span class="file-size">124 ko</span>
|
||||
<span class="download-link">Télécharger</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<div class="sr-only">
|
||||
Liste des fichiers disponibles au téléchargement, avec leur format et leur poids.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="presse-reviews">
|
||||
<h2 class="presse-reviews__title"><?php echo get_the_title(1135); ?> </h2>
|
||||
<?php
|
||||
// Récupérer la page et simuler son contexte pour charger les scripts des blocs
|
||||
$page_1135 = get_post(1135);
|
||||
if ($page_1135) {
|
||||
global $post;
|
||||
$original_post = $post;
|
||||
$post = $page_1135;
|
||||
setup_postdata($post);
|
||||
|
||||
// Utiliser do_blocks() pour parser et rendre les blocs correctement
|
||||
// Cela déclenche le chargement des scripts view.js des blocs
|
||||
echo do_blocks($page_1135->post_content);
|
||||
|
||||
wp_reset_postdata();
|
||||
$post = $original_post;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
* The following styles get applied both on the front of your site
|
||||
* and in the editor.
|
||||
*
|
||||
* Replace them with your own styles or remove the file completely.
|
||||
*/
|
||||
|
||||
.wp-block-create-block-chapo {
|
||||
background-color: #21759b;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const toolbar = document.querySelector("#press-toolbar");
|
||||
if (!toolbar) return;
|
||||
const toolbarButtons = toolbar.querySelectorAll("button");
|
||||
const ressourcesGridContentWrapper = document.querySelector(
|
||||
".ressources-grid-content-wrapper"
|
||||
);
|
||||
|
||||
function setActiveTab(currentButton) {
|
||||
toolbarButtons.forEach((button) => {
|
||||
button.setAttribute("aria-selected", "false");
|
||||
});
|
||||
|
||||
currentButton.setAttribute("aria-selected", "true");
|
||||
ressourcesGridContentWrapper.setAttribute(
|
||||
"data-active-tab",
|
||||
currentButton.getAttribute("data-tab")
|
||||
);
|
||||
}
|
||||
|
||||
function initToolbar() {
|
||||
toolbarButtons.forEach((button) => {
|
||||
button.addEventListener("click", function () {
|
||||
setActiveTab(button);
|
||||
});
|
||||
});
|
||||
}
|
||||
initToolbar();
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user