2023-09-10 21:08:42 +00:00
|
|
|
<template>
|
|
|
|
<MultiModal ref="multi_modal" />
|
|
|
|
|
2023-09-12 16:39:52 +00:00
|
|
|
<BulmaDrawer
|
|
|
|
header="Kalender-Assistent"
|
|
|
|
:ready="is_loaded"
|
|
|
|
@open="on_open"
|
|
|
|
refreshable
|
|
|
|
>
|
2023-09-10 21:08:42 +00:00
|
|
|
<div class="card-content">
|
|
|
|
<div class="content">
|
2023-09-11 02:36:51 +00:00
|
|
|
<h4>Buchstaben-Zuordnung</h4>
|
2023-09-10 21:08:42 +00:00
|
|
|
<div class="tags are-medium">
|
2023-09-12 16:39:52 +00:00
|
|
|
<span
|
|
|
|
v-for="(day_part, index) in day_parts"
|
|
|
|
:key="`part-${index}`"
|
|
|
|
class="tag is-info"
|
|
|
|
>
|
2023-09-12 17:15:44 +00:00
|
|
|
{{ day_part.day }}: {{ day_part.value.split("").join(", ") }}
|
2023-09-12 16:39:52 +00:00
|
|
|
</span>
|
2023-09-10 21:08:42 +00:00
|
|
|
</div>
|
|
|
|
|
2023-09-11 02:36:51 +00:00
|
|
|
<h4>Bilder-Zuordnung</h4>
|
2023-09-10 21:08:42 +00:00
|
|
|
<div class="tags are-medium">
|
2023-09-12 17:31:08 +00:00
|
|
|
<span
|
|
|
|
v-for="(day_part, index) in day_image_names"
|
|
|
|
:key="`part-${index}`"
|
|
|
|
class="tag is-primary"
|
|
|
|
>
|
|
|
|
{{ day_part.day }}: {{ day_part.value }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h4>Alle Türchen</h4>
|
|
|
|
<div class="tags are-medium">
|
|
|
|
<BulmaButton
|
|
|
|
v-for="(day_part, index) in day_parts"
|
|
|
|
:key="`btn-${index}`"
|
|
|
|
class="tag button is-primary"
|
|
|
|
icon="fa-solid fa-door-open"
|
|
|
|
:text="`${day_part.day}`"
|
|
|
|
@click.left="door_click(day_part.day)"
|
|
|
|
/>
|
2023-09-10 21:08:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</BulmaDrawer>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-09-12 17:15:44 +00:00
|
|
|
import { DayStrModel } from "@/lib/api";
|
2023-09-10 21:08:42 +00:00
|
|
|
import { Options, Vue } from "vue-class-component";
|
|
|
|
|
|
|
|
import BulmaButton from "./bulma/Button.vue";
|
|
|
|
import BulmaDrawer from "./bulma/Drawer.vue";
|
|
|
|
import MultiModal from "./calendar/MultiModal.vue";
|
|
|
|
|
|
|
|
@Options({
|
|
|
|
components: {
|
|
|
|
BulmaButton,
|
|
|
|
BulmaDrawer,
|
|
|
|
MultiModal,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class extends Vue {
|
2023-09-12 16:39:52 +00:00
|
|
|
public is_loaded = true;
|
2023-09-12 17:15:44 +00:00
|
|
|
public day_parts: DayStrModel[] = [];
|
2023-09-12 17:31:08 +00:00
|
|
|
public day_image_names: DayStrModel[] = [];
|
2023-09-12 16:39:52 +00:00
|
|
|
|
2023-09-10 21:08:42 +00:00
|
|
|
declare $refs: {
|
|
|
|
multi_modal: MultiModal;
|
|
|
|
};
|
|
|
|
|
2023-09-12 16:39:52 +00:00
|
|
|
public on_open(): void {
|
|
|
|
this.is_loaded = false;
|
|
|
|
|
2023-09-12 17:31:08 +00:00
|
|
|
Promise.all([
|
|
|
|
this.$advent22.api_get<DayStrModel[]>("admin/day_parts"),
|
|
|
|
this.$advent22.api_get<DayStrModel[]>("admin/day_image_names"),
|
|
|
|
])
|
|
|
|
.then(([day_parts, day_image_names]) => {
|
2023-09-12 16:39:52 +00:00
|
|
|
this.day_parts = day_parts;
|
2023-09-12 17:31:08 +00:00
|
|
|
this.day_image_names = day_image_names;
|
2023-09-12 16:39:52 +00:00
|
|
|
this.is_loaded = true;
|
|
|
|
})
|
|
|
|
.catch(console.log);
|
|
|
|
}
|
|
|
|
|
2023-09-10 21:08:42 +00:00
|
|
|
public door_click(day: number) {
|
|
|
|
this.$refs.multi_modal.show_progress();
|
|
|
|
|
|
|
|
this.$advent22
|
2023-09-12 13:55:08 +00:00
|
|
|
.api_get_blob(`images/${day}`)
|
2023-09-10 21:08:42 +00:00
|
|
|
.then((data) => this.$refs.multi_modal.show_image(data))
|
|
|
|
.catch(() => this.$refs.multi_modal.set_active(false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|