mailwolt/resources/views/livewire/ui/webmail/folder-sidebar.blade.php

75 lines
4.2 KiB
PHP

@php
$currentFolder = request()->query('folder', 'INBOX');
$starredActive = $currentFolder === '_starred';
$folderIcons = [
'INBOX' => '<rect x=".5" y="2.5" width="13" height="9" rx="1.5" stroke="currentColor" stroke-width="1.2"/><path d="M.5 5l6.5 4 6.5-4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>',
'Sent' => '<path d="M1 13L13 1l-3 12-3.5-4.5L1 13Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/>',
'Drafts' => '<rect x="1" y="1" width="12" height="12" rx="1.5" stroke="currentColor" stroke-width="1.2"/><path d="M4 5h6M4 7.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>',
'Junk' => '<circle cx="7" cy="7" r="5.5" stroke="currentColor" stroke-width="1.2"/><path d="M7 4.5v3" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><circle cx="7" cy="10" r=".7" fill="currentColor"/>',
'Trash' => '<path d="M2 3.5h10M5 3.5V2h4v1.5M5.5 6v4.5M8.5 6v4.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><path d="M3 3.5l.7 8h6.6l.7-8" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>',
'Archive' => '<rect x="1" y="1" width="12" height="3.5" rx="1" stroke="currentColor" stroke-width="1.2"/><path d="M2 4.5v7.5h10V4.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><path d="M5 8h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>',
];
$folderLabels = [
'INBOX' => 'Posteingang',
'Sent' => 'Gesendet',
'Drafts' => 'Entwürfe',
'Junk' => 'Spam',
'Trash' => 'Papierkorb',
'Archive' => 'Archiv',
];
@endphp
<div>
@php
$inboxFolder = collect($folders)->firstWhere('name', 'INBOX');
$otherFolders = collect($folders)->filter(fn($f) => $f['name'] !== 'INBOX')->values();
@endphp
{{-- Posteingang (immer oben, prominent) --}}
@if($inboxFolder)
@php $active = $currentFolder === $inboxFolder['path']; @endphp
<a href="{{ route('ui.webmail.inbox', ['folder' => $inboxFolder['path']]) }}" wire:navigate
class="mw-nav-item {{ $active ? 'active' : '' }}"
style="position:relative;{{ $active ? 'background:var(--mw-vbg);color:var(--mw-v2);font-weight:600;border:1px solid var(--mw-vbd);' : 'color:var(--mw-t2);font-weight:500;' }}">
@if($active)
<span style="position:absolute;left:0;top:4px;bottom:4px;width:3px;border-radius:0 3px 3px 0;background:var(--mw-v);"></span>
@endif
<svg width="13" height="13" viewBox="0 0 14 14" fill="none" style="flex-shrink:0;{{ $active ? 'opacity:.9;' : 'opacity:.6;' }}">
{!! $folderIcons['INBOX'] !!}
</svg>
Posteingang
</a>
@endif
{{-- Markiert (zweite Stelle) --}}
<a href="{{ route('ui.webmail.inbox', ['folder' => '_starred']) }}" wire:navigate
class="mw-nav-item {{ $starredActive ? 'active' : '' }}"
style="{{ $starredActive ? 'background:rgba(245,158,11,.1);color:#d97706;font-weight:500;border:1px solid rgba(245,158,11,.2);' : '' }}">
<span style="font-size:12px;line-height:1;color:{{ $starredActive ? '#d97706' : '#f59e0b' }};flex-shrink:0;"></span>
Markiert
</a>
{{-- Trennlinie --}}
<div style="height:1px;background:var(--mw-b1);margin:6px 4px;"></div>
{{-- Restliche Ordner --}}
@foreach($otherFolders as $f)
@php
$active = $currentFolder === $f['path'];
$label = $folderLabels[$f['name']] ?? $f['name'];
$icon = $folderIcons[$f['name']] ?? '<circle cx="7" cy="7" r="5.5" stroke="currentColor" stroke-width="1.2"/>';
@endphp
<a href="{{ route('ui.webmail.inbox', ['folder' => $f['path']]) }}" wire:navigate
class="mw-nav-item {{ $active ? 'active' : '' }}"
style="position:relative;{{ $active ? 'background:var(--mw-bg3);color:var(--mw-t1);font-weight:500;' : '' }}">
@if($active)
<span style="position:absolute;left:0;top:4px;bottom:4px;width:3px;border-radius:0 3px 3px 0;background:var(--mw-t4);"></span>
@endif
<svg width="13" height="13" viewBox="0 0 14 14" fill="none" style="flex-shrink:0;">
{!! $icon !!}
</svg>
{{ $label }}
</a>
@endforeach
</div>