all developments of milestone 1

This commit is contained in:
setop
2024-04-10 12:36:21 +00:00
parent a78dc261e5
commit 7030d56864
266 changed files with 5391 additions and 2609 deletions

View File

@@ -24,7 +24,7 @@
import RouteName from "@/router/name";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
import EventConversations from "../../components/Conversations/EventConversations.vue";
import NewPrivateMessage from "../../components/Participation/NewPrivateMessage.vue";
import { useFetchEvent } from "@/composition/apollo/event";

View File

@@ -0,0 +1,21 @@
<template>
<div class="container mx-auto px-1 mb-6">
<h1 v-if="!isMobile">
{{ t("Calendar") }}
</h1>
<div class="p-2">
<EventsCalendar v-if="!isMobile" />
<EventsAgenda v-else />
</div>
</div>
</template>
<script lang="ts" setup>
import { useI18n } from "vue-i18n";
import EventsAgenda from "@/components/FullCalendar/EventsAgenda.vue";
import EventsCalendar from "@/components/FullCalendar/EventsCalendar.vue";
const { t } = useI18n({ useScope: "global" });
const isMobile = window.innerWidth < 760;
</script>

View File

@@ -241,19 +241,36 @@
{{ t('Page limited to my group (asks for auth)') }}
</o-radio>
</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
:label="t('External registration')"
v-if="features?.eventExternal"
v-if="registerOption === RegisterOption.EXTERNAL"
: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
icon="link"
type="url"
@@ -264,7 +281,10 @@
</o-field>
<o-field
v-if="anonymousParticipationConfig?.allowed && !externalParticipation"
v-if="
anonymousParticipationConfig?.allowed &&
registerOption === RegisterOption.MOBILIZON
"
:label="t('Anonymous participations')"
>
<o-switch v-model="eventOptions.anonymousParticipation">
@@ -287,20 +307,35 @@
<o-field
:label="t('Participation approval')"
v-show="!externalParticipation"
v-show="registerOption === RegisterOption.MOBILIZON"
>
<o-switch v-model="needsApproval">{{
t("I want to approve every participation request")
}}</o-switch>
</o-field>
<o-field :label="t('Number of places')" v-show="!externalParticipation">
<o-field
:label="t('Showing participants')"
v-show="registerOption === RegisterOption.MOBILIZON"
>
<o-switch v-model="hideParticipants">{{
t("Hide the number of participants")
}}</o-switch>
</o-field>
<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 && !externalParticipation">
<div
class=""
v-if="limitedPlaces && registerOption === RegisterOption.MOBILIZON"
>
<o-field :label="t('Number of places')" label-for="number-of-places">
<o-input
type="number"
@@ -635,7 +670,7 @@ import {
import { useMutation } from "@vue/apollo-composable";
import { Dialog } from "@/plugins/dialog";
import { Notifier } from "@/plugins/notifier";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
import { useOruga } from "@oruga-ui/oruga-next";
import type { Locale } from "date-fns";
import sortBy from "lodash/sortBy";
@@ -1091,6 +1126,15 @@ const needsApproval = computed({
},
});
const hideParticipants = computed({
get(): boolean {
return event.value?.options.hideNumberOfParticipants;
},
set(value: boolean) {
event.value.options.hideNumberOfParticipants = value;
},
});
const checkTitleLength = computed((): Array<string | undefined> => {
return event.value.title.length > 80
? ["info", t("The event title will be ellipsed.")]
@@ -1359,12 +1403,19 @@ const orderedCategories = computed(() => {
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;

View File

@@ -18,6 +18,16 @@
/>
</div>
<div
class="start-time-icon-wrapper relative"
v-if="event?.beginsOn && event?.options.showStartTime"
>
<start-time-icon
:date="event.beginsOn.toString()"
class="absolute right-3 -top-16"
/>
</div>
<section class="intro px-2 pt-4" dir="auto">
<div class="flex flex-wrap gap-2 justify-end">
<div class="flex-1 min-w-[300px]">
@@ -289,6 +299,7 @@ import {
usernameWithDomain,
} from "@/types/actor";
import DateCalendarIcon from "@/components/Event/DateCalendarIcon.vue";
import StartTimeIcon from "@/components/Event/StartTimeIcon.vue";
import SkeletonDateCalendarIcon from "@/components/Event/SkeletonDateCalendarIcon.vue";
import Earth from "vue-material-design-icons/Earth.vue";
import Link from "vue-material-design-icons/Link.vue";
@@ -326,7 +337,7 @@ import {
import { useI18n } from "vue-i18n";
import { Notifier } from "@/plugins/notifier";
import { AbsintheGraphQLErrors } from "@/types/errors.model";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
const IntegrationTwitch = defineAsyncComponent(
() => import("@/components/Event/Integrations/TwitchIntegration.vue")

View File

@@ -116,7 +116,7 @@ import {
useRouteQuery,
} from "vue-use-route-query";
import { MemberRole } from "@/types/enums";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
import { useI18n } from "vue-i18n";
const EVENTS_PAGE_LIMIT = 10;

View File

@@ -151,7 +151,6 @@
true // !$apollo.loading
"
>
<div class="img-container h-64 prose" />
<div class="text-center prose dark:prose-invert max-w-full">
<p>
{{
@@ -237,7 +236,7 @@ import {
import { Locale } from "date-fns";
import { useI18n } from "vue-i18n";
import { useRestrictions } from "@/composition/apollo/config";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
const EventParticipationCard = defineAsyncComponent(
() => import("@/components/Event/EventParticipationCard.vue")
@@ -500,24 +499,3 @@ useHead({
title: computed(() => t("My events")),
});
</script>
<style lang="scss">
.not-found {
.img-container {
background-image: url("../../../img/pics/event_creation-480w.webp");
@media (min-resolution: 2dppx) {
& {
background-image: url("../../../img/pics/event_creation-1024w.webp");
}
}
max-width: 450px;
height: 300px;
box-shadow: 0 0 8px 8px white inset;
background-size: cover;
border-radius: 10px;
margin: auto auto 1rem;
}
}
</style>

View File

@@ -284,7 +284,7 @@ import Incognito from "vue-material-design-icons/Incognito.vue";
import EmptyContent from "@/components/Utils/EmptyContent.vue";
import { Notifier } from "@/plugins/notifier";
import Tag from "@/components/TagElement.vue";
import { useHead } from "@unhead/vue";
import { useHead } from "@/utils/head";
const PARTICIPANTS_PER_PAGE = 10;
const MESSAGE_ELLIPSIS_LENGTH = 130;