Files
spota-dev/rebuild/resources/views/admin/pages/resource-form.blade.php
Power BI Dev dab8ea396b Deploy Laravel rebuild via Coolify
Point Docker and Coolify compose to the Laravel rebuild app so mahasiswa, dosen, and admin flows are served from the new Laravel public entrypoint.
2026-05-03 18:50:29 +07:00

60 lines
3.8 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="rounded-md border border-[#E5E7EB] bg-[#F9FAFB] px-4 py-3 text-sm text-[#15171A]">{{ $user['username'] }} · {{ $user['nmprodi'] }}</div>
</div>
</section>
@if ($errors->any())
<div class="rounded-xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">
<p class="font-semibold">Form belum bisa disimpan.</p>
<ul class="mt-2 list-disc space-y-1 pl-5">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<form method="POST" action="{{ $action }}" class="rounded-xl border border-[#E5E7EB] bg-white p-6 shadow-[0_8px_12px_rgba(13,10,44,0.04)]">
@csrf
@if (($method ?? 'POST') !== 'POST')
@method($method)
@endif
<div class="grid gap-5 lg:grid-cols-2">
@foreach ($fields as $field)
<div class="{{ ($field['type'] ?? 'text') === 'textarea' ? 'lg:col-span-2' : '' }}">
<label class="text-sm font-semibold text-[#15171A]">{{ $field['label'] }}</label>
@if (($field['type'] ?? 'text') === 'select')
<select name="{{ $field['name'] }}" class="mt-2 w-full rounded-md border border-[#D1D5DB] px-4 py-3 text-sm">
@foreach ($field['options'] as $value => $label)
<option value="{{ $value }}" @selected((string) old($field['name'], $field['value'] ?? '') === (string) $value)>{{ $label }}</option>
@endforeach
</select>
@elseif (($field['type'] ?? 'text') === 'textarea')
<textarea name="{{ $field['name'] }}" rows="7" class="mt-2 w-full rounded-md border border-[#D1D5DB] px-4 py-3 text-sm focus:border-[#625DF5] focus:outline-none">{{ old($field['name'], $field['value'] ?? '') }}</textarea>
@else
<input type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" value="{{ old($field['name'], $field['value'] ?? '') }}" class="mt-2 w-full rounded-md border border-[#D1D5DB] px-4 py-3 text-sm focus:border-[#625DF5] focus:outline-none" @if(!empty($field['required'])) required @endif>
@endif
@if (!empty($field['help']))
<p class="mt-2 text-xs leading-5 text-[#6B7280]">{{ $field['help'] }}</p>
@endif
</div>
@endforeach
</div>
<div class="mt-6 flex flex-wrap gap-3 border-t border-[#E5E7EB] pt-5">
<button class="rounded-md bg-[#15171A] px-5 py-2.5 text-sm font-medium text-white hover:opacity-90">Simpan</button>
<a href="{{ $cancel }}" class="rounded-md border border-[#D1D5DB] bg-white px-5 py-2.5 text-sm font-medium text-[#15171A] hover:bg-[#F9FAFB]">Batal</a>
</div>
</form>
</x-admin.partials.page-shell>