diff --git a/components/calendar/PreviewCard.vue b/components/calendar/PreviewCard.vue new file mode 100644 index 0000000..fd16774 --- /dev/null +++ b/components/calendar/PreviewCard.vue @@ -0,0 +1,37 @@ + + + + + + {{ calendar.name }} + + + + + + {{ $t("entity.calendar.hasXEvents", { count: calendar.eventNb?.[0].count }) }} + + + + + + + + diff --git a/components/global/AddCard.vue b/components/global/AddCard.vue index d2d8955..7b716c0 100644 --- a/components/global/AddCard.vue +++ b/components/global/AddCard.vue @@ -6,7 +6,7 @@ const emit = defineEmits(["on-click"]) diff --git a/components/ui/alert-dialog/AlertDialogContent.vue b/components/ui/alert-dialog/AlertDialogContent.vue index 2695e23..776974c 100644 --- a/components/ui/alert-dialog/AlertDialogContent.vue +++ b/components/ui/alert-dialog/AlertDialogContent.vue @@ -31,7 +31,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits) v-bind="forwarded" :class=" cn( - 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-3xl -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', + 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-3xl -translate-x-1/2 -translate-y-1/2 gap-4 border border-indigo-200 bg-background dark:bg-slate-950 dark:border-indigo-950 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', props.class, ) " diff --git a/components/ui/dialog/DialogContent.vue b/components/ui/dialog/DialogContent.vue index 8792702..1501281 100644 --- a/components/ui/dialog/DialogContent.vue +++ b/components/ui/dialog/DialogContent.vue @@ -33,7 +33,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits) v-bind="forwarded" :class=" cn( - 'fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-4xl -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', + 'fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-4xl -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background border-indigo-200 dark:bg-slate-950 dark:border-indigo-950 p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg', props.class ) " diff --git a/components/ui/select/SelectTrigger.vue b/components/ui/select/SelectTrigger.vue index 90c8e61..3bd70da 100644 --- a/components/ui/select/SelectTrigger.vue +++ b/components/ui/select/SelectTrigger.vue @@ -20,7 +20,7 @@ const forwardedProps = useForwardProps(delegatedProps) v-bind="forwardedProps" :class=" cn( - 'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', + 'flex h-10 w-full items-center justify-between rounded-md border border-input bg-background dark:bg-slate-950 contrast-more:dark:bg-slate-900 px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', props.class ) " diff --git a/components/world/PreviewCard.vue b/components/world/PreviewCard.vue new file mode 100644 index 0000000..da860b2 --- /dev/null +++ b/components/world/PreviewCard.vue @@ -0,0 +1,73 @@ + + + + + + {{ world.name }} + + + {{ world.description }} + + + + + + + + + + + + + + + + {{ $t('common.createdAt', { createdAt }) }} + + + + {{ $t('common.updatedAt', { updatedAt }) }} + + + + + diff --git a/i18n.config.ts b/i18n.config.ts index 51e6b2e..e736aea 100644 --- a/i18n.config.ts +++ b/i18n.config.ts @@ -56,7 +56,9 @@ export default defineI18nConfig(() => ({ displayMode: "Display mode" }, common: { - title: "Title" + title: "Title", + createdAt: "Created {createdAt}", + updatedAt: "Last updated {updatedAt}", }, entity: { category: { @@ -81,6 +83,7 @@ export default defineI18nConfig(() => ({ nameSingular: "World", namePlural: "Worlds", addSingle: "Add a world", + addSingleFirst: "Add your first world !", editSingle: "Edit world", notFound: "World not found", notFoundDescription: "The link is not valid or the world has been deleted / archived.", @@ -110,12 +113,13 @@ export default defineI18nConfig(() => ({ namePublicSingular: "Public Calendar", namePublicPlural: "Public Calendars", addSingle: "Add a calendar", + addSingleFirst: "Add your first calendar !", notFound: "Calendar not found", notFoundDescription: "The link is not valid or the calendar has been deleted / archived.", notFoundForWorld: "No calendar for this world… yet !", backToList: "Go back to calendars", isLoading: "Calendar is loading…", - hasXEvents: "This calendar has {count} public events", + hasXEvents: "{count} available events", date: { start: "Start date", end: "End date", @@ -307,7 +311,9 @@ export default defineI18nConfig(() => ({ displayMode: "Mode d'affichage", }, common: { - title: "Titre" + title: "Titre", + createdAt: "Créé le {createdAt}", + updatedAt: "Dernière modification le {updatedAt}", }, entity: { category: { @@ -332,6 +338,7 @@ export default defineI18nConfig(() => ({ nameSingular: "Monde", namePlural: "Mondes", addSingle: "Ajouter un monde", + addSingleFirst: "Ajouter votre premier monde !", editSingle: "Modifier le monde", notFound: "Aucun monde trouvé", notFoundDescription: "Le lien n'est pas valide ou le monde a été supprimé / archivé.", @@ -356,17 +363,18 @@ export default defineI18nConfig(() => ({ }, }, calendar: { - nameSingular: "Calendriers", - namePlural: "Calendrier", + nameSingular: "Calendrier", + namePlural: "Calendriers", namePublicSingular: "Calendrier Public", namePublicPlural: "Calendriers Publics", addSingle: "Ajouter un calendrier", + addSingleFirst: "Ajouter votre premier calendrier !", notFound: "Aucun calendrier trouvé", notFoundDescription: "Le lien n'est pas valide ou le calendrier a été supprimé / archivé.", notFoundForWorld: "Aucun calendrier pour ce monde… pour l'instant !", backToList: "Retourner aux calendriers", isLoading: "Chargement du calendrier…", - hasXEvents: "Ce calendrier contient {count} évènements publiques", + hasXEvents: "{count} évènements disponibles", date: { start: "Date de début", end: "Date de fin", diff --git a/models/World.ts b/models/World.ts index d57b624..613981b 100644 --- a/models/World.ts +++ b/models/World.ts @@ -8,10 +8,12 @@ export interface World { id?: number name: string description?: string - color?: RPGColor, - calendars?: Calendar[], + color?: RPGColor + calendars?: Calendar[] gmId?: string state?: WorldState + createdAt?: string + updatedAt?: string } export const postWorldSchema = z.object({ diff --git a/package.json b/package.json index b79cb9f..c8093c3 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^0.475.0", + "luxon": "^3.5.0", "nuxt": "^3.15.4", "pinia": "^3.0.1", "radix-vue": "^1.9.16", @@ -40,6 +41,7 @@ "@nuxtjs/supabase": "^1.4.6", "@nuxtjs/tailwindcss": "^6.13.1", "@stylistic/eslint-plugin-js": "^3.1.0", + "@types/luxon": "^3.4.2", "@typescript-eslint/eslint-plugin": "^8.25.0", "@typescript-eslint/parser": "^8.25.0", "eslint": "^9.21.0", diff --git a/pages/explore.vue b/pages/explore.vue index f298e4c..efe4759 100644 --- a/pages/explore.vue +++ b/pages/explore.vue @@ -1,4 +1,5 @@
+ + {{ $t("entity.calendar.hasXEvents", { count: calendar.eventNb?.[0].count }) }} +
{{ world.description }}