Merge branch 'release/2020.04-02'

This commit is contained in:
Björn Fromme committed 2020-04-17 13:53:35 +02:00
commit 63ef368087
6 files changed
+45 -32

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
base: / base: /
baseVariants: baseVariants:
- -
base: 'https://eptypo3.ddev.site' base: 'https://ep-reisen.ddev.site'
condition: 'applicationContext == "Development"' condition: 'applicationContext == "Development"'
- -
base: 'https://schnee-event.ddev.site' base: 'https://schnee-event.ddev.site'
+1 -1
View File
@@ -6,7 +6,7 @@
"license": "WTFPL", "license": "WTFPL",
"repository": "https://gitlab.com/dreipunktnull/ep_theme.git", "repository": "https://gitlab.com/dreipunktnull/ep_theme.git",
"scripts": { "scripts": {
"dev": "./node_modules/.bin/encore dev --watch", "dev": "./node_modules/.bin/encore dev --watch --watch-poll",
"build": "./node_modules/.bin/encore production" "build": "./node_modules/.bin/encore production"
}, },
"dependencies": { "dependencies": {
@@ -6,21 +6,14 @@
<div class="calendar__loading" v-show="loading"> <div class="calendar__loading" v-show="loading">
<img :src="loaderUri" alt="Loading" title="Loading"> <img :src="loaderUri" alt="Loading" title="Loading">
</div> </div>
<div class="calendar__inner" v-cloak v-html="calendarHtml"></div> <div class="col-xs-12">
<div class="calendar__buttons" v-cloak> <select class="form-control calendar__select" v-model="selectedMonth" @change="loadCalendar">
<div class="col-xs-6"> <option v-for="option in selectableMonths" :value="option" :key="option.format('YYYY')+option.format('M')">
<a v-show="showPrev" @click.prevent="prev()" href="#" {{ option.format('MMMM YYYY') }}
class="calendar__browse calendar__browse--prev btn btn-warning"> </option>
<i class="fa fa-chevron-left"></i> früher </select>
</a>
</div>
<div class="col-xs-6 text-right">
<a @click.prevent="next()" href="#"
class="calendar__browse calendar__browse--next btn btn-warning">
später <i class="fa fa-chevron-right"></i>
</a>
</div>
</div> </div>
<div class="calendar__inner" v-cloak v-html="calendarHtml"></div>
</div> </div>
</template> </template>
<script> <script>
@@ -28,6 +21,7 @@
import axios from 'axios' import axios from 'axios'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import 'dayjs/locale/de' import 'dayjs/locale/de'
dayjs.locale('de');
export default { export default {
props: { props: {
@@ -65,8 +59,8 @@
}, },
data () { data () {
return { return {
showPrev: false,
startDate: dayjs().startOf('month'), startDate: dayjs().startOf('month'),
selectedMonth: dayjs().startOf('month'),
calendarHtml: '', calendarHtml: '',
loading: false loading: false
} }
@@ -74,40 +68,47 @@
computed: { computed: {
isSingleCalendar () { isSingleCalendar () {
return parseInt(this.months) === 1; return parseInt(this.months) === 1;
},
selectableMonths() {
const months = [];
let month = this.startDate.month();
let year = this.startDate.year();
for (let i = 1; i <= 12; i++) {
months.push(dayjs().set('year', year).set('month', month));
if (month < 12) {
month++;
} else {
month = 1;
year++;
}
}
return months;
} }
}, },
methods: { methods: {
loadCalendar () { loadCalendar () {
let query = {}; let query = {};
query[this.argumentPrefix + '[hotel]'] = this.hotelUid; query[this.argumentPrefix + '[hotel]'] = this.hotelUid;
query[this.argumentPrefix + '[month]'] = this.startDate.month() + 1; query[this.argumentPrefix + '[month]'] = this.selectedMonth.month() + 1;
query[this.argumentPrefix + '[year]'] = this.startDate.year(); query[this.argumentPrefix + '[year]'] = this.selectedMonth.year();
query[this.argumentPrefix + '[months]'] = this.months; query[this.argumentPrefix + '[months]'] = this.months;
this.loading = true; this.loading = true;
this.showPrev = this.startDate.isAfter(dayjs());
axios({ axios({
url: this.uri, url: this.uri,
responseType: 'text', responseType: 'text',
params: query params: query
}).then((response) => { }).then((response) => {
this.calendarHtml = response.data; this.calendarHtml = response.data;
this.loading = false;
}).catch(() => { }).catch(() => {
}).finally(() => {
this.loading = false; this.loading = false;
}); });
},
next () {
this.startDate = this.startDate.add(this.step, 'month');
this.loadCalendar();
},
prev () {
this.startDate = this.startDate.subtract(this.step, 'month');
this.loadCalendar();
} }
}, },
mounted () { mounted () {
Vue.nextTick(() => { Vue.nextTick(() => {
this.loadCalendar(); this.loadCalendar();
this.selectedMonth = this.selectableMonths[0];
}); });
} }
} }
@@ -16,6 +16,14 @@
} }
} }
.calendar__select {
margin-bottom: 20px;
outline: none;
&:focus {
outline: none;
}
}
.calendar__loading { .calendar__loading {
position: absolute; position: absolute;
@include size(100%); @include size(100%);
@@ -33,7 +41,11 @@
} }
.calendar__days { .calendar__days {
min-height: 275px;
table {
margin-bottom: 0;
}
} }
.label-success-danger { .label-success-danger {
@@ -18,7 +18,6 @@
<f:for each="{year}" as="month"> <f:for each="{year}" as="month">
<ep:calendar.includes range="{range}" period="{month}"> <ep:calendar.includes range="{range}" period="{month}">
<div class="calendar__month col-xs-12{f:if(condition: '{months} > 1', then: ' col-md-6 col-lg-4')}"> <div class="calendar__month col-xs-12{f:if(condition: '{months} > 1', then: ' col-md-6 col-lg-4')}">
<h3 class="calendar__month{f:if(condition: '{months} == 1', then: ' calendar__month--single')}">{month.begin -> f:format.date(format: '%B')} {month.begin -> f:format.date(format: '%Y')}</h3>
<div class="calendar__days"> <div class="calendar__days">
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
+2 -1
View File
@@ -60,7 +60,8 @@ Encore
babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ] babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ]
}) })
.configureWatchOptions(function (options) { .configureWatchOptions(function (options) {
options.poll = 250; options.poll = 500;
options.ignored = /node_modules/;
}); });
const EpEventsConfig = Encore.getWebpackConfig(); const EpEventsConfig = Encore.getWebpackConfig();