QM-Texterkennung: Imagick nur mit Ghostscript als verfügbar melden
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 3m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 3m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 3m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 2m56s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m4s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 4m1s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m39s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m10s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 3m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 3m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 3m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 2m56s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m4s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 4m1s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m39s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m10s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5a360d3cc7
commit
b50d089946
117 changed files with 1747 additions and 2 deletions
61
plugins-core/speiseplan/resources/js/pages/Index.vue
Normal file
61
plugins-core/speiseplan/resources/js/pages/Index.vue
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<script setup>
|
||||
import { watch } from 'vue';
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { FileText, Printer, UtensilsCrossed } from '@lucide/vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import ManagePanel from '../components/ManagePanel.vue';
|
||||
|
||||
const props = defineProps({
|
||||
weeks: { type: Array, required: true },
|
||||
allergens: { type: Object, default: null },
|
||||
canManage: { type: Boolean, default: false },
|
||||
manage: { type: Object, default: null },
|
||||
});
|
||||
|
||||
const page = usePage();
|
||||
watch(() => page.props.flash.status, (status) => status && toast.success(status), { immediate: true });
|
||||
|
||||
const printUrl = (ids) => `/speiseplan/druck${ids.length ? `?wochen=${ids.join(',')}` : ''}`;
|
||||
const available = () => props.weeks.filter((w) => w.plan).map((w) => w.plan.id);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppLayout title="Speiseplan">
|
||||
<PageHeader title="Speiseplan" description="Unsere Kantine – diese und nächste Woche.">
|
||||
<template #actions>
|
||||
<Button v-if="allergens" variant="outline" as-child><a :href="allergens.url" target="_blank" rel="noopener"><FileText /> Allergie-Informationen</a></Button>
|
||||
<Button v-if="available().length" as-child><a :href="printUrl(available())" target="_blank" rel="noopener"><Printer /> Drucken</a></Button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div class="grid gap-6 lg:grid-cols-2">
|
||||
<section v-for="week in weeks" :key="week.week_start" class="overflow-hidden rounded-lg border bg-card">
|
||||
<header class="flex items-center justify-between gap-3 border-b px-4 py-2.5">
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold">{{ week.title }}</h2>
|
||||
<p class="text-xs text-muted-foreground">{{ week.label }}</p>
|
||||
</div>
|
||||
<Button v-if="week.plan" size="sm" variant="ghost" as-child><a :href="printUrl([week.plan.id])" target="_blank" rel="noopener"><Printer /> Nur diese Woche</a></Button>
|
||||
</header>
|
||||
<a v-if="week.plan" :href="week.plan.image_url" target="_blank" rel="noopener" class="block bg-muted/40 p-3" title="In voller Größe öffnen">
|
||||
<img :src="week.plan.image_url" :alt="`Speiseplan ${week.label}`" class="mx-auto w-full max-w-2xl rounded shadow-sm" />
|
||||
</a>
|
||||
<div v-else class="grid aspect-[210/297] max-h-[36rem] w-full place-items-center bg-muted/30 text-center">
|
||||
<div>
|
||||
<UtensilsCrossed class="mx-auto size-8 text-muted-foreground" :stroke-width="1.5" />
|
||||
<p class="mt-2 text-sm text-muted-foreground">Für diese Woche liegt noch kein Speiseplan vor.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<p v-if="allergens" class="mt-6 text-sm">
|
||||
<a :href="allergens.url" target="_blank" rel="noopener" class="inline-flex items-center gap-1.5 font-medium text-brand-text hover:underline"><FileText class="size-4" /> Allergie-Informationen (PDF)</a>
|
||||
</p>
|
||||
|
||||
<ManagePanel v-if="canManage && manage" :manage="manage" :allergens="allergens" />
|
||||
</AppLayout>
|
||||
</template>
|
||||
118
plugins-core/speiseplan/resources/js/pages/Print.vue
Normal file
118
plugins-core/speiseplan/resources/js/pages/Print.vue
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<script setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
|
||||
/**
|
||||
* Druckansicht ohne Portal-Rahmen: jeder Plan füllt eine A4-Seite randlos.
|
||||
*/
|
||||
const props = defineProps({
|
||||
plans: { type: Array, required: true },
|
||||
});
|
||||
|
||||
function print() {
|
||||
window.print();
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
// Erst drucken, wenn alle Bilder geladen sind.
|
||||
await Promise.all([...document.querySelectorAll('.sp-page img')].map((img) => (img.complete ? null : new Promise((r) => (img.onload = img.onerror = r)))));
|
||||
if (props.plans.length) setTimeout(print, 150);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Speiseplan drucken" />
|
||||
<div class="sp-toolbar">
|
||||
<strong>Speiseplan drucken</strong>
|
||||
<span>{{ plans.length }} {{ plans.length === 1 ? 'Seite' : 'Seiten' }} · A4, randlos. Falls Adresse oder Datum mitgedruckt werden: im Druckdialog „Kopf- und Fußzeilen“ abschalten.</span>
|
||||
<button type="button" @click="print">Drucken</button>
|
||||
</div>
|
||||
<p v-if="!plans.length" class="sp-empty">Kein Speiseplan zum Drucken vorhanden.</p>
|
||||
<div v-for="plan in plans" :key="plan.id" class="sp-page">
|
||||
<img :src="plan.image_url" :alt="`Speiseplan ${plan.label}`" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
@page {
|
||||
size: A4 portrait;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sp-toolbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 12px 16px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
font: 14px/1.4 system-ui, sans-serif;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.sp-toolbar span {
|
||||
flex: 1;
|
||||
color: #6b7280;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
.sp-toolbar button {
|
||||
padding: 6px 14px;
|
||||
border-radius: 6px;
|
||||
background: #111827;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.sp-empty {
|
||||
padding: 24px;
|
||||
font: 14px system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.sp-page {
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
margin: 16px auto;
|
||||
box-shadow: 0 1px 6px rgb(0 0 0 / 0.15);
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sp-page img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: fill;
|
||||
}
|
||||
|
||||
@media print {
|
||||
html,
|
||||
body {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
background: #fff !important;
|
||||
}
|
||||
|
||||
.sp-toolbar,
|
||||
.sp-empty {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.sp-page {
|
||||
margin: 0;
|
||||
box-shadow: none;
|
||||
break-after: page;
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
.sp-page:last-child {
|
||||
break-after: auto;
|
||||
page-break-after: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue