From 211290985f0c4aeb7ec05f8cf21033d5af10021c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 9 Oct 2019 16:37:39 +0200 Subject: [PATCH 1/8] Make sure featured events have currently happening events Signed-off-by: Thomas Citharel --- lib/mobilizon/events/events.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 41849d9bf..3bae79e1a 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -1433,9 +1433,12 @@ defmodule Mobilizon.Events do from(e in query, where: e.draft == ^is_draft) end + # Currently happening events are also future events @spec filter_future_events(Ecto.Query.t(), boolean) :: Ecto.Query.t() defp filter_future_events(query, true) do - from(q in query, where: q.begins_on > ^DateTime.utc_now()) + from(q in query, + where: q.begins_on > ^DateTime.utc_now() or q.ends_on > ^DateTime.utc_now() + ) end defp filter_future_events(query, false), do: query From 7773f819bd8b6e1f79c6f8dabffd09d28a665d99 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 9 Oct 2019 17:03:35 +0200 Subject: [PATCH 2/8] Fix participants panel icons and improve tabs Close #198 Signed-off-by: Thomas Citharel --- js/src/views/Event/Participants.vue | 105 ++++++++++++++++------------ 1 file changed, 60 insertions(+), 45 deletions(-) diff --git a/js/src/views/Event/Participants.vue b/js/src/views/Event/Participants.vue index df7342a4e..3e72ccc6b 100644 --- a/js/src/views/Event/Participants.vue +++ b/js/src/views/Event/Participants.vue @@ -3,60 +3,66 @@ -
-

{{ $t('Participants') }}

-
-
- -
-
-
+
- + -
-

{{ $t('Waiting list') }}

-
-
- -
-
-
+
- + -
-

{{ $t('Rejected participations') }}

-
-
- -
-
-
+
@@ -231,6 +237,15 @@ export default class Participants extends Vue { + From 36a57cfcf2e3b2f24b6c5cd5e9311af1fbb78481 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 9 Oct 2019 17:18:27 +0200 Subject: [PATCH 3/8] Prevent route changing when editing with changes Close #197 Signed-off-by: Thomas Citharel --- js/src/views/Event/Edit.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/js/src/views/Event/Edit.vue b/js/src/views/Event/Edit.vue index 42c52c77f..cc3dd9c3d 100644 --- a/js/src/views/Event/Edit.vue +++ b/js/src/views/Event/Edit.vue @@ -266,6 +266,9 @@ import { ICurrentUser } from '@/types/current-user.model'; query: TAGS, }, }, + beforeRouteLeave(to, from, next) { + this.confirmGoElsewhere(() => next()); + }, }) export default class EditEvent extends Vue { @Prop({ type: Boolean, default: false }) isUpdate!: boolean; @@ -499,9 +502,9 @@ export default class EditEvent extends Vue { /** * Confirm cancel */ - confirmGoBack() { + confirmGoElsewhere(callback) { if (!this.isEventModified) { - return this.$router.go(-1); + return callback(); } const title: string = this.isUpdate ? this.$t('Cancel edition') as string : @@ -519,10 +522,17 @@ export default class EditEvent extends Vue { cancelText: this.$t('Continue editing') as string, type: 'is-warning', hasIcon: true, - onConfirm: () => this.$router.go(-1), + onConfirm: callback, }); } + /** + * Confirm cancel + */ + confirmGoBack() { + this.confirmGoElsewhere(() => this.$router.go(-1)); + } + get isEventModified(): boolean { return JSON.stringify(this.event.toEditJSON()) !== JSON.stringify(this.unmodifiedEvent); } From 7759f1bef5497864e707057aa2469ee2687a5955 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 9 Oct 2019 17:25:09 +0200 Subject: [PATCH 4/8] Rename Events to MyEvents Close #193 Signed-off-by: Thomas Citharel --- js/src/components/NavBar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue index 6632a990d..6bdafa0e9 100644 --- a/js/src/components/NavBar.vue +++ b/js/src/components/NavBar.vue @@ -5,7 +5,7 @@