diff --git a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxContentController.php b/web/typo3conf/ext/ep_products/Classes/Controller/AjaxContentController.php deleted file mode 100644 index 37455407..00000000 --- a/web/typo3conf/ext/ep_products/Classes/Controller/AjaxContentController.php +++ /dev/null @@ -1,108 +0,0 @@ -, dreipunktnull - * - * All rights reserved - * - * This script is part of the TYPO3 project. The TYPO3 project is - * free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * The GNU General Public License can be found at - * http://www.gnu.org/copyleft/gpl.html. - * - * This script is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * This copyright notice MUST APPEAR in all copies of the script! - ***************************************************************/ - -use EP\EpProducts\Domain\Model\City; -use EP\EpProducts\Domain\Model\Country; -use EP\EpProducts\Domain\Model\Hotel; -use EP\EpProducts\Domain\Model\Journey; -use EP\EpProducts\Domain\Model\Product; -use EP\EpProducts\Domain\Model\Region; -use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; - -class AjaxContentController extends ActionController -{ - - /** - * @param Product $product - * @param Hotel $hotel - * @param integer $referringPageUid - */ - public function productAction(Product $product, Hotel $hotel = null, $referringPageUid = null) - { - $this->view->assignMultiple([ - 'hotel' => $hotel, - 'product' => $product, - 'referringPageUid' => $referringPageUid, - ]); - } - - /** - * @param Hotel $hotel - */ - public function hotelAction(Hotel $hotel) - { - $this->view->assign('hotel', $hotel); - } - - /** - * @param Country $country - */ - public function countryAction(Country $country) - { - $this->view->assign('country', $country); - } - - /** - * @param Region $region - */ - public function regionAction(Region $region) - { - $this->view->assign('region', $region); - } - - /** - * @param City $city - */ - public function cityAction(City $city) - { - $this->view->assign('city', $city); - } - - /** - * @param Journey $journey - */ - public function journeyAction(Journey $journey) - { - $this->view->assign('journey', $journey); - } - - /** - * @param Region $region - */ - public function webcamAction(Region $region) - { - $webcam = $region->getWebcam(); - $available = ($webcam !== null && $webcam->getAvailable()); - $this->view->assignMultiple([ - 'region' => $region, - 'webcam' => $webcam, - 'available' => $available, - ]); - } -} diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Region.php b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Region.php index fa9e6d91..1d1d4186 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Model/Region.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Model/Region.php @@ -392,6 +392,15 @@ class Region extends AbstractDestination implements TeaserInterface return $this->webcam; } + /** + * @return bool + */ + public function getWebcamAvailable() + { + $webcam = $this->getWebcam(); + return $webcam !== null && $webcam->getAvailable(); + } + /** * @param Webcam $webcam */ diff --git a/web/typo3conf/ext/ep_products/Configuration/TypoScript/setup.txt b/web/typo3conf/ext/ep_products/Configuration/TypoScript/setup.txt index fa9d1ad9..9c2fb473 100644 --- a/web/typo3conf/ext/ep_products/Configuration/TypoScript/setup.txt +++ b/web/typo3conf/ext/ep_products/Configuration/TypoScript/setup.txt @@ -110,15 +110,6 @@ tx_epproducts_ajax_json { AjaxFilterpanel { 1 = autocomplete } - AjaxContent { - 1 = country - 2 = region - 3 = city - 4 = hotel - 5 = product - 6 = journey - 7 = webcam - } AjaxTable { 1 = pricetable 2 = pricetableHtml diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue index 33f573df..6b924b19 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ProductDetail.vue @@ -39,7 +39,7 @@ priceTableShow: false, detailShow: false, loading: true, - activeUri: null, + activeSection: null, singleDate: false } }, @@ -79,7 +79,7 @@ }, loadDatesView () { this.loadDates(); - this.activeUri = 'dates'; + this.activeSection = 'dates'; this.scrollToMain(); }, loadPriceTable (dateUid) { @@ -103,21 +103,18 @@ this.loadPriceTable(dateuid); this.scrollToMain(); }, - loadHtml (uri, scroll = true) { - this.loading = true; + showHtml (section, scroll = true) { this.datesShow = false; this.priceTableShow = false; this.detailShow = true; - const ajaxUri = this.uris[uri]; - $.get(ajaxUri, (html) => { - this.detailHtml = html; - this.loading = false; - if (scroll) { - this.scrollToMain(); - } - EventBus.$emit('ajaxContentLoaded'); + if (scroll) { + this.scrollToMain(); + } + this.activeSection = section; + // 'Wake up' Slick slider after changing visibility + Vue.nextTick(() => { + $('.slider--content > .slider__items').slick('setPosition'); }); - this.activeUri = uri; }, scrollToMain () { EventBus.$emit('scrollTo', '#main'); @@ -134,7 +131,7 @@ mounted () { Vue.nextTick(() => { if (this.hotelFirst) { - this.loadHtml('hotel', false); + this.showHtml('hotel', false); } else { this.loadDatesView(); } diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Journey/Details.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Journey/Details.html new file mode 100644 index 00000000..bd58c6ab --- /dev/null +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Journey/Details.html @@ -0,0 +1,13 @@ + +
Anreise
+
+

