From 30927504f5c3a2b0e42703e73a69961f95978e37 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Mon, 18 Apr 2022 17:14:57 +0200 Subject: [PATCH] update calendar --- assets/js/components/Calendar.vue | 41 ++++++++++++++++++++++++++----- assets/js/components/Week.vue | 19 +++++++------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/assets/js/components/Calendar.vue b/assets/js/components/Calendar.vue index 1225ed1..1fca272 100644 --- a/assets/js/components/Calendar.vue +++ b/assets/js/components/Calendar.vue @@ -11,12 +11,12 @@
@@ -26,7 +26,7 @@
@@ -34,18 +34,22 @@
+ +
+
+
- - +
+
@@ -80,6 +84,8 @@ export default { }, data () { return { + loading: true, + message: null, projects: [], speakers: [], month: new Date().getMonth() + 1, @@ -107,6 +113,28 @@ export default { methods: { refresh () { const that = this + this.loading = true + this.message = null + + if (!this.month) { + this.message = 'Il faut sélectionner le mois.' + return + } + + if (!this.year) { + this.message = 'Il faut sélectionner l\'année.' + return + } + + if (!this.selectedProjects.length) { + this.message = 'Il faut sélectionner au moins un projet.' + return + } + + if (!this.selectedSpeakers.length) { + this.message = 'Il faut sélectionner au moins un⋅e intervenant⋅e.' + return + } axios.get(Routing.generate('admin_calendar_month', { month: this.month, @@ -116,6 +144,7 @@ export default { })) .then((response) => { that.weeks = chunk(response.data, 7) + that.loading = false }) } }, diff --git a/assets/js/components/Week.vue b/assets/js/components/Week.vue index f93f92d..49a7c6d 100644 --- a/assets/js/components/Week.vue +++ b/assets/js/components/Week.vue @@ -2,8 +2,7 @@ - - {{ item.day }} + @@ -14,9 +13,10 @@ - [{{ event.startAt }}] + [] - {{ event.summary }} + + @@ -24,11 +24,11 @@ @@ -70,13 +70,12 @@ export default { } }, methods: { + getGlobalKey () { + return ++this.globalKey + }, route (route, params) { return Routing.generate(route, params) } - }, - data () { - return { - } } }