fix: enhance button accessibility for non-admin users in modal foto

This commit is contained in:
LailaWulandarii 2026-02-25 05:02:06 +07:00
parent 8608a7f4fa
commit 706064056a
1 changed files with 40 additions and 13 deletions

View File

@ -108,21 +108,48 @@ class="badge {{ $p->status_label->class }}">
</div>
<div class="modal-footer border-top-0 pt-2 px-2">
<div class="d-flex w-100 gap-2">
@php
$hasAccess = Auth::user()->role == 'admin_foto' || Auth::user()->role == 'pemilik';
@endphp
@if ($p->status_booking == 'menunggu_verifikasi')
@if ($hasAccess)
<button type="button" class="btn btn-danger flex-fill tolak"
onclick="prosesFoto(this, 'tolak', '{{ $p->id_booking }}', 'foto')">
Tolak Pesanan
</button>
@else
<button type="button" class="btn btn-danger flex-fill tolak disabled"
style="cursor: not-allowed !important; pointer-events: auto !important; opacity: 0.5;"
title="Hanya Admin Foto dan Pemilik yang dapat menolak pesanan ini">
Tolak Pesanan
</button>
@endif
@if ($hasAccess)
<button type="button" class="btn btn-success flex-fill terima"
onclick="prosesFoto(this, 'terima', '{{ $p->id_booking }}', 'foto')">
Terima Pesanan
</button>
@elseif ($p->status_booking == 'diterima')
@else
<button type="button" class="btn btn-success flex-fill terima disabled"
style="cursor: not-allowed !important; pointer-events: auto !important; opacity: 0.5;"
title="Hanya Admin Foto dan Pemilik yang dapat menerima pesanan ini">
Terima Pesanan
</button>
@endif
@elseif ($p->status_transaksi == 'diterima')
@if ($hasAccess)
<button type="button" class="btn btn-primary flex-fill terima"
onclick="prosesFoto(this, 'selesai', '{{ $p->id_booking }}', 'foto')">
Selesaikan Pesanan
</button>
@else
<button type="button" class="btn btn-primary flex-fill terima disabled"
style="cursor: not-allowed !important; pointer-events: auto !important; opacity: 0.5;"
title="Hanya Admin Foto dan Pemilik yang dapat menyelesaikan pesanan ini">
Selesaikan Pesanan
</button>
@endif
@endif
</div>
</div>