diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php index 5e32f586..f74fad71 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/AjaxCalendarController.php @@ -56,7 +56,7 @@ class AjaxCalendarController extends ActionController * @param string $month * @param int $months */ - public function rangeAction(Hotel $hotel, $year = null, $month = null, $months = 6) + public function rangeAction(Hotel $hotel, $year = null, $month = null, $months = 1) { [ $begin, $end ] = DateUtility::getDateRange($year, $month, $months); 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 b5f4e4dc..ca485796 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 @@ -29,6 +29,8 @@ import productDetail from './components/product-detail' import daytripDateSelect from './components/daytrip-date-select' import searchBar from './components/search-bar' import search from './components/search' +import calendar from './components/calendar' +import contactForm from './components/contact-form' import defaultFilterSettings from './_filtersettings' import defaultFilterOptions from './_filteroptions' @@ -63,6 +65,8 @@ document.addEventListener('DOMContentLoaded', () => { Alpine.data('daytripDateSelect', daytripDateSelect) Alpine.data('searchBar', searchBar) Alpine.data('search', search) + Alpine.data('calendar', calendar) + Alpine.data('contactForm', contactForm) Alpine.start() Glightbox({ @@ -70,64 +74,3 @@ document.addEventListener('DOMContentLoaded', () => { slideEffect: 'fade', }) }) - - -/// LEGACY CODE FROM HERE /// - -// Import dependencies -// import Vue from 'vue' -// import $ from 'jquery' -// import dayjs from 'dayjs' -// import 'dayjs/locale/de' - -// global.$ = global.jQuery = $; - -// require('bootstrap-sass/assets/javascripts/bootstrap/dropdown') -// require('bootstrap-sass/assets/javascripts/bootstrap/modal') -// require('bootstrap-sass/assets/javascripts/bootstrap/transition') - -// Import components -// import SearchBar from './components/SearchBar.vue' -// import SearchBox from './components/SearchBox.vue' -//import ProductDetail from './components/ProductDetail.vue' -// import Calendar from './components/Calendar.vue' -// import EventPricetable from './components/EventPriceTable.vue' -// import ContactForm from './components/ContactForm.vue' -// import Watchlist from './components/Watchlist.vue' -// import HotelList from './components/HotelList.vue' - -// Define date filter for vue templates -// Vue.filter('date', (value) => { -// return dayjs(value).format('DD.MM.YY'); -// }); - -// Store -// import store from './store'; - -// Initialize vue app -// new Vue({ -// el: '#app', -// store, -// components: { -// SearchBar, -// //SearchBox, -// //SearchResult: () => import('./components/SearchResult.vue'), -// //ProductDetail, -// //Calendar, -// //EventPricetable, -// //ContactForm, -// //Watchlist, -// //HotelList, -// //MyEp: () => import('./myep/App.vue'), -// //GroupsPriceCalculator: () => import('./components/GroupsPriceCalculator.vue'), -// }, -// data () { -// return { -// maxWindowWidth: 991, -// mobileMode: false, -// } -// }, -// created () { -// this.$store.dispatch('init'); -// }, -// }); diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BoardTypesSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BoardTypesSelect.vue deleted file mode 100644 index f37271c8..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BoardTypesSelect.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BusSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BusSelect.vue deleted file mode 100644 index 35da1f97..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/BusSelect.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Calendar.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Calendar.vue deleted file mode 100644 index 885f4051..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Calendar.vue +++ /dev/null @@ -1,115 +0,0 @@ - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptButtons.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptButtons.vue deleted file mode 100644 index 7e7b65bd..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptButtons.vue +++ /dev/null @@ -1,13 +0,0 @@ - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptSelect.vue deleted file mode 100644 index 3a2a7895..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ConceptSelect.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ContactForm.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ContactForm.vue deleted file mode 100644 index 7dff1974..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ContactForm.vue +++ /dev/null @@ -1,47 +0,0 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue deleted file mode 100644 index 9e7270aa..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DaterangeSelect.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationAutocomplete.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationAutocomplete.vue deleted file mode 100644 index 23995c9a..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationAutocomplete.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationCheckboxes.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationCheckboxes.vue deleted file mode 100644 index 89a0d92a..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationCheckboxes.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationSelect.vue deleted file mode 100644 index 9fb19038..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DestinationSelect.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/EventPriceTable.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/EventPriceTable.vue deleted file mode 100644 index e9db7228..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/EventPriceTable.vue +++ /dev/null @@ -1,94 +0,0 @@ - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue index 0bcfc4cf..42b5cf78 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue @@ -114,7 +114,6 @@ diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelTypesSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelTypesSelect.vue deleted file mode 100644 index 1d5dcd03..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/HotelTypesSelect.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/NightsSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/NightsSelect.vue deleted file mode 100644 index e8a956bc..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/NightsSelect.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PaxSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PaxSelect.vue deleted file mode 100644 index f664ff00..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PaxSelect.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue deleted file mode 100644 index ceaa1460..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/PriceRangeSelect.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/RoomTypesSelect.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/RoomTypesSelect.vue deleted file mode 100644 index bac8654c..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/RoomTypesSelect.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBar.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBar.vue deleted file mode 100644 index 37fde676..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBar.vue +++ /dev/null @@ -1,82 +0,0 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBox.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBox.vue deleted file mode 100644 index 6b20bc43..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchBox.vue +++ /dev/null @@ -1,70 +0,0 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue deleted file mode 100644 index 17538777..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResult.vue +++ /dev/null @@ -1,214 +0,0 @@ - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue deleted file mode 100644 index 013750db..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/SearchResultItem.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Watchlist.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Watchlist.vue deleted file mode 100644 index 86900d95..00000000 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/Watchlist.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ajax-content.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ajax-content.js index aeca8ff0..f16a9000 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ajax-content.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/ajax-content.js @@ -7,13 +7,13 @@ export default uri => ({ loading: false, init() { window.addEventListener('scroll', debounce(() => { + if (true === this.loaded) { + return + } this.load() }, 250)) }, load() { - if (true === this.loaded) { - return - } if (false === this.inViewport()) { return } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js new file mode 100644 index 00000000..986b9a9a --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/calendar.js @@ -0,0 +1,42 @@ +import axios from 'axios' + +export default uri => ({ + loading: false, + selectedIndex: null, + selectableMonths: [], + calendarWrapper: null, + init() { + this.calendarWrapper = this.$refs.calendarWrapper + let months = [] + let today = new Date() + let year = today.getFullYear() + let month = today.getMonth() + for (let i = 0; i < 20; i++) { + months.push(new Date(year, month, 1)) + if (month < 12) { + month++ + } else { + month = 1 + year++ + } + } + this.selectableMonths = months + this.selectedIndex = 0 + this.load() + }, + load() { + this.loading = true + let selectedMonth = this.selectableMonths[this.selectedIndex] + let data = new URLSearchParams({ + 'tx_epproducts_ajax[month]': selectedMonth.getMonth(), + 'tx_epproducts_ajax[year]': selectedMonth.getYear(), + }) + axios.post(uri, data) + .then(response => ( + this.calendarWrapper.innerHTML = response.data + )) + .finally(() => { + this.loading = false + }) + } +}) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/contact-form.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/contact-form.js new file mode 100644 index 00000000..d1efe892 --- /dev/null +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/contact-form.js @@ -0,0 +1,35 @@ +import axios from 'axios' + +export default () => ({ + formErrors: {}, + processing: false, + success: false, + error: false, + submit() { + this.processing = true + const form = this.$refs.form + const data = new FormData(form) + axios.post(form.action, data) + .then(response => { + if (response.data.status === 'validation') { + this.formErrors = response.data.errors + } else { + this.success = true + } + }) + .catch(e => { + this.error = true + }) + .finally(() => { + this.processing = false + this.$el.scrollIntoView({behavior: 'smooth'}) + }) + }, + reset() { + this.formErrors = {} + this.processing = false + this.success = false + this.error = false + this.$refs.form.reset() + } +}) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/Calendar.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/Calendar.html index 68370f0b..3c7d3bd9 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/Calendar.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/FluidStyledContent/Calendar.html @@ -1,20 +1,29 @@ + xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
- +
")'> +
+

Belegungskalender {hotel.0.data.name}

+
+
+ +
+
+
+ +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/FullForm.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/FullForm.html index c3dcc900..cc134094 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/FullForm.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/FullForm.html @@ -5,104 +5,102 @@ - -
- - - - - - - - - - - - - -
- -
- -
- Ich habe die Datenschutzbestimmungen gelesen und akzeptiert. -
-
- -
-
-
- Processing... -
-
-

Vielen Dank für Eure Anfrage. Wir werden uns schnellstmöglich mit Euch in Verbindung - setzen.

-

-
-
-

Es ist ein Problem aufgetreten. Bitte versucht es noch einmal.

-

-
+
+ + + + + + + + + + + + + +
+
- + +
+ Ich habe die Datenschutzbestimmungen gelesen und akzeptiert. +
+
+ +
+
+
+ Processing... +
+
+

Vielen Dank für Eure Anfrage. Wir werden uns schnellstmöglich mit Euch in Verbindung + setzen.

+

+
+
+

Es ist ein Problem aufgetreten. Bitte versucht es noch einmal.

+

+
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/SimpleForm.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/SimpleForm.html index 2bdd9e32..5818939c 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/SimpleForm.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Form/SimpleForm.html @@ -5,73 +5,71 @@ - -
- - - - - - - - - -
- Ich habe die Datenschutzbestimmungen gelesen und akzeptiert. -
-
- -
-
-
- Processing... -
-
-

Vielen Dank für Eure Anfrage. Wir werden uns schnellstmöglich mit Euch in Verbindung - setzen.

-

-
-
-

Es ist ein Problem aufgetreten. Bitte versucht es noch einmal.

-

-
+
+ + + + + + + + + +
+ Ich habe die Datenschutzbestimmungen gelesen und akzeptiert.
- +
+ +
+
+
+ Processing... +
+
+

Vielen Dank für Eure Anfrage. Wir werden uns schnellstmöglich mit Euch in Verbindung + setzen.

+

+
+
+

Es ist ein Problem aufgetreten. Bitte versucht es noch einmal.

+

+
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Pricetable/Event.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Pricetable/Event.html index 44446966..c465dc37 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Pricetable/Event.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Pricetable/Event.html @@ -7,13 +7,13 @@ - +
+
+
+ Loading +
+
diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 0b1aa18d..785fa400 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -581,24 +581,27 @@ Preisberechnung -
+

Belegungskalender

- +
")'> +
+ +
+
+
+ +
+
diff --git a/webpack.config.js b/webpack.config.js index 785078da..d47e9998 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,11 +9,13 @@ Encore .addEntry('snowzone', './public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/snowzone.js') .addEntry('unichamp', './public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/unichamp.js') .addStyleEntry('rte', './public/typo3conf/ext/ep_theme/Resources/Private/Assets/scss/rte.scss') + .addExternals({ + jquery: 'jQuery', + }) .splitEntryChunks() .enableSingleRuntimeChunk() .enableSassLoader() .enableVueLoader() - .autoProvidejQuery() .enableVersioning() .enableSourceMaps(!Encore.isProduction()) .cleanupOutputBeforeBuild()