feat [front]: admin list registered movies
This commit is contained in:
parent
c9fe7ec747
commit
f648a0b19d
2 changed files with 33 additions and 3 deletions
|
@ -25,3 +25,10 @@ export type Film = {
|
||||||
bannerLink?: string
|
bannerLink?: string
|
||||||
isConfirmed?: boolean
|
isConfirmed?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ShortFilm = {
|
||||||
|
id: number
|
||||||
|
projectionDate: Date
|
||||||
|
title: string
|
||||||
|
director?: string
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,28 @@
|
||||||
<template></template>
|
<template>
|
||||||
|
<h1 class="title">Liste des séances</h1>
|
||||||
|
<ul class="list has-visible-pointer-controls">
|
||||||
|
<li v-for="film of films" :key="film.id" class="list-item">
|
||||||
|
<nuxt-link :to="`${film.id}`" class="list-item-content">
|
||||||
|
{{ film.projectionDate || "À planifier" }} - {{ film.title }}
|
||||||
|
<template v-if="film.director"> de {{ film.director }}</template>
|
||||||
|
</nuxt-link>
|
||||||
|
<div class="list-item-controls">
|
||||||
|
<nuxt-link :to="`${film.id}/edition`" class="button">
|
||||||
|
<span>Éditer</span>
|
||||||
|
</nuxt-link>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts"></script>
|
<script setup lang="ts">
|
||||||
|
import { ShortFilm } from "~/composables/types"
|
||||||
|
|
||||||
<style scoped lang="sass"></style>
|
definePageMeta({
|
||||||
|
layout: "admin",
|
||||||
|
})
|
||||||
|
|
||||||
|
const films = reactive<ShortFilm[]>([])
|
||||||
|
|
||||||
|
Object.assign(films, (await apiGet("films/")).data.value)
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue