Skip to content
Snippets Groups Projects
Commit 044b172d authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

feat: display show creation/modification data

refs #182
parent b75fcc56
No related branches found
No related tags found
No related merge requests found
<template> <template>
<div> <div>
<PageHeader :title="t('navigation.show.basicData')" :lead="show.name" /> <PageHeader
:title="t('navigation.show.basicData')"
:lead="show.name"
:editing-metadata="show"
/>
<UnderConstruction class="tw-top-2 tw-right-2 tw-text-xl"> <UnderConstruction class="tw-top-2 tw-right-2 tw-text-xl">
<template #title> <template #title>
...@@ -24,6 +28,18 @@ ...@@ -24,6 +28,18 @@
<ShowMetaImages /> <ShowMetaImages />
<ShowMetaOwners /> <ShowMetaOwners />
</div> </div>
<hr />
<p class="tw-text-sm">
<ATimeEditInfo
v-if="show.updatedAt"
:edit-info="{ time: show.updatedAt, author: show.updatedBy }"
type="modified"
/>
<br />
<ATimeEditInfo :edit-info="{ time: show.createdAt, author: show.createdBy }" type="created" />
</p>
</div> </div>
</template> </template>
...@@ -40,6 +56,7 @@ import { useI18n } from '@/i18n' ...@@ -40,6 +56,7 @@ import { useI18n } from '@/i18n'
import { Show } from '@/types' import { Show } from '@/types'
import UnderConstruction from '@/components/UnderConstruction.vue' import UnderConstruction from '@/components/UnderConstruction.vue'
import { useBreadcrumbs } from '@/stores/nav' import { useBreadcrumbs } from '@/stores/nav'
import ATimeEditInfo from '@/components/generic/ATimeEditInfo.vue'
const props = defineProps<{ const props = defineProps<{
show: Show show: Show
......
<template> <template>
<div class="tw-max-w-5xl"> <div class="tw-max-w-5xl">
<PageHeader :lead="show.name" :title="t('navigation.show.episodes')" /> <PageHeader :lead="show.name" :title="t('navigation.show.episodes')" :editing-metadata="show" />
<UnderConstruction class="tw-right-0 tw-top-0"> <UnderConstruction class="tw-right-0 tw-top-0">
<template #title> <template #title>
......
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
data-testid="page-header" data-testid="page-header"
> >
<h1 class="tw-text-5xl tw-font-black tw-m-0"> <h1 class="tw-text-5xl tw-font-black tw-m-0">
<ATimeEditInfo
v-if="editingMetadata"
:edit-info="{
time: editingMetadata.updatedAt ?? editingMetadata.createdAt,
author: editingMetadata.updatedBy ?? editingMetadata.createdBy,
}"
:type="editingMetadata.updatedAt ? 'modified' : 'created'"
class="tw-text-xs tw-block tw-mb-2 tw-font-normal"
/>
<SafeHTML <SafeHTML
v-if="lead" v-if="lead"
as="small" as="small"
...@@ -24,9 +34,12 @@ ...@@ -24,9 +34,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import SafeHTML from '@/components/generic/SafeHTML' import SafeHTML from '@/components/generic/SafeHTML'
import { EditingMetaData } from '@/types'
import ATimeEditInfo from '@/components/generic/ATimeEditInfo.vue'
defineProps<{ defineProps<{
title?: string title?: string
lead?: string lead?: string
editingMetadata?: EditingMetaData
}>() }>()
</script> </script>
...@@ -18,6 +18,18 @@ export type PaginationData = { ...@@ -18,6 +18,18 @@ export type PaginationData = {
export type KeysFrom<T, K extends keyof T> = K export type KeysFrom<T, K extends keyof T> = K
export type UpdatedMetadata = {
updatedAt: string | null
updatedBy: string
}
export type CreatedMetadata = {
createdAt: string
createdBy: string
}
export type EditingMetaData = UpdatedMetadata & CreatedMetadata
export type TimeSlot = Required<steeringComponents['schemas']['TimeSlot']> export type TimeSlot = Required<steeringComponents['schemas']['TimeSlot']>
export type Show = Required<steeringComponents['schemas']['Show']> export type Show = Required<steeringComponents['schemas']['Show']>
export type Playlist = Required<tankComponents['schemas']['store.Playlist']> export type Playlist = Required<tankComponents['schemas']['store.Playlist']>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment