Verleih 1.0.0: Verleihsystem für Inhaus

Übersicht mit Status und Standort, Anfragen im Portal (Benachrichtigung +
E-Mail ans Team), Zusagen/Absagen mit automatischem Eintrag, Zurücknehmen,
Recht „Verleih verwalten“, einstellbare Bezeichnungen und Übernahme aus dem
WordPress-Plugin „FL-Verleihsystem“ (WXR mit Bildern).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-28 15:17:47 +00:00
commit 14aaa16b30
47 changed files with 4208 additions and 0 deletions

View file

@ -0,0 +1,26 @@
<script setup>
import { Link } from '@inertiajs/vue3';
import { ImageOff, MapPin } from '@lucide/vue';
import StatusBadge from './StatusBadge.vue';
defineProps({
item: { type: Object, required: true },
});
</script>
<template>
<article class="ih:group ih:flex ih:flex-col ih:overflow-hidden ih:rounded-lg ih:border ih:bg-card ih:shadow-xs ih:transition-shadow ih:hover:shadow-md">
<!-- Kunstwerke nicht beschneiden: ganzes Bild auf ruhigem Grund -->
<Link :href="item.url" prefetch class="ih:relative ih:grid ih:aspect-[4/3] ih:place-items-center ih:overflow-hidden ih:bg-muted ih:p-3">
<img v-if="item.thumb_url" :src="item.thumb_url" :alt="item.title" loading="lazy" class="ih:max-h-full ih:max-w-full ih:object-contain ih:shadow-sm ih:transition-transform ih:duration-300 ih:group-hover:scale-[1.02]" />
<ImageOff v-else class="ih:size-8 ih:text-muted-foreground" :stroke-width="1.5" />
<StatusBadge :lent="item.lent" class="ih:absolute ih:top-2 ih:left-2" />
</Link>
<div class="ih:flex ih:flex-1 ih:flex-col ih:gap-1 ih:p-3">
<Link :href="item.url" prefetch class="ih:line-clamp-2 ih:text-[15px] ih:leading-snug ih:font-semibold ih:hover:underline">{{ item.title }}</Link>
<p v-if="item.location" class="ih:mt-auto ih:flex ih:items-center ih:gap-1 ih:pt-1 ih:text-xs ih:text-muted-foreground">
<MapPin class="ih:size-3.5 ih:shrink-0" /><span class="ih:truncate">{{ item.location }}</span>
</p>
</div>
</article>
</template>

View file

@ -0,0 +1,62 @@
<script setup>
import { useForm } from '@inertiajs/vue3';
import { LoaderCircle, Send } from '@lucide/vue';
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, FormField, Input, Textarea } from '@inhaus/ui';
const props = defineProps({
item: { type: Object, required: true },
labels: { type: Object, required: true },
defaultLocation: { type: String, default: null },
});
const open = defineModel('open', { type: Boolean, default: false });
const today = new Date().toISOString().slice(0, 10);
const form = useForm({ location: props.defaultLocation ?? '', from: '', until: '', message: '' });
function submit() {
form.post(`/verleih/${props.item.id}/anfragen`, {
preserveScroll: true,
onSuccess: () => {
open.value = false;
form.reset('from', 'until', 'message');
},
});
}
</script>
<template>
<Dialog v-model:open="open">
<DialogContent class="ih:sm:max-w-lg">
<DialogHeader>
<DialogTitle>„{{ item.title }}“ anfragen</DialogTitle>
<DialogDescription>
Das Team bekommt Ihre Anfrage im Portal und per E-Mail und meldet sich bei Ihnen.
<template v-if="item.lent"> Gerade ist es verliehen – Sie können es trotzdem für später anfragen.</template>
</DialogDescription>
</DialogHeader>
<form id="verleih-anfrage" class="ih:grid ih:gap-4" @submit.prevent="submit">
<FormField id="vl-location" label="Wo soll es hin?" :error="form.errors.location">
<Input id="vl-location" v-model="form.location" maxlength="200" placeholder="z. B. Verwaltung, Besprechungsraum 2. OG" required />
</FormField>
<div class="ih:grid ih:gap-4 ih:sm:grid-cols-2">
<FormField id="vl-from" label="Ab (optional)" :error="form.errors.from">
<Input id="vl-from" v-model="form.from" type="date" :min="today" />
</FormField>
<FormField id="vl-until" label="Bis (optional)" :error="form.errors.until">
<Input id="vl-until" v-model="form.until" type="date" :min="form.from || today" />
</FormField>
</div>
<FormField id="vl-message" label="Nachricht (optional)" :error="form.errors.message">
<Textarea id="vl-message" v-model="form.message" rows="3" maxlength="2000" placeholder="z. B. Anlass, Ansprechperson vor Ort …" />
</FormField>
</form>
<DialogFooter>
<Button variant="outline" @click="open = false">Abbrechen</Button>
<Button type="submit" form="verleih-anfrage" :disabled="form.processing || !form.location.trim()">
<LoaderCircle v-if="form.processing" class="ih:animate-spin" /><Send v-else /> Anfrage senden
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</template>

View file

@ -0,0 +1,15 @@
<script setup>
defineProps({
lent: { type: Boolean, required: true },
});
</script>
<template>
<span
class="ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-full ih:px-2 ih:py-0.5 ih:text-[11px] ih:font-semibold ih:shadow-xs"
:class="lent ? 'ih:bg-card ih:text-muted-foreground' : 'ih:bg-brand ih:text-brand-foreground'"
>
<span class="ih:size-1.5 ih:rounded-full" :class="lent ? 'ih:bg-muted-foreground' : 'ih:bg-brand-foreground'" aria-hidden="true" />
{{ lent ? 'Verliehen' : 'Verfügbar' }}
</span>
</template>