fix(qma): resolve dim backdrop stacking on physical unit modals and reorganize p2h and summary menus
This commit is contained in:
@@ -322,9 +322,9 @@
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view']))
|
||||
@can('qma.logs.view')
|
||||
@php
|
||||
$isActivityRoute = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show');
|
||||
$isActivityRoute = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet');
|
||||
@endphp
|
||||
<!-- Dropdown Menu: Log Aktifitas -->
|
||||
<div>
|
||||
@@ -338,9 +338,8 @@
|
||||
<i id="activityChevronDesktop" class="fa-solid fa-chevron-down text-[11px] transition-transform duration-200 {{ $isActivityRoute ? 'rotate-180 text-[#1b5e20]' : 'text-slate-400 group-hover:text-slate-600' }}"></i>
|
||||
</button>
|
||||
|
||||
<!-- Submenu Dropdown: Timesheet LV, History Timesheet Unit Support & P2H Unit Support (Tanpa Icon) -->
|
||||
<!-- Submenu Dropdown: Timesheet LV & History Timesheet Unit Support (Tanpa Icon) -->
|
||||
<div id="activitySubmenuDesktop" class="{{ $isActivityRoute ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1">
|
||||
@can('qma.logs.view')
|
||||
<a href="{{ route('qma.activity.log') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Timesheet LV</span>
|
||||
@@ -350,17 +349,17 @@
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.support_timesheet') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>History Timesheet Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.view')
|
||||
<a href="{{ route('qma.p2h.index') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>P2H Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.view')
|
||||
<a href="{{ route('qma.p2h.index') }}"
|
||||
class="flex items-center space-x-3 px-3.5 py-2.5 text-sm {{ request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
|
||||
<i class="fa-solid fa-clipboard-check text-base w-5 text-center"></i>
|
||||
<span>P2H Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.templates')
|
||||
<a href="{{ route('qma.p2h.templates') }}"
|
||||
@@ -370,13 +369,40 @@
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.summary.view')
|
||||
<a href="{{ route('qma.activity.summary') }}"
|
||||
class="flex items-center space-x-3 px-3.5 py-2.5 text-sm {{ request()->routeIs('qma.activity.summary') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
|
||||
<i class="fa-solid fa-chart-pie text-base w-5 text-center"></i>
|
||||
<span>Summary Aktivitas</span>
|
||||
</a>
|
||||
@endcan
|
||||
@if(auth()->user()->canAny(['qma.summary.view', 'qma.p2h.view']))
|
||||
@php
|
||||
$isSummaryRoute = request()->routeIs('qma.activity.summary*') || request()->routeIs('qma.p2h.summary*');
|
||||
@endphp
|
||||
<!-- Dropdown Menu: Summary Aktivitas -->
|
||||
<div>
|
||||
<button type="button"
|
||||
onclick="toggleSummaryMenu('desktop')"
|
||||
class="w-full flex items-center justify-between px-3.5 py-2.5 text-sm rounded-xl transition group {{ $isSummaryRoute ? 'bg-emerald-50/70 text-[#1b5e20] font-bold' : 'sidebar-item-inactive' }}">
|
||||
<div class="flex items-center space-x-3">
|
||||
<i class="fa-solid fa-chart-pie text-base w-5 text-center {{ $isSummaryRoute ? 'text-[#1b5e20]' : '' }}"></i>
|
||||
<span>Summary Aktivitas</span>
|
||||
</div>
|
||||
<i id="summaryChevronDesktop" class="fa-solid fa-chevron-down text-[11px] transition-transform duration-200 {{ $isSummaryRoute ? 'rotate-180 text-[#1b5e20]' : 'text-slate-400 group-hover:text-slate-600' }}"></i>
|
||||
</button>
|
||||
|
||||
<!-- Submenu Dropdown: Summary Timesheet LV & Summary P2H Unit Support (Tanpa Icon) -->
|
||||
<div id="summarySubmenuDesktop" class="{{ $isSummaryRoute ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1">
|
||||
@can('qma.summary.view')
|
||||
<a href="{{ route('qma.activity.summary') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.summary') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Summary Timesheet LV</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if(auth()->user()->canAny(['qma.p2h.view', 'qma.vehicles.view']))
|
||||
<a href="{{ route('qma.p2h.summary') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.p2h.summary') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Summary P2H Unit Support</span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</nav>
|
||||
</div>
|
||||
@endif
|
||||
@@ -657,9 +683,9 @@
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if(auth()->user()->canAny(['qma.logs.view', 'qma.p2h.view']))
|
||||
@can('qma.logs.view')
|
||||
@php
|
||||
$isActivityRouteMob = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet') || request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show');
|
||||
$isActivityRouteMob = request()->routeIs('qma.activity.log') || request()->routeIs('qma.activity.support_timesheet');
|
||||
@endphp
|
||||
<div>
|
||||
<button type="button"
|
||||
@@ -673,7 +699,6 @@
|
||||
</button>
|
||||
|
||||
<div id="activitySubmenuMobile" class="{{ $isActivityRouteMob ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1">
|
||||
@can('qma.logs.view')
|
||||
<a href="{{ route('qma.activity.log') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.log') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Timesheet LV</span>
|
||||
@@ -683,17 +708,16 @@
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.support_timesheet') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>History Timesheet Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.view')
|
||||
<a href="{{ route('qma.p2h.index') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>P2H Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.view')
|
||||
<a href="{{ route('qma.p2h.index') }}" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-sm {{ request()->routeIs('qma.p2h.index') || request()->routeIs('qma.p2h.show') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
|
||||
<i class="fa-solid fa-clipboard-check w-5 text-center"></i>
|
||||
<span>P2H Unit Support</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.p2h.templates')
|
||||
<a href="{{ route('qma.p2h.templates') }}" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-sm {{ request()->routeIs('qma.p2h.templates*') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
|
||||
@@ -702,12 +726,38 @@
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('qma.summary.view')
|
||||
<a href="{{ route('qma.activity.summary') }}" class="flex items-center space-x-3 px-3 py-2.5 rounded-xl text-sm {{ request()->routeIs('qma.activity.summary') ? 'sidebar-item-active' : 'sidebar-item-inactive' }}">
|
||||
<i class="fa-solid fa-chart-pie w-5 text-center"></i>
|
||||
<span>Summary Aktivitas</span>
|
||||
</a>
|
||||
@endcan
|
||||
@if(auth()->user()->canAny(['qma.summary.view', 'qma.p2h.view']))
|
||||
@php
|
||||
$isSummaryRouteMob = request()->routeIs('qma.activity.summary*') || request()->routeIs('qma.p2h.summary*');
|
||||
@endphp
|
||||
<div>
|
||||
<button type="button"
|
||||
onclick="toggleSummaryMenu('mobile')"
|
||||
class="w-full flex items-center justify-between px-3 py-2.5 text-sm rounded-xl transition group {{ $isSummaryRouteMob ? 'bg-emerald-50/70 text-[#1b5e20] font-bold' : 'sidebar-item-inactive' }}">
|
||||
<div class="flex items-center space-x-3">
|
||||
<i class="fa-solid fa-chart-pie w-5 text-center {{ $isSummaryRouteMob ? 'text-[#1b5e20]' : '' }}"></i>
|
||||
<span>Summary Aktivitas</span>
|
||||
</div>
|
||||
<i id="summaryChevronMobile" class="fa-solid fa-chevron-down text-[11px] transition-transform duration-200 {{ $isSummaryRouteMob ? 'rotate-180 text-[#1b5e20]' : 'text-slate-400 group-hover:text-slate-600' }}"></i>
|
||||
</button>
|
||||
|
||||
<div id="summarySubmenuMobile" class="{{ $isSummaryRouteMob ? '' : 'hidden' }} mt-1 pl-7 pr-1 space-y-1">
|
||||
@can('qma.summary.view')
|
||||
<a href="{{ route('qma.activity.summary') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.activity.summary') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Summary Timesheet LV</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@if(auth()->user()->canAny(['qma.p2h.view', 'qma.vehicles.view']))
|
||||
<a href="{{ route('qma.p2h.summary') }}"
|
||||
class="block px-3.5 py-2 text-xs rounded-xl transition {{ request()->routeIs('qma.p2h.summary') ? 'bg-[#1b5e20] text-white font-bold shadow-sm' : 'text-slate-600 hover:text-slate-900 hover:bg-slate-100 font-medium' }}">
|
||||
<span>Summary P2H Unit Support</span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</nav>
|
||||
</div>
|
||||
@endif
|
||||
@@ -849,7 +899,7 @@
|
||||
@elseif(request()->routeIs('qma.p2h.*'))
|
||||
P2H Unit Support
|
||||
@elseif(request()->routeIs('qma.activity.summary'))
|
||||
Summary Aktivitas
|
||||
Summary Timesheet LV
|
||||
@elseif(request()->routeIs('profile.*'))
|
||||
Profil Saya
|
||||
@elseif(request()->routeIs('pg.dashboard'))
|
||||
@@ -1221,6 +1271,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle Dropdown Menu Summary Aktivitas (Desktop & Mobile)
|
||||
function toggleSummaryMenu(target) {
|
||||
const submenu = document.getElementById(target === 'desktop' ? 'summarySubmenuDesktop' : 'summarySubmenuMobile');
|
||||
const chevron = document.getElementById(target === 'desktop' ? 'summaryChevronDesktop' : 'summaryChevronMobile');
|
||||
if (submenu) {
|
||||
submenu.classList.toggle('hidden');
|
||||
}
|
||||
if (chevron) {
|
||||
chevron.classList.toggle('rotate-180');
|
||||
}
|
||||
}
|
||||
|
||||
// Toggle Dropdown Menu Profil Pengguna di Pojok Kanan Atas
|
||||
function toggleProfileDropdown() {
|
||||
const dropdown = document.getElementById('userProfileDropdownMenu');
|
||||
|
||||
@@ -327,21 +327,18 @@
|
||||
</div>
|
||||
|
||||
<!-- Modal Tambah Unit Baru (Sesuai Referensi Gambar media_1792028135493_30b2da2e.png) -->
|
||||
<div id="addUnitModal" class="fixed inset-0 z-50 hidden overflow-y-auto" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||
<div class="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 transition-opacity bg-slate-900/60 backdrop-blur-xs" aria-hidden="true" onclick="closeAddUnitModal()"></div>
|
||||
<div id="addUnitModal" class="hidden fixed inset-0 z-50 overflow-y-auto" style="display: none;" aria-labelledby="modal-title" role="dialog" aria-modal="true">
|
||||
<div class="fixed inset-0 bg-slate-900/60 backdrop-blur-xs transition-opacity" aria-hidden="true" onclick="closeAddUnitModal()"></div>
|
||||
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
|
||||
<div class="flex min-h-full items-center justify-center p-4">
|
||||
<div class="relative z-10 w-full max-w-lg bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all border border-slate-200 p-6">
|
||||
<!-- Judul Modal -->
|
||||
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight mb-5" id="modal-title">
|
||||
Tambah Unit Baru
|
||||
</h3>
|
||||
|
||||
<div class="inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all sm:my-8 sm:align-middle sm:max-w-md sm:w-full border border-slate-200">
|
||||
<div class="p-6">
|
||||
<!-- Judul Modal -->
|
||||
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight mb-5" id="modal-title">
|
||||
Tambah Unit Baru
|
||||
</h3>
|
||||
|
||||
<form method="POST" action="{{ route('qma.vehicles.support.units.store', $category->id) }}" id="addUnitForm" enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<form method="POST" action="{{ route('qma.vehicles.support.units.store', $category->id) }}" id="addUnitForm" enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-slate-700 mb-1.5">Foto Unit Fisik (Opsional)</label>
|
||||
@@ -508,21 +505,18 @@
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Edit Data Unit Fisik -->
|
||||
<div id="editModal" class="fixed inset-0 z-50 hidden overflow-y-auto" role="dialog" aria-modal="true">
|
||||
<div class="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 transition-opacity bg-slate-900/60 backdrop-blur-xs" onclick="closeEditModal()"></div>
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen">​</span>
|
||||
<div class="inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full border border-slate-200">
|
||||
<div class="p-6">
|
||||
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight mb-5">
|
||||
Edit Data Unit Fisik
|
||||
</h3>
|
||||
<div id="editModal" class="hidden fixed inset-0 z-50 overflow-y-auto" style="display: none;" role="dialog" aria-modal="true">
|
||||
<div class="fixed inset-0 bg-slate-900/60 backdrop-blur-xs transition-opacity" onclick="closeEditModal()"></div>
|
||||
<div class="flex min-h-full items-center justify-center p-4">
|
||||
<div class="relative z-10 w-full max-w-lg bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all border border-slate-200 p-6">
|
||||
<h3 class="text-xl font-extrabold text-slate-900 tracking-tight mb-5">
|
||||
Edit Data Unit Fisik
|
||||
</h3>
|
||||
<form id="editUnitForm" method="POST" action="" enctype="multipart/form-data" class="space-y-4">
|
||||
@csrf
|
||||
<input type="hidden" name="category" value="unit_support">
|
||||
@@ -613,113 +607,106 @@
|
||||
<button type="submit" class="px-5 py-2.5 text-xs font-bold text-white bg-[#1b5e20] hover:bg-[#144919] rounded-xl transition shadow-sm cursor-pointer">Simpan Perubahan</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Detail Unit Fisik -->
|
||||
<div id="detailModal" class="fixed inset-0 z-50 hidden overflow-y-auto" role="dialog" aria-modal="true">
|
||||
<div class="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 transition-opacity bg-slate-900/60 backdrop-blur-xs" onclick="closeDetailModal()"></div>
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen">​</span>
|
||||
<div class="inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all sm:my-8 sm:align-middle sm:max-w-md sm:w-full border border-slate-200">
|
||||
<div class="p-6">
|
||||
<div class="flex items-center justify-between pb-3 border-b border-slate-100">
|
||||
<div>
|
||||
<span class="text-[10px] font-bold uppercase tracking-wider text-slate-400">DETAIL UNIT FISIK</span>
|
||||
<h3 class="text-xl font-extrabold text-slate-900" id="detail_code">-</h3>
|
||||
</div>
|
||||
<button onclick="closeDetailModal()" class="text-slate-400 hover:text-slate-600">
|
||||
<i class="fa-solid fa-xmark text-lg"></i>
|
||||
</button>
|
||||
<div id="detailModal" class="hidden fixed inset-0 z-50 overflow-y-auto" style="display: none;" role="dialog" aria-modal="true">
|
||||
<div class="fixed inset-0 bg-slate-900/60 backdrop-blur-xs transition-opacity" onclick="closeDetailModal()"></div>
|
||||
<div class="flex min-h-full items-center justify-center p-4">
|
||||
<div class="relative z-10 w-full max-w-md bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all border border-slate-200 p-6">
|
||||
<div class="flex items-center justify-between pb-3 border-b border-slate-100">
|
||||
<div>
|
||||
<span class="text-[10px] font-bold uppercase tracking-wider text-slate-400">DETAIL UNIT FISIK</span>
|
||||
<h3 class="text-xl font-extrabold text-slate-900" id="detail_code">-</h3>
|
||||
</div>
|
||||
<button onclick="closeDetailModal()" class="text-slate-400 hover:text-slate-600">
|
||||
<i class="fa-solid fa-xmark text-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="py-4 space-y-3 text-xs">
|
||||
<!-- Foto Unit Fisik di Detail Modal -->
|
||||
<div id="detail_photo_container" class="w-full h-44 rounded-2xl bg-slate-100 border border-slate-200 flex items-center justify-center overflow-hidden relative hidden mb-3">
|
||||
<img id="detail_photo" src="" alt="Foto Unit Fisik" class="w-full h-full object-cover">
|
||||
</div>
|
||||
|
||||
<div class="py-4 space-y-3 text-xs">
|
||||
<!-- Foto Unit Fisik di Detail Modal -->
|
||||
<div id="detail_photo_container" class="w-full h-44 rounded-2xl bg-slate-100 border border-slate-200 flex items-center justify-center overflow-hidden relative hidden mb-3">
|
||||
<img id="detail_photo" src="" alt="Foto Unit Fisik" class="w-full h-full object-cover">
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Kategori Induk:</span>
|
||||
<span class="font-bold text-slate-800">{{ $category->code }} - {{ $category->unit_category }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Merek & Tipe:</span>
|
||||
<span class="font-semibold text-slate-800">{{ $category->brand_type }}</span>
|
||||
</div>
|
||||
@if($category->model_number)
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Nomor Model:</span>
|
||||
<span class="font-mono font-medium text-slate-800">{{ $category->model_number }}</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">No. Seri / Rangka:</span>
|
||||
<span id="detail_serial_number" class="font-mono font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Nomor Polisi / Plat:</span>
|
||||
<span id="detail_plate" class="font-mono font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Tahun Produksi:</span>
|
||||
<span id="detail_year" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Status Operasi:</span>
|
||||
<span id="detail_status" class="font-bold">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Odometer:</span>
|
||||
<span id="detail_km" class="font-mono font-bold text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Lokasi Kerja:</span>
|
||||
<span id="detail_location" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Dokumen SILO:</span>
|
||||
<span id="detail_silo" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Dokumen KIR:</span>
|
||||
<span id="detail_kir" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Kategori Induk:</span>
|
||||
<span class="font-bold text-slate-800">{{ $category->code }} - {{ $category->unit_category }}</span>
|
||||
</div>
|
||||
|
||||
<div class="pt-3 border-t border-slate-100 flex justify-end">
|
||||
<button onclick="closeDetailModal()" class="px-5 py-2 text-xs font-bold text-slate-700 bg-slate-100 hover:bg-slate-200 rounded-xl transition">Tutup</button>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Merek & Tipe:</span>
|
||||
<span class="font-semibold text-slate-800">{{ $category->brand_type }}</span>
|
||||
</div>
|
||||
@if($category->model_number)
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Nomor Model:</span>
|
||||
<span class="font-mono font-medium text-slate-800">{{ $category->model_number }}</span>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">No. Seri / Rangka:</span>
|
||||
<span id="detail_serial_number" class="font-mono font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Nomor Polisi / Plat:</span>
|
||||
<span id="detail_plate" class="font-mono font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Tahun Produksi:</span>
|
||||
<span id="detail_year" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Status Operasi:</span>
|
||||
<span id="detail_status" class="font-bold">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Odometer:</span>
|
||||
<span id="detail_km" class="font-mono font-bold text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Lokasi Kerja:</span>
|
||||
<span id="detail_location" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Dokumen SILO:</span>
|
||||
<span id="detail_silo" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
<div class="flex justify-between py-1.5 border-b border-slate-50">
|
||||
<span class="text-slate-400">Dokumen KIR:</span>
|
||||
<span id="detail_kir" class="font-medium text-slate-800">-</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-3 border-t border-slate-100 flex justify-end">
|
||||
<button onclick="closeDetailModal()" class="px-5 py-2 text-xs font-bold text-slate-700 bg-slate-100 hover:bg-slate-200 rounded-xl transition">Tutup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Hapus Unit Fisik -->
|
||||
<div id="deleteModal" class="fixed inset-0 z-50 hidden overflow-y-auto" role="dialog" aria-modal="true">
|
||||
<div class="flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
||||
<div class="fixed inset-0 transition-opacity bg-slate-900/60 backdrop-blur-xs" onclick="closeDeleteModal()"></div>
|
||||
<span class="hidden sm:inline-block sm:align-middle sm:h-screen">​</span>
|
||||
<div class="inline-block align-bottom bg-white rounded-2xl text-left overflow-hidden shadow-2xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full border border-slate-200">
|
||||
<div class="p-6 text-center">
|
||||
<div class="w-12 h-12 rounded-full bg-rose-100 text-rose-600 flex items-center justify-center mx-auto mb-4">
|
||||
<i class="fa-solid fa-triangle-exclamation text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-slate-900 mb-2">Hapus Unit Fisik?</h3>
|
||||
<p class="text-xs text-slate-500 mb-6">
|
||||
Apakah Anda yakin ingin menghapus unit <span id="deleteUnitCode" class="font-mono font-bold text-slate-800"></span>? Data yang sudah dihapus tidak dapat dipulihkan.
|
||||
</p>
|
||||
<form id="deleteForm" method="POST" action="">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="flex items-center justify-center space-x-3">
|
||||
<button type="button" onclick="closeDeleteModal()" class="px-5 py-2 text-xs font-bold text-slate-700 bg-white border border-slate-300 rounded-xl hover:bg-slate-50 transition cursor-pointer">Batal</button>
|
||||
<button type="submit" class="px-5 py-2 text-xs font-bold text-white bg-rose-600 hover:bg-rose-700 rounded-xl transition shadow-sm cursor-pointer">Ya, Hapus Unit</button>
|
||||
</div>
|
||||
</form>
|
||||
<div id="deleteModal" class="hidden fixed inset-0 z-50 overflow-y-auto" style="display: none;" role="dialog" aria-modal="true">
|
||||
<div class="fixed inset-0 bg-slate-900/60 backdrop-blur-xs transition-opacity" onclick="closeDeleteModal()"></div>
|
||||
<div class="flex min-h-full items-center justify-center p-4">
|
||||
<div class="relative z-10 w-full max-w-sm bg-white rounded-2xl text-center overflow-hidden shadow-2xl transform transition-all border border-slate-200 p-6">
|
||||
<div class="w-12 h-12 rounded-full bg-rose-100 text-rose-600 flex items-center justify-center mx-auto mb-4">
|
||||
<i class="fa-solid fa-triangle-exclamation text-xl"></i>
|
||||
</div>
|
||||
<h3 class="text-lg font-bold text-slate-900 mb-2">Hapus Unit Fisik?</h3>
|
||||
<p class="text-xs text-slate-500 mb-6">
|
||||
Apakah Anda yakin ingin menghapus unit <span id="deleteUnitCode" class="font-mono font-bold text-slate-800"></span>? Data yang sudah dihapus tidak dapat dipulihkan.
|
||||
</p>
|
||||
<form id="deleteForm" method="POST" action="">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="flex items-center justify-center space-x-3">
|
||||
<button type="button" onclick="closeDeleteModal()" class="px-5 py-2 text-xs font-bold text-slate-700 bg-white border border-slate-300 rounded-xl hover:bg-slate-50 transition cursor-pointer">Batal</button>
|
||||
<button type="submit" class="px-5 py-2 text-xs font-bold text-white bg-rose-600 hover:bg-rose-700 rounded-xl transition shadow-sm cursor-pointer">Ya, Hapus Unit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -746,7 +733,9 @@
|
||||
}
|
||||
|
||||
function openAddUnitModal() {
|
||||
document.getElementById('addUnitModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('addUnitModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.style.display = 'block';
|
||||
const addPhotoPreview = document.getElementById('addPhotoPreview');
|
||||
const addPhotoPlaceholder = document.getElementById('addPhotoPlaceholder');
|
||||
const addPhotoInput = document.getElementById('addPhotoInput');
|
||||
@@ -762,7 +751,9 @@
|
||||
}
|
||||
|
||||
function closeAddUnitModal() {
|
||||
document.getElementById('addUnitModal').classList.add('hidden');
|
||||
const modal = document.getElementById('addUnitModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
|
||||
// Live preview kode lengkap
|
||||
@@ -821,11 +812,15 @@
|
||||
if (editPhotoPlaceholder) editPhotoPlaceholder.classList.remove('hidden');
|
||||
}
|
||||
|
||||
document.getElementById('editModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('editModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.style.display = 'block';
|
||||
}
|
||||
|
||||
function closeEditModal() {
|
||||
document.getElementById('editModal').classList.add('hidden');
|
||||
const modal = document.getElementById('editModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
|
||||
function openDetailModal(unit) {
|
||||
@@ -849,22 +844,30 @@
|
||||
if (detailPhotoContainer) detailPhotoContainer.classList.add('hidden');
|
||||
}
|
||||
|
||||
document.getElementById('detailModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('detailModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.style.display = 'block';
|
||||
}
|
||||
|
||||
function closeDetailModal() {
|
||||
document.getElementById('detailModal').classList.add('hidden');
|
||||
const modal = document.getElementById('detailModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
|
||||
function openDeleteModal(id, code) {
|
||||
const form = document.getElementById('deleteForm');
|
||||
form.action = "{{ url('qma/vehicles') }}/" + id;
|
||||
document.getElementById('deleteUnitCode').textContent = code;
|
||||
document.getElementById('deleteModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('deleteModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.style.display = 'block';
|
||||
}
|
||||
|
||||
function closeDeleteModal() {
|
||||
document.getElementById('deleteModal').classList.add('hidden');
|
||||
const modal = document.getElementById('deleteModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
|
||||
Reference in New Issue
Block a user