Compare commits
No commits in common. "main" and "v1.1.0" have entirely different histories.
8 changed files with 49 additions and 59 deletions
2
dist/assets/style-BD4vSwmw.css
vendored
2
dist/assets/style-BD4vSwmw.css
vendored
File diff suppressed because one or more lines are too long
2
dist/assets/style-CAm2qtFB.css
vendored
Normal file
2
dist/assets/style-CAm2qtFB.css
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/inhaus.json
vendored
2
dist/inhaus.json
vendored
|
|
@ -9,6 +9,6 @@
|
|||
"widgets/Latest": "widgets/Latest.js"
|
||||
},
|
||||
"css": [
|
||||
"assets/style-BD4vSwmw.css"
|
||||
"assets/style-CAm2qtFB.css"
|
||||
]
|
||||
}
|
||||
2
dist/pages/Index.js
vendored
2
dist/pages/Index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/pages/Show.js
vendored
2
dist/pages/Show.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"slug": "kleinanzeigen",
|
||||
"name": "Kleinanzeigen",
|
||||
"version": "1.3.0",
|
||||
"version": "1.1.0",
|
||||
"description": "Kleinanzeigen von Kolleginnen und Kollegen für Kolleginnen und Kollegen: verkaufen, verschenken, suchen, tauschen – mit Fotos, Merkliste und Freigabe durch die Moderation. Kontakt über das Chat-Plugin oder per E-Mail.",
|
||||
"author": "Loheide",
|
||||
"namespace": "Inhaus\\Plugins\\Kleinanzeigen\\",
|
||||
"class": "Inhaus\\Plugins\\Kleinanzeigen\\KleinanzeigenPlugin",
|
||||
"requires": {
|
||||
"core": ">=0.61.0",
|
||||
"core": ">=0.39.1",
|
||||
"php": ">=8.3"
|
||||
},
|
||||
"update_url": "https://git.loheide.cloud/api/v1/repos/friloo/inhaus-plugin-kleinanzeigen/releases/latest"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<script setup>
|
||||
import { watch } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import { Link, router, usePage } from '@inertiajs/vue3';
|
||||
import { Heart, ListChecks, Plus, ShieldCheck, ShoppingBag } from '@lucide/vue';
|
||||
import { AppLayout, Button, EmptyState, ListToolbar, PageHeader, toast, useListView } from '@inhaus/ui';
|
||||
import { Heart, ListChecks, Plus, Search, ShieldCheck, ShoppingBag } from '@lucide/vue';
|
||||
import { AppLayout, Button, EmptyState, PageHeader, toast } from '@inhaus/ui';
|
||||
import ListingCard from '../components/ListingCard.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -19,7 +19,12 @@ const props = defineProps({
|
|||
const page = usePage();
|
||||
watch(() => page.props.flash?.status, (status) => status && toast.success(status), { immediate: true });
|
||||
|
||||
const view = useListView('kleinanzeigen', 'grid');
|
||||
const query = ref(props.filters.q);
|
||||
let timer;
|
||||
watch(query, (value) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => apply({ q: value }), 350);
|
||||
});
|
||||
|
||||
function apply(changes) {
|
||||
const params = { ...props.filters, ...changes };
|
||||
|
|
@ -43,6 +48,16 @@ const sorts = { neu: 'Neueste zuerst', preis: 'Preis aufsteigend', 'preis-ab': '
|
|||
|
||||
<div class="ih:grid ih:gap-6 ih:lg:grid-cols-[15rem_minmax(0,1fr)]">
|
||||
<aside class="ih:grid ih:content-start ih:gap-5">
|
||||
<div class="ih:relative">
|
||||
<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="Suchen" aria-label="Anzeigen durchsuchen" class="ih:h-10 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>
|
||||
|
||||
<nav aria-label="Art" class="ih:flex ih:flex-wrap ih:gap-1.5">
|
||||
<button type="button" class="ih:rounded-full ih:border ih:px-3 ih:py-1 ih:text-[13px]" :class="!filters.typ ? 'ih:border-brand ih:bg-brand ih:text-brand-foreground' : 'ih:bg-card ih:hover:bg-accent'" :aria-pressed="!filters.typ" @click="apply({ typ: null })">Alle</button>
|
||||
<button v-for="(label, key) in types" :key="key" type="button" class="ih:rounded-full ih:border ih:px-3 ih:py-1 ih:text-[13px]" :class="filters.typ === key ? 'ih:border-brand ih:bg-brand ih:text-brand-foreground' : 'ih:bg-card ih:hover:bg-accent'" :aria-pressed="filters.typ === key" @click="apply({ typ: key })">{{ label }}</button>
|
||||
</nav>
|
||||
|
||||
<nav aria-label="Kategorien" class="ih:hidden ih:lg:block">
|
||||
<h2 class="ih:mb-1.5 ih:text-xs ih:font-semibold ih:tracking-wider ih:text-muted-foreground ih:uppercase">Kategorien</h2>
|
||||
<ul class="ih:grid ih:gap-0.5 ih:text-sm">
|
||||
|
|
@ -61,44 +76,19 @@ const sorts = { neu: 'Neueste zuerst', preis: 'Preis aufsteigend', 'preis-ab': '
|
|||
</aside>
|
||||
|
||||
<section class="ih:min-w-0">
|
||||
<ListToolbar
|
||||
:filters="[{ value: null, label: 'Alle' }, ...Object.entries(types).map(([value, label]) => ({ value, label }))]"
|
||||
:filter="filters.typ || null"
|
||||
filter-label="Art"
|
||||
:search="filters.q ?? ''"
|
||||
search-placeholder="Anzeigen durchsuchen"
|
||||
:sorts="Object.entries(sorts).map(([value, label]) => ({ value, label }))"
|
||||
:sort="filters.sortierung || 'neu'"
|
||||
v-model:view="view"
|
||||
@update:filter="(value) => apply({ typ: value })"
|
||||
@update:search="(value) => apply({ q: value })"
|
||||
@update:sort="(value) => apply({ sortierung: value })"
|
||||
>
|
||||
<button type="button" class="ih:inline-flex ih:h-9 ih:items-center ih:gap-1.5 ih:rounded-full ih:border ih:px-3 ih:text-sm" :class="filters.merkliste ? 'ih:border-brand ih:bg-brand-soft ih:text-brand-text' : 'ih:bg-card ih:hover:bg-accent'" :aria-pressed="!!filters.merkliste" @click="apply({ merkliste: filters.merkliste ? null : 1 })">
|
||||
<div class="ih:mb-4 ih:flex ih:flex-wrap ih:items-center ih:gap-3">
|
||||
<p class="ih:flex-1 ih:text-sm ih:text-muted-foreground">{{ pagination.total }} {{ pagination.total === 1 ? 'Anzeige' : 'Anzeigen' }}</p>
|
||||
<button type="button" class="ih:inline-flex ih:items-center ih:gap-1.5 ih:rounded-md ih:border ih:px-3 ih:py-1.5 ih:text-sm" :class="filters.merkliste ? 'ih:border-brand ih:bg-brand-soft ih:text-brand-text' : 'ih:bg-card ih:hover:bg-accent'" :aria-pressed="filters.merkliste" @click="apply({ merkliste: filters.merkliste ? null : 1 })">
|
||||
<Heart class="ih:size-4" :class="filters.merkliste ? 'ih:fill-current' : ''" /> Merkliste
|
||||
</button>
|
||||
</ListToolbar>
|
||||
<p class="ih:-mt-2 ih:mb-3 ih:text-sm ih:text-muted-foreground">{{ pagination.total }} {{ pagination.total === 1 ? 'Anzeige' : 'Anzeigen' }}</p>
|
||||
<select class="ih:h-9 ih:rounded-md ih:border ih:bg-card ih:px-2 ih:text-sm" aria-label="Sortierung" :value="filters.sortierung" @change="apply({ sortierung: $event.target.value })">
|
||||
<option v-for="(label, key) in sorts" :key="key" :value="key">{{ label }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div v-if="listings.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">
|
||||
<div v-if="listings.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">
|
||||
<ListingCard v-for="listing in listings" :key="listing.id" :listing="listing" />
|
||||
</div>
|
||||
<ul v-else-if="listings.length" class="ih:divide-y ih:rounded-lg ih:border ih:bg-card">
|
||||
<li v-for="listing in listings" :key="listing.id">
|
||||
<Link :href="listing.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-14 ih:shrink-0 ih:place-items-center ih:overflow-hidden ih:rounded-md ih:bg-muted">
|
||||
<img v-if="listing.thumb_url" :src="listing.thumb_url" alt="" class="ih:size-full ih:object-cover" />
|
||||
<ShoppingBag 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:text-xs ih:text-muted-foreground">{{ listing.type_label }} · {{ listing.category_label }}<template v-if="listing.reserved"> · reserviert</template></span>
|
||||
<span class="ih:truncate ih:font-medium">{{ listing.title }}</span>
|
||||
<span v-if="listing.location" class="ih:truncate ih:text-xs ih:text-muted-foreground">{{ listing.location }}</span>
|
||||
</span>
|
||||
<span v-if="listing.price" class="ih:shrink-0 ih:font-semibold ih:text-brand-text">{{ listing.price }}</span>
|
||||
</Link>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-else class="ih:rounded-lg ih:border ih:bg-card">
|
||||
<EmptyState :icon="ShoppingBag" :title="filters.q || filters.typ || filters.kategorie || filters.merkliste ? 'Keine passenden Anzeigen' : 'Noch keine Anzeigen'" text="Etwas übrig oder auf der Suche? Geben Sie die erste Anzeige auf." />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { computed, ref, watch } from 'vue';
|
||||
import { Link, router, useForm, usePage } from '@inertiajs/vue3';
|
||||
import { CalendarDays, ChevronLeft, ChevronRight, Flag, Heart, ImageOff, LoaderCircle, Mail, MapPin, MessageCircle, PencilLine, Phone, ShieldCheck, Trash2 } from '@lucide/vue';
|
||||
import { AppLayout, Button, PageHeader, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, PersonAvatar, Textarea, formatDate, toast } from '@inhaus/ui';
|
||||
import { AppLayout, Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, PersonAvatar, Textarea, formatDate, toast } from '@inhaus/ui';
|
||||
import ListingCard from '../components/ListingCard.vue';
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -45,20 +45,13 @@ const statusNote = computed(() => ({
|
|||
|
||||
<template>
|
||||
<AppLayout :title="l.title">
|
||||
<PageHeader :title="l.title" :breadcrumbs="[{ label: 'Kleinanzeigen', href: '/kleinanzeigen' }]">
|
||||
<template #description>
|
||||
<span class="ih:flex ih:flex-wrap ih:items-center ih:gap-2 ih:text-xs">
|
||||
<span class="ih:rounded ih:bg-brand-soft ih:px-2 ih:py-0.5 ih:font-semibold ih:text-brand-text">{{ l.type_label }}</span>
|
||||
<span>{{ l.category_label }}</span>
|
||||
<span v-if="l.reserved" class="ih:rounded ih:bg-foreground ih:px-2 ih:py-0.5 ih:font-semibold ih:text-background">Reserviert</span>
|
||||
<span v-if="l.price" class="ih:text-base ih:font-semibold ih:text-brand-text">{{ l.price }}</span>
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="l.own || l.can_moderate" #actions>
|
||||
<div class="ih:mb-4 ih:flex ih:items-center ih:justify-between ih:gap-3">
|
||||
<Link href="/kleinanzeigen" class="ih:inline-flex ih:items-center ih:gap-1 ih:text-sm ih:font-medium ih:text-muted-foreground ih:hover:text-foreground"><ChevronLeft class="ih:size-4" /> Alle Kleinanzeigen</Link>
|
||||
<div class="ih:flex ih:gap-2">
|
||||
<Button v-if="l.own" variant="outline" size="sm" as-child><Link :href="`/kleinanzeigen/${l.id}/bearbeiten`"><PencilLine /> Bearbeiten</Link></Button>
|
||||
<Button variant="ghost" size="sm" class="ih:text-destructive ih:hover:text-destructive" @click="remove"><Trash2 /> Löschen</Button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<Button v-if="l.own || l.can_moderate" variant="ghost" size="sm" class="ih:text-destructive ih:hover:text-destructive" @click="remove"><Trash2 /> Löschen</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p v-if="statusNote" class="ih:mb-4 ih:rounded-md ih:border ih:bg-muted ih:px-4 ih:py-3 ih:text-sm">
|
||||
{{ statusNote }}<template v-if="l.review_note"> Hinweis: {{ l.review_note }}</template>
|
||||
|
|
@ -85,7 +78,14 @@ const statusNote = computed(() => ({
|
|||
</section>
|
||||
|
||||
<section class="ih:rounded-xl ih:border ih:bg-card ih:p-5 ih:sm:p-6">
|
||||
<dl class="ih:flex ih:flex-wrap ih:gap-x-6 ih:gap-y-2 ih:text-sm ih:text-muted-foreground">
|
||||
<div class="ih:flex ih:flex-wrap ih:items-center ih:gap-2 ih:text-xs">
|
||||
<span class="ih:rounded ih:bg-brand-soft ih:px-2 ih:py-0.5 ih:font-semibold ih:text-brand-text">{{ l.type_label }}</span>
|
||||
<span class="ih:text-muted-foreground">{{ l.category_label }}</span>
|
||||
<span v-if="l.reserved" class="ih:rounded ih:bg-foreground ih:px-2 ih:py-0.5 ih:font-semibold ih:text-background">Reserviert</span>
|
||||
</div>
|
||||
<h1 class="ih:mt-2 ih:text-2xl ih:font-semibold ih:tracking-tight ih:text-balance">{{ l.title }}</h1>
|
||||
<p v-if="l.price" class="ih:mt-1 ih:text-xl ih:font-semibold ih:text-brand-text">{{ l.price }}</p>
|
||||
<dl class="ih:mt-4 ih:flex ih:flex-wrap ih:gap-x-6 ih:gap-y-2 ih:text-sm ih:text-muted-foreground">
|
||||
<div v-if="l.location" class="ih:flex ih:items-center ih:gap-1.5"><dt class="ih:sr-only">Ort</dt><MapPin class="ih:size-4" aria-hidden="true" /><dd>{{ l.location }}</dd></div>
|
||||
<div v-if="l.published_at" class="ih:flex ih:items-center ih:gap-1.5"><dt class="ih:sr-only">Eingestellt</dt><CalendarDays class="ih:size-4" aria-hidden="true" /><dd>seit {{ formatDate(l.published_at) }}</dd></div>
|
||||
</dl>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue