🚧 Add admin api and ui for timetable management

This commit is contained in:
2023-06-20 23:10:52 +02:00
parent 0e2cc70a6b
commit 0ae553cca8
10 changed files with 307 additions and 5 deletions

View File

@ -11,7 +11,7 @@ import {
} from "lucide-vue-next";
import { DownloadIcon } from "lucide-vue-next";
defineProps(["timetable", "editable", "remote", "selected"]);
defineProps(["timetable", "editable", "remote", "selected", "admin"]);
defineEmits(["click", "edit", "delete", "copy", "export", "upload"]);
const deleteConfirm = ref(false);
@ -32,16 +32,17 @@ watch(deleteConfirm, (value) => {
<div class="info">
<span class="name">{{ timetable.title }}</span>
<span class="detail"
>{{ $t("settings.source") }}: {{ timetable.source }}</span
>{{ $t("settings.source") }}: {{ timetable.source }}
<span v-if="admin">, Class: {{ timetable.class }}</span></span
>
</div>
</div>
<div class="buttons">
<DownloadIcon @click="$emit('export')" />
<DownloadIcon v-if="!admin" @click="$emit('export')" />
<Edit2Icon v-if="editable && !remote" @click="$emit('edit')" />
<UploadCloudIcon v-if="editable && remote" @click="$emit('upload')" />
<CopyIcon @click="$emit('copy')" />
<CopyIcon v-if="!admin" @click="$emit('copy')" />
<TrashIcon
v-if="editable && !remote && !deleteConfirm"
@click="deleteConfirm = true"