Files
fewo-stommer/resources/views/filament/property-switcher.blade.php
LarsandClaude Opus 5.5 8bcda9a4bc Wohnungsumschalter im Verwaltungsmenue und wohnungsbezogene Listen
Oben im Seitenmenue waehlt man die Wohnung; Listen, neue Eintraege, Belegungsplan
und Preise & Angebote folgen ihr. Ein geoeffneter Eintrag einer anderen Wohnung
schaltet auf diese um. Galerie und Ersatz-Titelbild der Website zeigen nur Fotos
der Wohnung des Bausteins und Fotos ohne Wohnung.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:40:13 +01:00

33 lines
1.7 KiB
PHP

@php
/** Apartment switcher at the top of the admin menu (App\Support\CurrentProperty). */
$current = app(\App\Support\CurrentProperty::class);
$property = $current->get();
@endphp
@if ($property)
<div class="fi-property-switcher" style="margin-bottom:1rem">
<x-filament::section compact icon="heroicon-o-home-modern" heading="Wohnung">
@if ($current->hasChoice())
<form method="POST" action="{{ route('filament.admin.switch-property') }}">
@csrf
<input type="hidden" name="return" value="{{ request()->fullUrl() }}">
<x-filament::input.wrapper>
<x-filament::input.select name="property" aria-label="Wohnung wählen" x-data x-on:change="$el.form.submit()">
@foreach ($current->options() as $id => $name)
<option value="{{ $id }}" @selected($id === $property->id)>{{ $name }}</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
<noscript><x-filament::button type="submit" size="sm" style="margin-top:.5rem">Wechseln</x-filament::button></noscript>
</form>
@else
<p style="font-weight:600">{{ $property->name }}</p>
@endif
@can('update', $property)
<x-filament::link :href="\App\Filament\Resources\Properties\PropertyResource::getUrl('edit', ['record' => $property])" size="sm" style="margin-top:.5rem">
Einstellungen der Wohnung
</x-filament::link>
@endcan
</x-filament::section>
</div>
@endif