Files
spota-dev/rebuild/resources/views/components/layouts/app.blade.php
Power BI Dev 030bb7c174 Use relative URLs for rebuild forms
Avoid mixed-content form submissions behind Coolify by rendering internal links and form actions as relative paths.
2026-05-03 22:06:46 +07:00

77 lines
4.7 KiB
PHP

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $title ?? 'SPOTA Rebuild' }}</title>
<meta name="description" content="Rebuild modern SPOTA Universitas Tanjungpura dengan Laravel Blade dan Tailwind.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
@php
$viteManifestPath = public_path('build/manifest.json');
$viteManifest = file_exists($viteManifestPath) ? json_decode(file_get_contents($viteManifestPath), true) : [];
$viteCss = $viteManifest['resources/css/app.css']['file'] ?? null;
$viteJs = $viteManifest['resources/js/app.js']['file'] ?? null;
@endphp
@if ($viteCss && $viteJs)
<link rel="stylesheet" href="/build/{{ $viteCss }}">
<script type="module" src="/build/{{ $viteJs }}"></script>
@else
@vite(['resources/css/app.css', 'resources/js/app.js'])
@endif
</head>
<body class="min-h-screen bg-white font-[Inter] text-[#374151] antialiased">
@php
$legacyAuth = session('legacy_auth');
$legacyRole = $legacyAuth['role'] ?? null;
$spotaLogoUrl = route('assets.spota-logo', [], false);
$dashboardRoute = match ($legacyRole) {
'mahasiswa' => route('dashboard.mahasiswa', [], false),
'dosen' => route('dashboard.dosen', [], false),
default => null,
};
$isDashboardShell = isset($dashboardLayout) && $dashboardLayout === true;
@endphp
<div class="min-h-screen">
<header class="fixed left-0 top-0 z-40 w-full border-b border-[#E5E7EB] bg-white">
<div class="mx-auto flex max-w-[1400px] items-center justify-between px-4 py-4 sm:px-6 xl:px-8 lg:relative">
<div class="flex w-full items-center justify-between lg:w-3/12">
<a href="{{ route('home', [], false) }}" class="inline-flex items-center">
<img src="{{ $spotaLogoUrl }}" alt="SPOTA" class="h-11 w-auto max-w-[180px] object-contain">
</a>
</div>
<div class="hidden w-full items-center justify-between lg:flex lg:w-9/12">
@if (! $isDashboardShell)
<nav>
<ul class="flex items-center gap-10 text-sm text-[#374151]">
<li><a href="{{ route('home', [], false) }}" class="hover:text-[#15171A]">Beranda</a></li>
<li><a href="{{ route('role-login', [], false) }}" class="hover:text-[#15171A]">Pilih Akun</a></li>
<li><a href="{{ route('legacy.login', 'mahasiswa', false) }}" class="hover:text-[#15171A]">Mahasiswa</a></li>
<li><a href="{{ route('legacy.login', 'dosen', false) }}" class="hover:text-[#15171A]">Dosen</a></li>
</ul>
</nav>
@else
<div class="text-sm text-[#5C6A78]">
{{ $legacyAuth['user']['nama_lengkap'] ?? 'Pengguna' }}
</div>
@endif
@if ($dashboardRoute && $isDashboardShell)
<div class="flex items-center gap-3">
<a href="{{ route('role-login', [], false) }}" class="rounded-md border border-[#E5E7EB] bg-white px-5.5 py-2.5 text-sm font-medium text-[#15171A] hover:bg-[#F3F4F6]">Portal</a>
<form method="POST" action="{{ route('legacy.logout', [], false) }}">
@csrf
<button type="submit" class="rounded-md bg-[#15171A] px-5.5 py-2.5 text-sm font-medium text-white hover:opacity-90">Logout</button>
</form>
</div>
@else
<a href="{{ route('legacy.login', 'mahasiswa', false) }}" class="rounded-md bg-[#15171A] px-5.5 py-2.5 text-sm font-medium text-white hover:opacity-90">Masuk</a>
@endif
</div>
</div>
</header>
{{ $slot }}
</div>
</body>
</html>