Files
verifikator/resources/views/layouts/topbar.blade.php
T

104 lines
7.6 KiB
PHP

<header id="main-topbar" class="sticky top-0 z-30 bg-white/95 backdrop-blur-md border-b border-slate-200 h-16 flex items-center justify-between px-3 sm:px-5 shadow-xs">
<!-- Kiri: Tombol Toggle Menu Navigasi -->
<div class="flex items-center gap-2">
<button id="sidebar-toggle-btn" type="button" class="inline-flex items-center justify-center w-9.5 h-9.5 rounded-xl bg-slate-50 hover:bg-blue-600 text-slate-600 hover:text-white border border-slate-200 hover:border-blue-600 shadow-2xs hover:shadow-md hover:shadow-blue-600/20 transition-all duration-200 active:scale-95 focus:outline-none cursor-pointer group" title="Buka / Tutup Menu Navigasi" aria-label="Toggle navigation">
<i class="mdi mdi-menu text-xl transition-transform group-hover:scale-110"></i>
</button>
</div>
<!-- Tengah: Running Text Announcement (Responsif Mengisi Seluruh Ruang Layar) -->
<div class="hidden md:flex flex-1 min-w-0 mx-3 sm:mx-6 bg-slate-50/90 border border-slate-200/90 rounded-full py-1.5 px-3.5 shadow-2xs items-center gap-2.5 overflow-hidden">
<span class="inline-flex items-center gap-1.5 bg-blue-600 text-white text-[10px] font-extrabold px-2.5 py-0.5 rounded-full shrink-0 uppercase tracking-wider shadow-2xs">
<i class="mdi mdi-bullhorn-outline text-xs animate-pulse"></i>
<span>Pengumuman</span>
</span>
<div class="topbar-marquee-container flex-1 min-w-0">
<div class="topbar-marquee-text text-xs font-semibold text-slate-700">
Selamat Datang di Sistem Verifikasi Remunerasi Universitas Tanjungpura &bull; Pastikan dokumen verifikasi diperiksa dengan cermat sesuai SK dan Rubrik Remunerasi &bull; Kendala teknis dapat dilaporkan melalui Pusat Bantuan Helpdesk &bull;
</div>
</div>
</div>
<!-- Kanan: Tim Aktif & Profil Pengguna -->
<div class="flex items-center gap-3 shrink-0">
@php
$activeTeam = App\Models\Verifikator\Team::find(session('team_id'));
$userTeamsCount = Auth::user() ? Auth::user()->teams()->count() : 0;
@endphp
<!-- Indikator Tim Aktif -->
@if($userTeamsCount > 1)
<button type="button" class="btn-trigger-change-team hidden sm:inline-flex items-center gap-2 bg-blue-50/80 hover:bg-blue-100/80 border border-blue-200 text-blue-900 text-xs font-bold px-3.5 py-1.5 rounded-full transition shadow-2xs h-9 group" id="btnChangeTeamTopbar" title="Klik untuk mengganti Team Verifikator">
<i class="mdi mdi-shield-check text-blue-600 text-base"></i>
<span class="max-w-[130px] truncate text-slate-800 font-bold">{{ $activeTeam->nama ?? 'General' }}</span>
<span class="bg-blue-600 group-hover:bg-blue-700 text-white text-[10px] font-extrabold px-1.5 py-0.5 rounded-full">Ganti</span>
</button>
@elseif($activeTeam)
<div class="hidden sm:inline-flex items-center gap-2 bg-slate-50 border border-slate-200 text-slate-800 text-xs font-bold px-3.5 py-1.5 rounded-full h-9" title="Team Aktif">
<i class="mdi mdi-shield-check text-blue-600 text-base"></i>
<span class="max-w-[130px] truncate">{{ $activeTeam->nama }}</span>
</div>
@endif
<!-- Profil Pengguna Dropdown -->
<div class="dropdown relative notification-list" id="user-menu-dropdown-wrapper">
<button type="button" class="dropdown-toggle arrow-none flex items-center gap-2.5 py-1 px-2.5 sm:px-3 rounded-full bg-slate-50 hover:bg-blue-50/80 border border-slate-200 hover:border-blue-200/80 shadow-2xs hover:shadow-xs transition-all duration-200 focus:outline-hidden cursor-pointer h-9 shrink-0 group" data-bs-toggle="dropdown" aria-haspopup="false" aria-expanded="false" id="user-menu-btn">
<div class="relative w-6.5 h-6.5 rounded-full overflow-hidden ring-2 ring-blue-500/20 group-hover:ring-blue-500/40 shrink-0 transition">
<img src="{{ asset('assets/images/users/avatar-1.png') }}" alt="{{ Auth::user()->name ?? 'User' }}" class="w-full h-full object-cover">
</div>
<div class="hidden md:flex flex-col text-left justify-center min-w-0">
<span class="text-xs font-bold text-slate-800 group-hover:text-blue-600 leading-none mb-0.5 truncate max-w-[120px] transition-colors">{{ Auth::user()->name ?? 'Pengguna' }}</span>
<span class="text-[10px] font-semibold text-slate-400 leading-none truncate max-w-[120px]">{{ Auth::user()->nip ?? Auth::user()->username ?? 'User' }}</span>
</div>
<i class="mdi mdi-chevron-down text-slate-400 group-hover:text-blue-600 transition text-sm ms-0.5"></i>
</button>
<!-- Dropdown Menu Card -->
<div class="dropdown-menu dropdown-menu-end dropdown-menu-animated topbar-dropdown-menu profile-dropdown shadow-xl border border-slate-200 rounded-xl py-1.5 z-50 text-slate-700 text-sm" id="user-menu-dropdown">
<!-- Header Info Pengguna -->
<div class="px-4 py-2 border-b border-slate-100 bg-slate-50/50">
<h6 class="text-overflow m-0 text-dark fw-bold text-sm">{{ Auth::user()->name ?? 'Pengguna' }}</h6>
<small class="text-muted font-monospace text-xs">{{ Auth::user()->nip ?? '' }}</small>
</div>
<!-- Item Profil -->
<a href="{{ route('profil.index') }}" class="dropdown-item notify-item flex items-center gap-2.5 px-4 py-2 hover:bg-blue-50 hover:text-blue-600 transition font-medium">
<i class="mdi mdi-account-circle-outline text-lg text-slate-400"></i>
<span>Profil Saya</span>
</a>
<!-- Item Khusus Superuser -->
@role('Superuser')
<a href="{{ route('lainnya.index') }}" class="dropdown-item notify-item flex items-center gap-2.5 px-4 py-2 hover:bg-blue-50 hover:text-blue-600 transition font-medium">
<i class="mdi mdi-cog-outline text-lg text-slate-400"></i>
<span>Menu Lainnya</span>
</a>
@endrole
<!-- Tombol Ganti Team -->
@if($userTeamsCount > 1)
<a href="javascript:void(0);" class="dropdown-item notify-item btn-trigger-change-team flex items-center gap-2.5 px-4 py-2 hover:bg-blue-50 text-blue-600 transition font-semibold" id="btnChangeTeamDropdown">
<i class="mdi mdi-account-switch-outline text-lg text-blue-600"></i>
<span>Ganti Team</span>
</a>
@endif
<div class="dropdown-divider my-1 border-t border-slate-100"></div>
<!-- Item Logout -->
@if(config('app.login_mode') === 2)
<a href="{{ route('logout') }}" class="dropdown-item notify-item text-danger flex items-center gap-2.5 px-4 py-2 text-red-600 hover:bg-red-50 transition font-semibold">
<i class="mdi mdi-home-export-outline text-lg text-red-600"></i>
<span>Kembali ke Portal</span>
</a>
@else
<a href="{{ route('logout') }}" class="dropdown-item notify-item text-danger flex items-center gap-2.5 px-4 py-2 text-red-600 hover:bg-red-50 transition font-semibold">
<i class="mdi mdi-logout-variant text-lg text-red-600"></i>
<span>Keluar (Logout)</span>
</a>
@endif
</div>
</div>
</div>
</header>