Files
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

102 lines
6.2 KiB
PHP

<x-admin.partials.page-shell :title="$title" :sidebar="$sidebar">
<section class="rounded-xl bg-white p-4 shadow-[0_8px_12px_rgba(13,10,44,0.04)] lg:p-6">
<div class="flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between">
<div>
<ol class="flex flex-wrap items-center gap-2 text-sm text-[#6B7280]">
<li class="inline-flex items-center gap-2">
<span class="text-[#625DF5]">@include('dashboard.partials.icon', ['icon' => 'home'])</span>
<span>Home</span>
</li>
<li>/</li>
<li class="font-medium text-[#15171A]">{{ $pageTitle }}</li>
</ol>
<h1 class="mt-4 text-[26px] font-bold leading-[34px] text-[#15171A]">{{ $pageTitle }}</h1>
<p class="mt-2 max-w-[880px] text-sm leading-7 text-[#4B5563]">{{ $pageDescription }}</p>
</div>
<div class="flex flex-wrap items-center gap-3">
<div class="rounded-md border border-[#E5E7EB] bg-[#F9FAFB] px-4 py-3 text-sm text-[#15171A]">{{ $pageDate }}</div>
<div class="rounded-md border border-[#E5E7EB] bg-[#F9FAFB] px-4 py-3 text-sm text-[#15171A]">{{ $user['username'] }} · {{ $user['nmprodi'] }}</div>
<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>
</div>
@if (!empty($actions ?? []))
<div class="mt-5 flex flex-wrap gap-3 border-t border-[#E5E7EB] pt-5">
@foreach ($actions as $action)
<a href="{{ $action['href'] }}" class="{{ ($action['variant'] ?? 'light') === 'dark' ? 'rounded-md bg-[#15171A] px-4 py-2.5 text-sm font-medium text-white hover:opacity-90' : 'rounded-md border border-[#D1D5DB] bg-white px-4 py-2.5 text-sm font-medium text-[#15171A] hover:bg-[#F9FAFB]' }}">{{ $action['label'] }}</a>
@endforeach
</div>
@endif
</section>
@if (session('success'))
<div class="rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm text-emerald-800">{{ session('success') }}</div>
@endif
@if (!empty($search ?? false))
<form method="GET" class="rounded-xl border border-[#E5E7EB] bg-white p-5 shadow-[0_8px_12px_rgba(13,10,44,0.04)]">
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto]">
<input name="q" value="{{ $keyword ?? '' }}" placeholder="Cari judul, nama mahasiswa, atau NIM" class="rounded-md border border-[#D1D5DB] px-4 py-3 text-sm focus:border-[#625DF5] focus:outline-none">
<button type="submit" class="rounded-md bg-[#15171A] px-5 py-3 text-sm font-medium text-white hover:opacity-90">Cari</button>
</div>
</form>
@endif
<section class="overflow-hidden rounded-xl border border-[#E5E7EB] bg-white shadow-[0_8px_12px_rgba(13,10,44,0.04)]">
<div class="overflow-x-auto">
<table class="min-w-[900px] w-full text-left text-sm">
<thead class="bg-[#F9FAFB] text-xs uppercase tracking-[0.12em] text-[#6B7280]">
<tr>
<th class="px-4 py-3">No.</th>
@foreach ($columns as $column)
<th class="px-4 py-3">{{ $column }}</th>
@endforeach
@if (!empty($rowActions ?? null))
<th class="px-4 py-3 text-right">Aksi</th>
@endif
</tr>
</thead>
<tbody class="divide-y divide-[#E5E7EB]">
@forelse ($rows as $row)
<tr>
<td class="px-4 py-4 text-[#6B7280]">{{ method_exists($rows, 'currentPage') ? $loop->iteration + ($rows->currentPage() - 1) * $rows->perPage() : $loop->iteration }}</td>
@foreach ($map($row) as $value)
<td class="px-4 py-4 text-[#374151]">{!! is_string($value) ? e($value) : $value !!}</td>
@endforeach
@if (!empty($rowActions ?? null))
<td class="px-4 py-4">
<div class="flex justify-end gap-2 whitespace-nowrap">
@foreach ($rowActions($row) as $action)
@if (($action['method'] ?? 'GET') === 'GET')
<a href="{{ $action['href'] }}" class="rounded-md border border-[#D1D5DB] px-3 py-2 text-xs font-medium text-[#15171A] hover:bg-[#F9FAFB]">{{ $action['label'] }}</a>
@else
<form method="POST" action="{{ $action['href'] }}" onsubmit="return confirm('{{ $action['confirm'] ?? 'Lanjutkan aksi ini?' }}')">
@csrf
@method($action['method'])
<button class="rounded-md bg-rose-600 px-3 py-2 text-xs font-medium text-white hover:opacity-90">{{ $action['label'] }}</button>
</form>
@endif
@endforeach
</div>
</td>
@endif
</tr>
@empty
<tr>
<td colspan="{{ count($columns) + 1 + (!empty($rowActions ?? null) ? 1 : 0) }}" class="px-4 py-8 text-center text-[#6B7280]">Belum ada data.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if (method_exists($rows, 'links'))
<div class="border-t border-[#E5E7EB] px-4 py-3">
{{ $rows->links() }}
</div>
@endif
</section>
</x-admin.partials.page-shell>