From c61815e2f48970be61bb49ee5366c0786a0cf005 Mon Sep 17 00:00:00 2001 From: Massedil Date: Thu, 15 Feb 2024 18:22:39 +0100 Subject: [PATCH] Add a register category with radio buttons --- src/views/Event/EditView.vue | 77 ++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/src/views/Event/EditView.vue b/src/views/Event/EditView.vue index 39283f01e..d04f43b08 100644 --- a/src/views/Event/EditView.vue +++ b/src/views/Event/EditView.vue @@ -241,19 +241,36 @@ {{ t('Page limited to my group (asks for auth)') }} --> + +
+

+ {{ t("How to register") }} +

+ +
+ {{ t("I want to manage the registration on Mobilizon") }} +
+ +
+ {{ + t("I want to manage the registration with an external provider") + }} +
- - {{ - t("I want to manage the registration with an external provider") - }} - - - - @@ -287,27 +307,35 @@ {{ t("I want to approve every participation request") }} - - {{ t("Limited number of places") }} - - {{ t("Hide the number of participants") }} -
+ + {{ + t("Limited number of places") + }} + + +
{ return sortBy(eventCategories.value, ["label"]); }); -const externalParticipation = computed({ +const RegisterOption = { + MOBILIZON: "mobilizon", + EXTERNAL: "external", +}; + +const registerOption = computed({ get() { - return event.value?.joinOptions === EventJoinOptions.EXTERNAL; + return event.value?.joinOptions === EventJoinOptions.EXTERNAL + ? RegisterOption.EXTERNAL + : RegisterOption.MOBILIZON; }, set(newValue) { - if (newValue === true) { + if (newValue === RegisterOption.EXTERNAL) { event.value.joinOptions = EventJoinOptions.EXTERNAL; } else { event.value.joinOptions = EventJoinOptions.FREE;