{{-- Cancellation listing — docs/wireframes-v12/cancellation.html, content region for content region. v12's order, top to bottom: an action row, then ONE card carrying the `.filter-bar` and the `.data-table` — the filters are the card's own header strip (border-bottom), not a card of their own. That is the shape every v12 management page uses, and the shape bookings/index.blade.php already draws. ## Authorised deviations (CR-9 §6.1, §9) * **The four stat cards are dropped** (user decision). The wireframe's strip counts Pending Approval, Approved and Refund Pending, and this application has no approval workflow (decision D3) and no money (decision D8) — three of the four tiles could only be mocked. * **The All Status select is dropped** (client: "Remove All Status drop down"). Every row on this screen is cancelled, so the control would offer seven statuses that filter nothing. * **Six columns, not the wireframe's ten** — the client's own list. See CancellationsDataTable's docblock for which four went and why. * **The search placeholder is adapted**: the wireframe says "Search by Cancel ID, Customer, Booking ID..." and there is no Cancel ID (decision D10 — a cancellation wears its booking's code), so it reads "Search by Booking ID, Customer...", which is exactly what the box reaches. ## No lang file (CR-9 §0.1) Every string on this screen is written here, on the client's instruction. Do not extract them. DataTables drives the table. Its own search box stays out of the dom string because the wireframe's search input in the filter bar is the one the user sees; the wiring below feeds the plugin from it, with the same 300ms debounce and the same preXhr filter parameters the other three listings use. The table markup and its configuration both come from the html builder, so the column list exists in exactly one place: CancellationsDataTable::getColumns(). --}} @extends('layouts.app') @section('title', 'Cancellation Management') @section('breadcrumbs') @endsection @section('content') {{-- v12 puts the primary action on its own row above the listing card, at the right edge, and leaves an empty div on the left. The empty div is kept: `.justify-between` needs two children to push the button right, and the button is gated, so without it a view-only user would get a bare row rather than no row at all. --}}
@can('cancellations.create') Initiate Cancellation @endcan
{{-- The filter bar IS the card's header strip in v12. It is a
here only so Enter does not reload the page; `.filter-bar` is the flex row, so the form element carries it directly. v12 labels none of these controls — a placeholder and an option list are all it draws. The visually-hidden labels are ours and are not a visual change: a select whose only name is its first option is unusable with a screen reader, and two bare date inputs are unusable with one either way. Order is the wireframe's, minus the status select it drew third: search, project, date-from, date-to. --}}
{{-- `table-wrapper` is v12's own scroll box. `table-responsive` rides along because it is Bootstrap's name for the same thing and the one the shared component and its test both use; this screen does not go through that component (v12's card has no card-body around the table) but the two names stay together so a later reader does not read the difference as meaningful. --}}
{{-- yajra's own element. `{!! !!}` because it IS markup; the builder emits a table shell built from getColumns(), and no row data passes through here at all — the rows arrive later as JSON. --}} {!! $dataTable->table(['class' => 'data-table']) !!} @endsection @push('styles') {{-- DataTables is not in the Metronic bundles — plugins.bundle.js carries jQuery and nothing else of the plugin. It is vendored under public/assets/plugins/custom/datatables (see VERSIONS.md there) rather than pulled from a CDN, because a strict CSP is planned. --}} @endpush @push('scripts') {{-- Order is load bearing: jQuery (plugins.bundle.js, already in the layout) → core library → the Bootstrap 5 integration that patches its renderers → yajra's init, which calls $(…).DataTable(…) and would throw without the two above. --}} {{-- yajra's init script — a @endpush