diff --git a/package-lock.json b/package-lock.json index 7042a305..7ba4edef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "es6-slide-up-down": "^1.0.0", "flatpickr": "^4.6.9", "glightbox": "^3.0.9", + "htmx.org": "^1.9.12", "jquery": "^3.6.0", "lazysizes": "^5.3.2", "leaflet": "^1.7.1", @@ -3245,9 +3246,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001607", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001607.tgz", - "integrity": "sha512-WcvhVRjXLKFB/kmOFVwELtMxyhq3iM/MvmXcyCe2PNf166c39mptscOc/45TTS96n2gpNV2z7+NakArTWZCQ3w==", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true, "funding": [ { @@ -5067,6 +5068,11 @@ "entities": "^2.0.0" } }, + "node_modules/htmx.org": { + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.9.12.tgz", + "integrity": "sha512-VZAohXyF7xPGS52IM8d1T1283y+X4D+Owf3qY1NZ9RuBypyu9l8cGsxUMAG5fEAb/DhT7rDoJ9Hpu5/HxFD3cw==" + }, "node_modules/http-deceiver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", @@ -11751,9 +11757,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001607", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001607.tgz", - "integrity": "sha512-WcvhVRjXLKFB/kmOFVwELtMxyhq3iM/MvmXcyCe2PNf166c39mptscOc/45TTS96n2gpNV2z7+NakArTWZCQ3w==", + "version": "1.0.30001680", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001680.tgz", + "integrity": "sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==", "dev": true }, "chalk": { @@ -13099,6 +13105,11 @@ "entities": "^2.0.0" } }, + "htmx.org": { + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.9.12.tgz", + "integrity": "sha512-VZAohXyF7xPGS52IM8d1T1283y+X4D+Owf3qY1NZ9RuBypyu9l8cGsxUMAG5fEAb/DhT7rDoJ9Hpu5/HxFD3cw==" + }, "http-deceiver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", diff --git a/package.json b/package.json index 92835d4a..87aaa4e2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "es6-slide-up-down": "^1.0.0", "flatpickr": "^4.6.9", "glightbox": "^3.0.9", + "htmx.org": "^1.9.12", "jquery": "^3.6.0", "lazysizes": "^5.3.2", "leaflet": "^1.7.1", diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTeaserPopupController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTeaserPopupController.php new file mode 100644 index 00000000..a97b2e3d --- /dev/null +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxTeaserPopupController.php @@ -0,0 +1,17 @@ +view->assignMultiple([ + 'concept' => $concept, + 'targetUrl' => $targetUrl, + ]); + } +} diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index 94bae688..5b242f7f 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -135,8 +135,8 @@ class ProductRepository extends AbstractRepository 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'season as season', 'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton', - 'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName', - 'date.concept_popup_text as conceptPopupText', 'board', 'new' + 'low_contingent as lowContingent', 'concept as conceptUid', 'concept_code as conceptCode', + 'concept_name as conceptName', 'concept_popup_text as conceptPopupText', 'board', 'new' ) ->from('tx_epproducts_domain_model_date', 'date') ->where('date_start >= NOW()') diff --git a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php index 99302cae..db775ef5 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php @@ -203,6 +203,7 @@ class ProductDataService implements SingletonInterface 'images' => $this->productImageService->getImages($teaserData['productUid']), ], 'concept' => [ + 'uid' => $teaserData['conceptUid'], 'name' => $teaserData['conceptName'], 'code' => $teaserData['conceptCode'], 'popupText' => $teaserData['conceptPopupText'], diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php index 0e5a3eec..14fae715 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_concept.php @@ -225,6 +225,7 @@ return [ 'cols' => 40, 'rows' => 5, 'eval' => 'trim', + 'enableRichtext' => true, ], ], 'teaser_images' => [ diff --git a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript index f367eeaf..389db905 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript +++ b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript @@ -181,6 +181,9 @@ tx_epproducts_ajax_json { AjaxGroupsPrice { 1 = processForm } + AjaxTeaserPopup { + 1 = concept + } } features.requireCHashArgumentForActionArguments = 0 settings =< plugin.tx_epproducts.settings diff --git a/public/typo3conf/ext/ep_products/ext_localconf.php b/public/typo3conf/ext/ep_products/ext_localconf.php index 97c5ad49..46982863 100644 --- a/public/typo3conf/ext/ep_products/ext_localconf.php +++ b/public/typo3conf/ext/ep_products/ext_localconf.php @@ -268,6 +268,7 @@ $boot = function () { 'AjaxCalendar' => 'range,contingents,availableRooms', 'AjaxWatchlist' => 'list', 'AjaxGroupsPrice' => 'processForm', + 'AjaxTeaserPopup' => 'concept', ], [ 'AjaxSearch' => 'searchresult', @@ -278,6 +279,7 @@ $boot = function () { 'AjaxCalendar' => 'range,contingents,availableRooms', 'AjaxWatchlist' => 'list', 'AjaxGroupsPrice' => 'processForm', + 'AjaxTeaserPopup' => 'concept', ] ); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js index afd449a2..75a4ebde 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/_app.js @@ -44,3 +44,8 @@ import { definitionsFromContext } from '@hotwired/stimulus-webpack-helpers' const application = Application.start() const context = require.context('./controllers', true, /\.js$/) application.load(definitionsFromContext(context)) + +window.htmx = require('htmx.org') +htmx.config.includeIndicatorStyles = false +htmx.config.historyEnabled = false +htmx.config.allowScriptTags = false diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/modal_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/modal_controller.js index 0fbd109a..c3f21504 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/modal_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/modal_controller.js @@ -15,4 +15,8 @@ export default class extends Controller { close() { this.element.classList.add('hidden', true) } + + remove() { + this.element.remove() + } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js deleted file mode 100644 index 3478af55..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_controller.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Controller } from '@hotwired/stimulus' - -export default class extends Controller { - - static outlets = ['teaser-popup-modal'] - static values = { - title: { - type: String, - default: 'Hinweis', - }, - text: String, - } - - open(e) { - if (this.hasTextValue) { - this.teaserPopupModalOutlet.titleTarget.innerText = this.titleValue - this.teaserPopupModalOutlet.contentTarget.innerHTML = this.textValue - this.teaserPopupModalOutlet.buttonTarget.href = this.element.href - this.teaserPopupModalOutlet.open() - } - - e.preventDefault() - } -} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_modal_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_modal_controller.js deleted file mode 100644 index 17e72ad3..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/teaser_popup_modal_controller.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Controller } from '@hotwired/stimulus' - -export default class extends Controller { - - static targets = ['title', 'content', 'button'] - - open() { - this.element.classList.remove('hidden') - } - - close() { - this.element.classList.add('hidden') - } -} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Detail.html index b526450a..ac0416cb 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Detail.html @@ -13,6 +13,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Frontpage.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Frontpage.html index b6dca80b..ce4df0b2 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Frontpage.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Frontpage.html @@ -19,6 +19,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/FrontpageEvent.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/FrontpageEvent.html index 5cf3690c..0f32426d 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/FrontpageEvent.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/FrontpageEvent.html @@ -10,6 +10,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Search.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Search.html index 49e225d0..c7511022 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Search.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Search.html @@ -8,6 +8,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Subpage.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Subpage.html index 4cd24fb5..9b04e84f 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Subpage.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/Subpage.html @@ -21,6 +21,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeft.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeft.html index 7570d257..8fed5a6b 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeft.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeft.html @@ -25,6 +25,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeftEvent.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeftEvent.html index 3591feea..2561d283 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeftEvent.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarLeftEvent.html @@ -19,6 +19,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRight.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRight.html index fe1c9dd5..4c50d5d7 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRight.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRight.html @@ -25,6 +25,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRightEvent.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRightEvent.html index 3b5e30f9..56266e55 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRightEvent.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Page/SubpageSidebarRightEvent.html @@ -19,6 +19,5 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html index ea6d0857..f97fb94f 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html @@ -5,6 +5,7 @@ xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"> +
@@ -13,12 +14,11 @@
- - data-controller="teaser-popup" - data-teaser-popup-text-value="{concept.popupText}" - data-teaser-popup-teaser-popup-modal-outlet="#teaser-popup-modal" - data-action="teaser-popup#open" + hx-get="{ep:uri.ajax(action: 'concept', controller: 'AjaxTeaserPopup', arguments: '{concept: concept.uid, targetUrl: targetUrl}', format: 'html', pageUid: settings.defaultAjaxUid)}" + hx-target="body" + hx-swap="beforeend" title="{region.name} {product.name} Details und Buchen"> @@ -78,12 +78,11 @@ {f:variable(name: 'including', value: '{f:render(section: \'Including\', arguments: \'{_all}\') -> v:format.trim()}')} - - data-controller="teaser-popup" - data-teaser-popup-text-value="{concept.popupText}" - data-teaser-popup-teaser-popup-modal-outlet="#teaser-popup-modal" - data-action="teaser-popup#open" + hx-get="{ep:uri.ajax(action: 'concept', controller: 'AjaxTeaserPopup', arguments: '{concept: concept.uid, targetUrl: targetUrl}', format: 'html', pageUid: settings.defaultAjaxUid)}" + hx-target="body" + hx-swap="beforeend" title="{region.name} {product.name} Details und Buchen" class="flex-1 flex flex-col space-y-1 px-2 py-4 md:p-4"> diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserPopup.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserPopup.html deleted file mode 100644 index 8eecfd9c..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/TeaserPopup.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTeaserPopup/Concept.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTeaserPopup/Concept.html new file mode 100644 index 00000000..50ffe861 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTeaserPopup/Concept.html @@ -0,0 +1,43 @@ + + + + + +
+
+
+
+ + Hinweis + + +
+
+
+ +
+

+ {concept.name} +

+ {concept.popupText -> f:format.html()} + + Ok + +
+
+
+
+
+ +
+ +