Add a register category with radio buttons
This commit is contained in:
parent
94b96b56cf
commit
c61815e2f4
|
@ -241,19 +241,36 @@
|
||||||
{{ t('Page limited to my group (asks for auth)') }}
|
{{ t('Page limited to my group (asks for auth)') }}
|
||||||
</o-radio>
|
</o-radio>
|
||||||
</div>-->
|
</div>-->
|
||||||
|
</section>
|
||||||
|
<section class="my-4">
|
||||||
|
<h2>
|
||||||
|
{{ t("How to register") }}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<o-radio
|
||||||
|
v-model="registerOption"
|
||||||
|
name="registerOption"
|
||||||
|
:native-value="RegisterOption.MOBILIZON"
|
||||||
|
>{{ t("I want to manage the registration on Mobilizon") }}</o-radio
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<o-radio
|
||||||
|
v-model="registerOption"
|
||||||
|
name="registerOption"
|
||||||
|
:native-value="RegisterOption.EXTERNAL"
|
||||||
|
>{{
|
||||||
|
t("I want to manage the registration with an external provider")
|
||||||
|
}}</o-radio
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
<o-field
|
<o-field
|
||||||
:label="t('External registration')"
|
v-if="registerOption === RegisterOption.EXTERNAL"
|
||||||
v-if="features?.eventExternal"
|
:label="t('URL')"
|
||||||
>
|
>
|
||||||
<o-switch v-model="externalParticipation">
|
|
||||||
{{
|
|
||||||
t("I want to manage the registration with an external provider")
|
|
||||||
}}
|
|
||||||
</o-switch>
|
|
||||||
</o-field>
|
|
||||||
|
|
||||||
<o-field v-if="externalParticipation" :label="t('URL')">
|
|
||||||
<o-input
|
<o-input
|
||||||
icon="link"
|
icon="link"
|
||||||
type="url"
|
type="url"
|
||||||
|
@ -264,7 +281,10 @@
|
||||||
</o-field>
|
</o-field>
|
||||||
|
|
||||||
<o-field
|
<o-field
|
||||||
v-if="anonymousParticipationConfig?.allowed && !externalParticipation"
|
v-if="
|
||||||
|
anonymousParticipationConfig?.allowed &&
|
||||||
|
registerOption === RegisterOption.MOBILIZON
|
||||||
|
"
|
||||||
:label="t('Anonymous participations')"
|
:label="t('Anonymous participations')"
|
||||||
>
|
>
|
||||||
<o-switch v-model="eventOptions.anonymousParticipation">
|
<o-switch v-model="eventOptions.anonymousParticipation">
|
||||||
|
@ -287,27 +307,35 @@
|
||||||
|
|
||||||
<o-field
|
<o-field
|
||||||
:label="t('Participation approval')"
|
:label="t('Participation approval')"
|
||||||
v-show="!externalParticipation"
|
v-show="registerOption === RegisterOption.MOBILIZON"
|
||||||
>
|
>
|
||||||
<o-switch v-model="needsApproval">{{
|
<o-switch v-model="needsApproval">{{
|
||||||
t("I want to approve every participation request")
|
t("I want to approve every participation request")
|
||||||
}}</o-switch>
|
}}</o-switch>
|
||||||
</o-field>
|
</o-field>
|
||||||
|
|
||||||
<o-field :label="t('Number of places')" v-show="!externalParticipation">
|
|
||||||
<o-switch>{{ t("Limited number of places") }}</o-switch>
|
|
||||||
</o-field>
|
|
||||||
|
|
||||||
<o-field
|
<o-field
|
||||||
:label="t('Showing participants')"
|
:label="t('Showing participants')"
|
||||||
v-show="!externalParticipation"
|
v-show="registerOption === RegisterOption.MOBILIZON"
|
||||||
>
|
>
|
||||||
<o-switch v-model="hideParticipants">{{
|
<o-switch v-model="hideParticipants">{{
|
||||||
t("Hide the number of participants")
|
t("Hide the number of participants")
|
||||||
}}</o-switch>
|
}}</o-switch>
|
||||||
</o-field>
|
</o-field>
|
||||||
|
|
||||||
<div class="" v-if="limitedPlaces && !externalParticipation">
|
<o-field
|
||||||
|
:label="t('Number of places')"
|
||||||
|
v-show="registerOption === RegisterOption.MOBILIZON"
|
||||||
|
>
|
||||||
|
<o-switch v-model="limitedPlaces">{{
|
||||||
|
t("Limited number of places")
|
||||||
|
}}</o-switch>
|
||||||
|
</o-field>
|
||||||
|
|
||||||
|
<div
|
||||||
|
class=""
|
||||||
|
v-if="limitedPlaces && registerOption === RegisterOption.MOBILIZON"
|
||||||
|
>
|
||||||
<o-field :label="t('Number of places')" label-for="number-of-places">
|
<o-field :label="t('Number of places')" label-for="number-of-places">
|
||||||
<o-input
|
<o-input
|
||||||
type="number"
|
type="number"
|
||||||
|
@ -1375,12 +1403,19 @@ const orderedCategories = computed(() => {
|
||||||
return sortBy(eventCategories.value, ["label"]);
|
return sortBy(eventCategories.value, ["label"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const externalParticipation = computed({
|
const RegisterOption = {
|
||||||
|
MOBILIZON: "mobilizon",
|
||||||
|
EXTERNAL: "external",
|
||||||
|
};
|
||||||
|
|
||||||
|
const registerOption = computed({
|
||||||
get() {
|
get() {
|
||||||
return event.value?.joinOptions === EventJoinOptions.EXTERNAL;
|
return event.value?.joinOptions === EventJoinOptions.EXTERNAL
|
||||||
|
? RegisterOption.EXTERNAL
|
||||||
|
: RegisterOption.MOBILIZON;
|
||||||
},
|
},
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
if (newValue === true) {
|
if (newValue === RegisterOption.EXTERNAL) {
|
||||||
event.value.joinOptions = EventJoinOptions.EXTERNAL;
|
event.value.joinOptions = EventJoinOptions.EXTERNAL;
|
||||||
} else {
|
} else {
|
||||||
event.value.joinOptions = EventJoinOptions.FREE;
|
event.value.joinOptions = EventJoinOptions.FREE;
|
||||||
|
|
Loading…
Reference in New Issue