mailwolt/resources/views/livewire/ui/mail/alias-list.blade.php

159 lines
10 KiB
PHP

<div class="space-y-4">
{{-- Suche + Aktion --}}
<div class="">
<div class="md:flex items-center justify-between gap-3">
<h1 class="text-5xl #mb-6">Aliase</h1>
</div>
<div class="my-4 md:flex items-center justify-end gap-3">
<input
type="text"
wire:model.live.debounce.300ms="search"
class="md:max-w-96 w-full justify-end flex-1 rounded-xl bg-white/5 border border-white/10 px-4 py-2.5 text-white/90 placeholder:text-white/50"
placeholder="Suchen (Alias) …">
</div>
</div>
@if($domains->count())
<div class="space-y-3">
@foreach($domains as $domain)
<section class="glass-card rounded-xl border border-white/10 p-3">
{{-- Domain-Kopf --}}
<div class="grid grid-cols-1 md:grid-cols-3 items-center gap-3">
{{-- <div--}}
{{-- class="flex items-center gap-1 w-fit px-2 py-0.5 rounded-full text-xs border border-white/15 text-white font-bold bg-white/5">--}}
{{-- <i class="ph ph-globe-hemisphere-east text-[14px]"></i> {{ $domain->domain }}--}}
{{-- </div>--}}
<div class="shrink-0 flex items-center gap-2 flex-wrap md:flex-nowrap">
<div
class="flex items-center gap-1 w-fit px-2 py-0.5 rounded-full text-xs border border-white/15 text-white font-bold bg-white/5">
<i class="ph ph-globe-hemisphere-east text-[14px]"></i> {{ $domain->domain }}
</div>
{{-- <span--}}
{{-- class="px-2 py-0.5 rounded-full text-xs border {{ ($domain->is_active ?? true) ? 'border-emerald-400/30 text-emerald-300 bg-emerald-500/10' : 'border-white/15 text-white/60 bg-white/5' }}">--}}
{{-- {{ ($domain->is_active ?? true) ? 'Aktiv' : 'Inaktiv' }}--}}
{{-- </span>--}}
<span
class="px-2 py-0.5 rounded-full text-xs border border-white/15 text-white/70 bg-white/5 whitespace-nowrap">
{{ $domain->mail_aliases_count ?? $domain->mailAliases_count ?? $domain->mailAliases->count() }} Aliasse
</span>
</div>
<div class="md:col-span-2 text-right space-x-1">
<button
class="inline-flex items-center gap-1.5 rounded-lg border border-white/10 bg-white/5 px-2.5 py-1 text-xs text-white/80 hover:text-white hover:border-white/20"
wire:click="openAliasCreate({{ $domain->id }})">
<i class="ph ph-plus text-[12px]"></i> Alias
</button>
</div>
</div>
{{-- Aliasse --}}
<div class="mt-4 overflow-hidden">
@if($domain->mailAliases->isEmpty())
<div class="px-3 py-3 text-center text-xs bg-white/[0.04] text-white/60 italic">Keine
Aliasse
</div>
@else
<ul class="divide-y divide-white/5 space-y-3">
@foreach($domain->mailAliases as $alias)
<li class="">
<div
class="rounded-xl border border-white/10 flex flex-col md:flex-row md:items-center gap-3 px-3 py-3 bg-white/[0.04]">
{{-- Alias + Badges --}}
<div class="min-w-0 flex-1">
{{-- Pfeil-Zeile --}}
<div
class="text-white/90 font-semibold truncate flex items-center gap-2">
<span
class="truncate text-xs px-2 py-0.5 rounded-md bg-white/5 text-white/80 border border-white/10">{{ $alias->sourceEmail }}</span>
@if($alias->effective_active)
<i class="ph ph-play text-emerald-400 animate-pulse text-xs"></i>
@else
<i class="ph ph-pause text-white/30 text-xs"></i>
@endif
<span
class="truncate text-xs px-2 py-0.5 rounded-md bg-white/5 text-white/80 border border-white/10">{{ $alias->arrowTarget }}</span>
</div>
{{-- Badges --}}
<div class="mt-2 flex items-center gap-2 flex-wrap md:flex-nowrap">
@if(!$alias->effective_active && $alias->inactive_reason)
<span
class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border border-amber-400/30 text-amber-300 bg-amber-500/10 whitespace-nowrap">
{{ $alias->inactive_reason }}
</span>
@else
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border whitespace-nowrap border-emerald-400/30 text-emerald-300 bg-emerald-500/10">
Aktiv
</span>
@endif
@if($alias->isSingle)
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border
border-sky-400/30 text-sky-200 bg-sky-500/10 whitespace-nowrap">
Single
</span>
@else
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border
border-fuchsia-400/30 text-fuchsia-200 bg-fuchsia-500/10 whitespace-nowrap">
Gruppe
</span>
<span
class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border border-white/15 text-white/70 bg-white/5 whitespace-nowrap">
Empfänger: {{ $alias->recipientCount }}
</span>
@endif
@if(!empty($alias->notes))
<span
class="inline-flex items-center px-2 py-0.5 rounded-full text-xs border border-white/15 text-white/60 bg-white/5 whitespace-nowrap">
<i class="ph ph-note text-[12px] mr-1"></i> Notiz
</span>
@endif
</div>
</div>
<hr class="md:hidden">
{{-- Aktionen --}}
<div class="md:ml-3 flex items-center gap-2 md:justify-end">
<button
class="inline-flex items-center gap-1.5 rounded-lg border border-white/10 bg-white/5 px-3 py-1.5 text-xs text-white/80 hover:text-white hover:border-white/20"
wire:click="openAliasEdit({{ $alias->id }})">
<i class="ph ph-pencil-simple text-[12px]"></i> Bearbeiten
</button>
<button
class="inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs bg-rose-500/20 text-rose-200 border border-rose-400/40 hover:bg-rose-500/30"
wire:click="openAliasDelete({{ $alias->id }})">
<i class="ph ph-trash-simple text-[12px]"></i> Löschen
</button>
</div>
</div>
</li>
@endforeach
</ul>
@endif
</div>
</section>
@endforeach
</div>
@else
<div class="rounded-xl border border-white/10 bg-white/[0.04] px-3 py-6 text-white/75 text-center">
Noch keine Aliasse vorhanden.
</div>
@endif
</div>