Eigenanreise

+{journey.byCar -> f:format.html()} + + {journey.image.alternative} + + +

Busanreise

+ {journey.byBus -> f:format.html()} +
diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Webcam.html b/web/typo3conf/ext/ep_theme/Resources/Private/Partials/Region/Webcam.html similarity index 100% rename from web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Webcam.html rename to web/typo3conf/ext/ep_theme/Resources/Private/Partials/Region/Webcam.html diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/City.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/City.html deleted file mode 100644 index f7d7d2fa..00000000 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/City.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Hotel.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Hotel.html deleted file mode 100644 index 3814937a..00000000 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Hotel.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Journey.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Journey.html deleted file mode 100644 index ad2fadb4..00000000 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Journey.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
Anreise
-

Eigenanreise

- {journey.byCar -> f:format.html()} - - {journey.image.alternative} - - -

Busanreise

- {journey.byBus -> f:format.html()} -
-
- - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Region.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Region.html deleted file mode 100644 index 7f9c7a83..00000000 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxContent/Region.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 759751ff..dead1119 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -14,11 +14,7 @@ :filter-settings='{filterSettings}' :uris='{ dates: "{ep:uri.ajax(action: 'dates', controller: 'AjaxDate', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1)}", - pricetable: "{ep:uri.ajax(action: 'pricetable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1)}", - hotel: "{ep:uri.ajax(action: 'hotel', controller: 'AjaxContent', arguments: '{hotel: hotel}', format: 'html')}", - region: "{ep:uri.ajax(action: 'region', controller: 'AjaxContent', arguments: '{region: product.region}', format: 'html')}", - city: "{ep:uri.ajax(action: 'city', controller: 'AjaxContent', arguments: '{city: product.city}', format: 'html')}", - journey: "{ep:uri.ajax(action: 'journey', controller: 'AjaxContent', arguments: '{journey: product.journey}', format: 'html')}" + pricetable: "{ep:uri.ajax(action: 'pricetable', controller: 'AjaxTable', arguments: '{product: product, hotel: hotel}', format: 'json', noCacheHash: 1)}" }' argument-prefix='' :hotel-first="{f:if(condition: settings.hotelOnTop, then: 'true', else: 'false')}" @@ -37,12 +33,12 @@ + v-bind:class="{ 'button--active': activeSection === 'hotel'}" + v-on:click.prevent="showHtml('hotel')">Unterkunft @@ -53,27 +49,27 @@ + v-bind:class="{ 'button--active': activeSection === 'hotel'}" + v-on:click.prevent="showHtml('hotel')">Unterkunft + v-bind:class="{ 'button--active': activeSection === 'region'}" + v-on:click.prevent="showHtml('region')">Gebiet
+ v-bind:class="{ 'button--active': activeSection === 'city'}" + v-on:click.prevent="showHtml('city')">Ort + v-bind:class="{ 'button--active': activeSection === 'journey'}" + v-on:click.prevent="showHtml('journey')">Anreise
@@ -113,6 +109,7 @@
+
@@ -146,12 +143,36 @@
+ +
-
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +

Loading...

+
- +