32 lines
1.1 KiB
Vue
32 lines
1.1 KiB
Vue
<template>
|
|
<main class="section">
|
|
<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="`/admin/${film.id}`" class="list-item-content">
|
|
<time v-if="film.projectionDate" :datetime="film.projectionDate">{{ new Date(film.projectionDate).toLocaleString()}}</time>
|
|
<template v-else>À planifier</template> -
|
|
{{ film.title }}
|
|
- {{ film.title }}
|
|
<template v-if="film.director"> de {{ film.director }}</template>
|
|
</nuxt-link>
|
|
<div class="list-item-controls">
|
|
<nuxt-link :to="`/admin/${film.id}/edition`" class="button">
|
|
<span>Éditer</span>
|
|
</nuxt-link>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</main>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ShortFilm } from "~/composables/types"
|
|
|
|
definePageMeta({ layout: "admin" })
|
|
useHead({ title: "Liste des séances" })
|
|
|
|
const films = reactive<ShortFilm[]>([])
|
|
|
|
Object.assign(films, (await apiGet("admin/films/")).data.value)
|
|
</script>
|