Gefällt mir im Feed, Suche links in der App-Kopfzeile (0.58.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 13m31s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 13m53s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 13m53s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 13m44s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 12m3s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 12m20s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m35s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 1m1s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 12m13s
CI / Build-Artefakte aktuell (pull_request) Successful in 4m56s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-10-01 14:55:48 +00:00
parent 086878c733
commit b2599f7bc3
141 changed files with 467 additions and 379 deletions

View file

@ -1,16 +1,44 @@
<script setup>
import { computed } from 'vue';
import { computed, ref } from 'vue';
import { Link } from '@inertiajs/vue3';
import { CalendarDays, Heart, MessageCircle, Vote } from '@lucide/vue';
import { Button } from '@/components/ui/button';
import PersonAvatar from '@/components/PersonAvatar.vue';
import { formatRelative } from '@/lib/format';
import { http } from '@/lib/http';
/** Ein Beitrag im Feed der Mitarbeiter-App (Neuigkeit, neue Kollegin, Termin, Umfrage, Gruppenbeitrag …) */
const props = defineProps({
item: { type: Object, required: true },
});
// Gefällt mir: sofort umschalten, bei Fehler zurück
const liked = ref(!!props.item.like?.liked);
const likes = ref(props.item.stats?.likes ?? 0);
const busy = ref(false);
async function toggleLike() {
if (!props.item.like || busy.value) return;
const next = !liked.value;
liked.value = next;
likes.value += next ? 1 : -1;
busy.value = true;
try {
if (props.item.like.mode === 'reaction') {
await http.post(props.item.like.url, { emoji: next ? '❤️' : null });
} else {
await (next ? http.post(props.item.like.url) : http.delete(props.item.like.url));
}
} catch {
liked.value = !next;
likes.value += next ? -1 : 1;
} finally {
busy.value = false;
}
}
const kindIcon = computed(() => ({ event: CalendarDays, poll: Vote })[props.item.kind] ?? null);
const internal = (url) => url?.startsWith('/');
</script>
@ -56,8 +84,19 @@ const internal = (url) => url?.startsWith('/');
</div>
</component>
<footer v-if="item.stats || item.cta" class="flex items-center gap-4 border-t px-5 py-2.5 text-sm text-muted-foreground">
<span v-if="item.stats?.likes != null" class="inline-flex items-center gap-1.5"><Heart class="size-4" /> {{ item.stats.likes }}</span>
<footer v-if="item.stats || item.cta || item.like" class="flex items-center gap-4 border-t px-5 py-2 text-sm text-muted-foreground">
<button
v-if="item.like"
type="button"
class="-ml-2 inline-flex items-center gap-1.5 rounded-pill px-2 py-1 font-medium hover:bg-accent"
:class="liked ? 'text-rose-600 dark:text-rose-400' : ''"
:aria-pressed="liked"
:aria-label="liked ? 'Gefällt mir nicht mehr' : 'Gefällt mir'"
@click="toggleLike"
>
<Heart class="size-4" :fill="liked ? 'currentColor' : 'none'" /> {{ likes }}
</button>
<span v-else-if="item.stats?.likes != null" class="inline-flex items-center gap-1.5"><Heart class="size-4" /> {{ item.stats.likes }}</span>
<span v-if="item.stats?.comments != null" class="inline-flex items-center gap-1.5"><MessageCircle class="size-4" /> {{ item.stats.comments }}</span>
<span v-if="item.stats?.label">{{ item.stats.label }}</span>
<Button v-if="item.cta" size="sm" variant="outline" class="ml-auto rounded-pill" as-child>

View file

@ -49,6 +49,8 @@ const footerContent = computed(() => (page.props.footerContent?.blocks?.length ?
const headerStyle = computed(() => branding.value.header_style ?? 'light');
// Erscheinungsbild → „Hauptmenü am PC“: Burger-Menü auch auf großen Bildschirmen
const burgerOnDesktop = computed(() => branding.value.nav_style === 'burger');
// Mitarbeiter-App: Suche gleich hinter dem Logo, das Menü rechts davon
const isApp = computed(() => branding.value.interface === 'app');
const navigation = computed(() => page.props.navigation);
// Was nicht in die Kopfzeile passt, kommt unter „Mehr“. Gemessen wird an einer
@ -185,6 +187,8 @@ const themeOptions = [
<BrandLogo :inverted="headerStyle !== 'light'" compact />
</Link>
<GlobalSearchBox v-if="isApp" :initial="searchQuery" class="hidden w-56 shrink-0 md:block xl:w-72" />
<nav ref="navBox" class="relative hidden h-full min-w-0 flex-1" :class="{ 'lg:block': !burgerOnDesktop }" aria-label="Hauptnavigation">
<!-- Unsichtbare Kopie zum Messen der Breiten -->
<div class="pointer-events-none invisible absolute inset-0 overflow-hidden" aria-hidden="true">
@ -194,7 +198,7 @@ const themeOptions = [
</li>
</ul>
</div>
<ul class="flex h-full items-stretch gap-1">
<ul class="flex h-full items-stretch gap-1" :class="isApp ? 'justify-end' : ''">
<li v-for="item in navVisible" :key="item.key" class="flex">
<DropdownMenu v-if="item.children.length">
<DropdownMenuTrigger
@ -263,7 +267,7 @@ const themeOptions = [
</nav>
<div class="ml-auto flex shrink-0 items-center gap-1">
<GlobalSearchBox :initial="searchQuery" class="mr-2 hidden w-64 md:block xl:w-80" />
<GlobalSearchBox v-if="!isApp" :initial="searchQuery" class="mr-2 hidden w-64 md:block xl:w-80" />
<Link href="/suche" class="grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground md:hidden" aria-label="Portal durchsuchen">
<Search class="size-5" />