Verleih 1.2.0: einheitliche Werkzeugleiste mit Listenansicht

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-10-06 19:57:14 +00:00
parent 4fc163e93e
commit 9d44e11b75
6 changed files with 37 additions and 41 deletions

2
dist/assets/style-BGA_ZYPJ.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/inhaus.json vendored
View file

@ -7,6 +7,6 @@
"pages/Show": "pages/Show.js" "pages/Show": "pages/Show.js"
}, },
"css": [ "css": [
"assets/style-D4c_hjHt.css" "assets/style-BGA_ZYPJ.css"
] ]
} }

2
dist/pages/Index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,13 +1,13 @@
{ {
"slug": "verleih", "slug": "verleih",
"name": "Verleih", "name": "Verleih",
"version": "1.1.0", "version": "1.2.0",
"description": "Verleihsystem, z. B. für die Bilder des Künstlerteams: Übersicht mit Status und aktuellem Standort, Anfragen im Portal mit Zusage oder Absage, Import aus dem bisherigen WordPress-Verleihsystem.", "description": "Verleihsystem, z. B. für die Bilder des Künstlerteams: Übersicht mit Status und aktuellem Standort, Anfragen im Portal mit Zusage oder Absage, Import aus dem bisherigen WordPress-Verleihsystem.",
"author": "Loheide", "author": "Loheide",
"namespace": "Inhaus\\Plugins\\Verleih\\", "namespace": "Inhaus\\Plugins\\Verleih\\",
"class": "Inhaus\\Plugins\\Verleih\\VerleihPlugin", "class": "Inhaus\\Plugins\\Verleih\\VerleihPlugin",
"requires": { "requires": {
"core": ">=0.42.0", "core": ">=0.61.0",
"php": ">=8.3" "php": ">=8.3"
}, },
"update_url": "https://git.loheide.cloud/api/v1/repos/friloo/inhaus-plugin-verleih/releases/latest" "update_url": "https://git.loheide.cloud/api/v1/repos/friloo/inhaus-plugin-verleih/releases/latest"

View file

@ -1,9 +1,10 @@
<script setup> <script setup>
import { ref, watch } from 'vue'; import { watch } from 'vue';
import { Link, router, usePage } from '@inertiajs/vue3'; import { Link, router, usePage } from '@inertiajs/vue3';
import { Images, Inbox, Plus, Search, Settings2 } from '@lucide/vue'; import { Images, Inbox, Plus, Settings2 } from '@lucide/vue';
import { AppLayout, Button, EmptyState, PageHeader, formatDate, toast } from '@inhaus/ui'; import { AppLayout, Button, EmptyState, ListToolbar, PageHeader, formatDate, toast, useListView } from '@inhaus/ui';
import ItemCard from '../components/ItemCard.vue'; import ItemCard from '../components/ItemCard.vue';
import StatusBadge from '../components/StatusBadge.vue';
const props = defineProps({ const props = defineProps({
items: { type: Array, required: true }, items: { type: Array, required: true },
@ -18,12 +19,7 @@ const props = defineProps({
const page = usePage(); const page = usePage();
watch(() => page.props.flash?.status, (status) => status && toast.success(status), { immediate: true }); watch(() => page.props.flash?.status, (status) => status && toast.success(status), { immediate: true });
const query = ref(props.filters.q); const view = useListView('verleih', 'grid');
let timer;
watch(query, (value) => {
clearTimeout(timer);
timer = setTimeout(() => apply({ q: value }), 300);
});
function apply(changes) { function apply(changes) {
const params = { ...props.filters, ...changes }; const params = { ...props.filters, ...changes };
@ -70,35 +66,35 @@ const cancel = (request) => window.confirm('Anfrage zurückziehen?') && router.d
</ul> </ul>
</section> </section>
<div class="ih:mb-5 ih:flex ih:flex-wrap ih:items-center ih:gap-3"> <ListToolbar
<nav class="ih:flex ih:flex-wrap ih:gap-1.5" aria-label="Status"> :filters="tabs.map((tab) => ({ value: tab.value, label: tab.label, count: counts[tab.count] }))"
<button :filter="filters.status || null"
v-for="tab in tabs" filter-label="Status"
:key="tab.label" :search="filters.q ?? ''"
type="button" :search-placeholder="`${labels.plural} oder Orte suchen`"
class="ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-full ih:border ih:px-3 ih:py-1 ih:text-[13px]" v-model:view="view"
:class="filters.status === tab.value ? 'ih:border-brand ih:bg-brand ih:text-brand-foreground' : 'ih:bg-card ih:hover:bg-accent'" @update:filter="(value) => apply({ status: value })"
:aria-pressed="filters.status === tab.value" @update:search="(value) => apply({ q: value })"
@click="apply({ status: tab.value })" />
>
{{ tab.label }} <span class="ih:tabular-nums ih:opacity-75">{{ counts[tab.count] }}</span>
</button>
</nav>
<div class="ih:relative ih:ml-auto ih:w-full ih:sm:w-64">
<Search class="ih:pointer-events-none ih:absolute ih:top-1/2 ih:left-2.5 ih:size-4 ih:-translate-y-1/2 ih:text-muted-foreground" />
<input
v-model="query"
type="search"
:placeholder="`${labels.plural} oder Orte suchen`"
:aria-label="`${labels.plural} durchsuchen`"
class="ih:h-9 ih:w-full ih:rounded-md ih:border ih:border-input ih:bg-card ih:pr-3 ih:pl-8 ih:text-sm ih:shadow-xs ih:focus-visible:ring-3 ih:focus-visible:ring-ring/30 ih:focus-visible:outline-none"
/>
</div>
</div>
<div v-if="items.length" class="ih:grid ih:grid-cols-2 ih:gap-3 ih:sm:gap-4 ih:md:grid-cols-3 ih:xl:grid-cols-4"> <div v-if="items.length && view === 'grid'" class="ih:grid ih:grid-cols-2 ih:gap-3 ih:sm:gap-4 ih:md:grid-cols-3 ih:xl:grid-cols-4">
<ItemCard v-for="item in items" :key="item.id" :item="item" /> <ItemCard v-for="item in items" :key="item.id" :item="item" />
</div> </div>
<ul v-else-if="items.length" class="ih:divide-y ih:rounded-lg ih:border ih:bg-card">
<li v-for="item in items" :key="item.id">
<Link :href="item.url" class="ih:flex ih:items-center ih:gap-3 ih:px-4 ih:py-2.5 ih:hover:bg-accent/60">
<span class="ih:grid ih:size-12 ih:shrink-0 ih:place-items-center ih:overflow-hidden ih:rounded-md ih:bg-muted">
<img v-if="item.thumb_url" :src="item.thumb_url" alt="" class="ih:max-h-full ih:max-w-full ih:object-contain" />
<Images v-else class="ih:size-5 ih:text-muted-foreground" />
</span>
<span class="ih:grid ih:min-w-0 ih:flex-1">
<span class="ih:truncate ih:font-medium">{{ item.title }}</span>
<span v-if="item.location" class="ih:truncate ih:text-xs ih:text-muted-foreground">{{ item.location }}</span>
</span>
<StatusBadge :lent="item.lent" class="ih:shrink-0 ih:border" />
</Link>
</li>
</ul>
<div v-else class="ih:rounded-lg ih:border ih:bg-card"> <div v-else class="ih:rounded-lg ih:border ih:bg-card">
<EmptyState <EmptyState
:icon="Images" :icon="Images"