|
|
@@ -1,16 +1,20 @@
|
|
|
<template>
|
|
|
- <v-container fluid>
|
|
|
+ <v-container fluid class="inner-container">
|
|
|
<v-row>
|
|
|
<!-- Bloc événements -->
|
|
|
- <v-col cols="12" md="8">
|
|
|
+ <v-col cols="12" md="7">
|
|
|
<v-card>
|
|
|
- <v-tabs v-model="tab">
|
|
|
- <v-tab value="future">Mes événements à venir</v-tab>
|
|
|
- <v-tab value="past">Mes événements passés</v-tab>
|
|
|
+ <v-tabs v-model="tab" class="tabs-title">
|
|
|
+ <v-tab value="future">{{$t('futur_event')}}</v-tab>
|
|
|
+ <v-tab value="past">{{$t('past_event')}}</v-tab>
|
|
|
</v-tabs>
|
|
|
|
|
|
+ <v-btn color="primary" to="events/new" class="ml-5 mt-5">{{$t('add_event')}}</v-btn>
|
|
|
+
|
|
|
<v-tabs-window v-model="tab">
|
|
|
<v-tabs-window-item value="future">
|
|
|
+ <UiLoadingPanel v-if="statusUpcomingEvents == FETCHING_STATUS.PENDING" />
|
|
|
+
|
|
|
<UiEventList
|
|
|
v-if="statusUpcomingEvents == FETCHING_STATUS.SUCCESS && upcomingEvents?.items"
|
|
|
:events="upcomingEvents.items"
|
|
|
@@ -18,8 +22,13 @@
|
|
|
@load="loadUpcomingEvents"
|
|
|
@edit="editEvent"
|
|
|
/>
|
|
|
+ <span v-if="upcomingEvents.items.length == 0" class="no_event">
|
|
|
+ {{$t('no_future_event')}}
|
|
|
+ </span>
|
|
|
</v-tabs-window-item>
|
|
|
<v-tabs-window-item value="past">
|
|
|
+ <UiLoadingPanel v-if="statusPastEvents == FETCHING_STATUS.PENDING" />
|
|
|
+
|
|
|
<UiEventList
|
|
|
v-if="statusPastEvents == FETCHING_STATUS.SUCCESS && pastEvents?.items"
|
|
|
:events="pastEvents.items"
|
|
|
@@ -27,30 +36,46 @@
|
|
|
@load="loadPastEvents"
|
|
|
@edit="editEvent"
|
|
|
/>
|
|
|
+ <span v-if="pastEvents.items.length == 0" class="no_event">
|
|
|
+ {{$t('no_past_event')}}
|
|
|
+ </span>
|
|
|
</v-tabs-window-item>
|
|
|
</v-tabs-window>
|
|
|
|
|
|
- <v-card-actions>
|
|
|
- <v-btn color="primary" to="events/new">Ajouter un événement</v-btn>
|
|
|
- </v-card-actions>
|
|
|
</v-card>
|
|
|
</v-col>
|
|
|
|
|
|
<!-- Bloc structure -->
|
|
|
- <v-col cols="12" md="4">
|
|
|
- <v-card v-if="statusOrganization == FETCHING_STATUS.SUCCESS">
|
|
|
- <v-card-title>Structure</v-card-title>
|
|
|
+ <v-col cols="12" md="5">
|
|
|
+ <v-card v-if="statusOrganization == FETCHING_STATUS.SUCCESS" class="pa-5">
|
|
|
+ <v-card-title class="text-h6" >
|
|
|
+ <v-icon icon="fa fa-hotel" class="text-button icon-hotel" />
|
|
|
+ <span class="organization_title">{{$t('my_organization')}}</span>
|
|
|
+ </v-card-title>
|
|
|
<v-card-text>
|
|
|
- <div><strong>Nom:</strong> {{ organization?.name }}</div>
|
|
|
- <div><strong>Email:</strong> {{ organization?.email }}</div>
|
|
|
+ <div><strong>{{$t('name')}} :</strong> {{ organization?.name }}</div>
|
|
|
+ <div><strong>{{$t('email')}} :</strong> {{ organization?.email }}</div>
|
|
|
</v-card-text>
|
|
|
- <v-card-actions>
|
|
|
- <v-btn color="secondary" to="organization">Modifier la structure</v-btn>
|
|
|
- </v-card-actions>
|
|
|
</v-card>
|
|
|
+
|
|
|
+ <v-btn block class="mb-2 btn btn_edit_orga" to="organization">
|
|
|
+ <i class="fa fa-pen mr-2" />{{$t('edit_organization')}}
|
|
|
+ </v-btn>
|
|
|
+
|
|
|
+ <v-btn block class="text-black btn btn_trial" @click="startTrial">
|
|
|
+ <span><v-icon icon="fa fa-ticket" /> {{$t('try_premium_light')}}<br /> {{$t('30_days_free')}}</span>
|
|
|
+ </v-btn>
|
|
|
+
|
|
|
</v-col>
|
|
|
</v-row>
|
|
|
+
|
|
|
</v-container>
|
|
|
+
|
|
|
+ <LayoutDialogTrialAlreadyDid
|
|
|
+ :show="showDialogTrialAllReadyDid"
|
|
|
+ @close-dialog="showDialogTrialAllReadyDid = false"
|
|
|
+ />
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -61,7 +86,7 @@ definePageMeta({
|
|
|
name: 'freemium_dashboard_page',
|
|
|
})
|
|
|
|
|
|
-import { ref } from 'vue'
|
|
|
+import {type Ref, ref} from 'vue'
|
|
|
import {useEntityFetch} from "~/composables/data/useEntityFetch";
|
|
|
import Organization from "~/models/Freemium/Organization";
|
|
|
import Event from "~/models/Freemium/Event";
|
|
|
@@ -73,12 +98,16 @@ import TimeFilter from "~/services/data/Filters/TimeFilter";
|
|
|
import Country from "~/models/Core/Country";
|
|
|
import DateUtils from "~/services/utils/dateUtils";
|
|
|
import UrlUtils from "~/services/utils/urlUtils";
|
|
|
+import {useApiLegacyRequestService} from "~/composables/data/useApiLegacyRequestService";
|
|
|
|
|
|
//Ref Définition
|
|
|
-const tab = ref(null)
|
|
|
+const runtimeConfig = useRuntimeConfig()
|
|
|
const { fetch, fetchCollection } = useEntityFetch()
|
|
|
+const { apiRequestService } = useApiLegacyRequestService()
|
|
|
+const tab = ref(null)
|
|
|
const upcomingPage = ref(1)
|
|
|
const pastPage = ref(1)
|
|
|
+const showDialogTrialAllReadyDid: Ref<boolean> = ref(false)
|
|
|
|
|
|
//Fetch
|
|
|
const { data: organization, status:statusOrganization } = fetch(Organization)
|
|
|
@@ -127,6 +156,24 @@ function fetchEvents(past:boolean = false){
|
|
|
return fetchCollection(Event, null, query)
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Action lorsque l'on souhaite démarrer l'essai
|
|
|
+ */
|
|
|
+async function startTrial() {
|
|
|
+ try {
|
|
|
+ await apiRequestService.get('/trial/is_available')
|
|
|
+ const v1BaseURL =
|
|
|
+ runtimeConfig.baseUrlAdminLegacy ||
|
|
|
+ runtimeConfig.public.baseUrlAdminLegacy
|
|
|
+ await navigateTo(UrlUtils.join(v1BaseURL, '#', 'trial'), {
|
|
|
+ external: true,
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ showDialogTrialAllReadyDid.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Nettoyage du store
|
|
|
*/
|
|
|
@@ -139,7 +186,68 @@ onUnmounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
+
|
|
|
+.tabs-title{
|
|
|
+ margin-top: 20px;
|
|
|
+ padding-left: 20px;
|
|
|
+ background-color: rgb(var(--v-theme-neutral));
|
|
|
+ .v-tab--selected{
|
|
|
+ color: rgb(var(--v-theme-on-neutral--clickable));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
.v-card {
|
|
|
margin-bottom: 16px;
|
|
|
+ color: rgb(var(--v-theme-on-primary-alt));
|
|
|
+}
|
|
|
+
|
|
|
+.v-card-text{
|
|
|
+ div{
|
|
|
+ line-height: 2;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.organization_title{
|
|
|
+ font-weight: 500;
|
|
|
+}
|
|
|
+
|
|
|
+.icon-hotel{
|
|
|
+ margin: 0 5px 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.btn {
|
|
|
+ border: 1px solid;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.inner-container {
|
|
|
+ margin: 0 auto;
|
|
|
+ padding: 30px;
|
|
|
+}
|
|
|
+.btn_trial {
|
|
|
+ height: 55px;
|
|
|
+ background-color: rgb(var(--v-theme-x-create-btn));
|
|
|
+ color: #000;
|
|
|
+
|
|
|
+ span {
|
|
|
+ text-align: center;
|
|
|
+ line-height: 1.2; /* optionnel : pour resserrer ou espacer */
|
|
|
+ }
|
|
|
+ .v-icon {
|
|
|
+ transform: rotate(135deg); /* angle en degrés */
|
|
|
+ font-size: 16px;
|
|
|
+ padding-right: 5px;
|
|
|
+ margin: 0 5px 4px 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.btn_edit_orga{
|
|
|
+ color: rgb(var(--v-theme-on-primary-alt)) !important;
|
|
|
+}
|
|
|
+
|
|
|
+.no_event{
|
|
|
+ padding: 25px;
|
|
|
+ font-size: 16px;
|
|
|
}
|
|
|
</style>
|