Skip to content

A free open source IT asset/license management system

First pass on existing modal blade components

snipe85de8e7cd828
diff --git a/resources/views/blade/form/stacked.blade.php b/resources/views/blade/form/stacked.blade.php
new file mode 100644
index 0000000000..11eb91ac0b
--- /dev/null
+++ b/resources/views/blade/form/stacked.blade.php
@@ -0,0 +1,14 @@
+{{-- Vertical form-group wrapper for stacked-form contexts (modals, filter
+ bars, anywhere the parent form isn't .form-horizontal). Use x-form.row
+ when the parent form is .form-horizontal and you want the full col-md-3
+ label + col-md-7 input grid layout. --}}
+@props([
+ 'name' => null,
+])
+
+<div {{ $attributes->class([
+ 'form-group',
+ 'has-error' => $name && $errors->has($name),
+]) }}>
+ {{ $slot }}
+</div>
diff --git a/resources/views/blade/modals/adjust-quantity.blade.php b/resources/views/blade/modals/adjust-quantity.blade.php
index d140a41882..b2e5127cc8 100644
--- a/resources/views/blade/modals/adjust-quantity.blade.php
+++ b/resources/views/blade/modals/adjust-quantity.blade.php
@@ -1,174 +1,164 @@
-<div class="modal fade" id="adjustQuantityModal" tabindex="-1" role="dialog" aria-labelledby="adjustQuantityModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('button.close') }}">
- <span aria-hidden="true">&times;</span></button>
- <h4 class="modal-title" id="adjustQuantityModalLabel">
- {{ trans('general.adjust_quantity') }}
- <small class="adjust-quantity-item-name text-muted"></small>
- </h4>
- </div>
- <form id="adjustQuantityForm" method="POST" action="" enctype="multipart/form-data">
- @csrf
- <div class="modal-body">
- <p>
- {{ trans('general.available') }}:
- <strong class="adjust-quantity-available"></strong>
- </p>
+{{-- Action URL is set per-click by snipeit.js from the trigger button's
+ data-adjust-url. See snipeit_modals.js's .adjust-quantity delegated
+ handler. --}}
+<x-modals
+ id="adjustQuantityModal"
+ form_attrs='id="adjustQuantityForm" enctype="multipart/form-data"'
+>
+ <x-slot:header>
+ <h4 class="modal-title" id="adjustQuantityModalLabel">
+ {{ trans('general.adjust_quantity') }}
+ <small class="adjust-quantity-item-name text-muted"></small>
+ </h4>
+ </x-slot:header>
- <div class="form-group">
- <label for="adjustQuantityAmount">{{ trans('general.adjust_quantity_amount') }}</label>
- {{-- min is populated by snipeit.js when the modal opens (–available). The
- browser stepper then refuses to go below and the built-in
- constraint-validation message surfaces if a user types past it.
- Zero is a valid input: it produces an audit-only QuantityAdjust
- log entry with no qty change so users can record a physical
- count against the current DB value. --}}
- <input type="number" class="form-control" id="adjustQuantityAmount" name="amount" step="1" required>
- <p class="help-block">{{ trans('general.adjust_quantity_amount_help') }}</p>
- </div>
+ <p>
+ {{ trans('general.available') }}:
+ <strong class="adjust-quantity-available"></strong>
+ </p>
- {{-- Acquisition-only fields (order_number, supplier,
- unit cost, currency). Shown for positive qty
- changes and hidden by snipeit.js when the amount
- is 0 or negative — those cases are corrections
- or losses rather than purchases, so purchase
- metadata doesn't apply. --}}
- <div id="adjustQuantityAcquisitionFields">
- <div class="form-group">
- <label for="adjustQuantityOrder">{{ trans('general.order_number') }}</label>
- <input type="text" class="form-control" id="adjustQuantityOrder" name="order_number" maxlength="191">
- </div>
+ <x-form.stacked name="amount">
+ <label for="adjustQuantityAmount">{{ trans('general.adjust_quantity_amount') }}</label>
+ {{-- min is populated by snipeit.js when the modal opens (–available). The
+ browser stepper then refuses to go below and the built-in
+ constraint-validation message surfaces if a user types past it.
+ Zero is a valid input: it produces an audit-only QuantityAdjust
+ log entry with no qty change so users can record a physical
+ count against the current DB value. --}}
+ <input type="number" class="form-control" id="adjustQuantityAmount" name="amount" step="1" required>
+ <x-form.help name="adjustQuantityAmount">{{ trans('general.adjust_quantity_amount_help') }}</x-form.help>
+ </x-form.stacked>
- {{-- Inlined js-data-ajax select instead of <x-input.supplier-select>
- for the same reason the file-upload input is inlined below: the
- shared component uses a Bootstrap 3 horizontal-form scaffold
- (col-md-3 label + col-md-7 input) that collides with the
- modal-footer top border. snipeit.js auto-initializes any
- .js-data-ajax select. --}}
- <div class="form-group">
- <label for="adjustQuantitySupplier">{{ trans('general.supplier') }}</label>
- <select
- class="js-data-ajax form-control"
- data-endpoint="suppliers"
- data-placeholder="{{ trans('general.select_supplier') }}"
- name="supplier_id"
- id="adjustQuantitySupplier"
- style="width: 100%"
- aria-label="{{ trans('general.supplier') }}"
- >
- <option value=""></option>
- </select>
- </div>
- </div>
+ {{-- Acquisition-only fields (order_number, supplier, unit cost,
+ currency). Shown for positive qty changes and hidden by snipeit.js
+ when the amount is 0 or negative. Those cases are corrections or
+ losses rather than purchases, so purchase metadata doesn't apply. --}}
+ <div id="adjustQuantityAcquisitionFields">
+ <x-form.stacked name="order_number">
+ <label for="adjustQuantityOrder">{{ trans('general.order_number') }}</label>
+ <input type="text" class="form-control" id="adjustQuantityOrder" name="order_number" maxlength="191">
+ </x-form.stacked>
- <div class="form-group">
- {{-- Label swaps between "Purchase Date" (positive qty)
- and "Date" (0 or negative) via snipeit.js. --}}
- <label
- for="adjustQuantityPurchaseDate"
- id="adjustQuantityPurchaseDateLabel"
- data-label-purchase="{{ trans('general.purchase_date') }}"
- data-label-generic="{{ trans('general.date') }}"
- >{{ trans('general.purchase_date') }}</label>
- {{-- Pre-populated with today's date because most --}}
- {{-- adjust events happen the day they are recorded. --}}
- {{-- Editable, and snipeit.js resets to today on --}}
- {{-- every modal open so a stale date can't bleed --}}
- {{-- across sessions. --}}
- <x-input.datepicker
- id="adjustQuantityPurchaseDate"
- name="purchase_date"
- :value="now()->toDateString()"
- :end_date="'0d'"
- />
- </div>
+ {{-- Inlined js-data-ajax select instead of x-input.supplier-select
+ because that component wraps its markup in x-form.row's
+ horizontal-form scaffold (col-md-3 label + col-md-7 input),
+ which fights the stacked form-group layout used across this
+ modal. snipeit.js auto-initializes any .js-data-ajax select. --}}
+ <x-form.stacked name="supplier_id">
+ <label for="adjustQuantitySupplier">{{ trans('general.supplier') }}</label>
+ <select
+ class="js-data-ajax form-control"
+ data-endpoint="suppliers"
+ data-placeholder="{{ trans('general.select_supplier') }}"
+ name="supplier_id"
+ id="adjustQuantitySupplier"
+ style="width: 100%"
+ aria-label="{{ trans('general.supplier') }}"
+ >
+ <option value=""></option>
+ </select>
+ </x-form.stacked>
+ </div>
+
+ <x-form.stacked name="purchase_date">
+ {{-- Label swaps between "Purchase Date" (positive qty)
+ and "Date" (0 or negative) via snipeit.js. --}}
+ <label
+ for="adjustQuantityPurchaseDate"
+ id="adjustQuantityPurchaseDateLabel"
+ data-label-purchase="{{ trans('general.purchase_date') }}"
+ data-label-generic="{{ trans('general.date') }}"
+ >{{ trans('general.purchase_date') }}</label>
+ {{-- Pre-populated with today's date because most
+ adjust events happen the day they are recorded.
+ Editable, and snipeit.js resets to today on
+ every modal open so a stale date can't bleed
+ across sessions. --}}
+ <x-input.datepicker
+ id="adjustQuantityPurchaseDate"
+ name="purchase_date"
+ :value="now()->toDateString()"
+ :end_date="'0d'"
+ />
+ </x-form.stacked>
- {{-- Unit cost + currency side by side. Bootstrap 3
- input-group doesn't handle a form-control addon
- cleanly (the addon slot expects a span, not a
- second input), so this uses a plain row / col
- split instead. Currency is editable and left
- blank on open — pre-filling with the system
- default would assert info we don't have per
- event (Snipe-IT's historical currency handling
- is squishy already). Placeholder hints at the
- system default without stamping it. --}}
- <div class="row" id="adjustQuantityCostRow">
- <div class="col-md-8 form-group" style="padding-right: 5px;">
- <label for="adjustQuantityUnitCost">{{ trans('general.unit_cost') }}</label>
- <input
- type="number"
- class="form-control"
- id="adjustQuantityUnitCost"
- name="unit_cost"
- step="0.0001"
- min="0"
- inputmode="decimal"
- >
- </div>
- <div class="col-md-4 form-group" style="padding-left: 5px;">
- <label for="adjustQuantityCurrency">{{ trans('general.currency') }}</label>
- <input
- type="text"
- class="form-control"
- id="adjustQuantityCurrency"
- name="currency"
- maxlength="10"
- placeholder="{{ $snipeSettings->default_currency }}"
- >
- </div>
- </div>
- {{-- Shown by snipeit.js when the modal opens with --}}
- {{-- pre-populated cost/currency from the trigger's --}}
- {{-- data-last-* attrs. Hidden as soon as the user --}}
- {{-- edits either field, so it disappears the moment --}}
- {{-- the pre-fill stops being authoritative. --}}
- <p class="help-block" id="adjustQuantityCostHint" style="display: none; margin-top: -5px;">
- {{ trans('general.adjust_quantity_prefilled_from_last_order') }}
- </p>
+ {{-- Unit cost + currency side by side. Bootstrap 3
+ input-group doesn't handle a form-control addon
+ cleanly (the addon slot expects a span, not a
+ second input), so this uses a plain row / col
+ split instead. Currency is editable and left
+ blank on open. Pre-filling with the system
+ default would assert info we don't have per
+ event (Snipe-IT's historical currency handling
+ is squishy already). Placeholder hints at the
+ system default without stamping it. --}}
+ <div class="row" id="adjustQuantityCostRow">
+ <x-form.stacked name="unit_cost" class="col-md-8" style="padding-right: 5px;">
+ <label for="adjustQuantityUnitCost">{{ trans('general.unit_cost') }}</label>
+ <input
+ type="number"
+ class="form-control"
+ id="adjustQuantityUnitCost"
+ name="unit_cost"
+ step="0.0001"
+ min="0"
+ inputmode="decimal"
+ >
+ </x-form.stacked>
+ <x-form.stacked name="currency" class="col-md-4" style="padding-left: 5px;">
+ <label for="adjustQuantityCurrency">{{ trans('general.currency') }}</label>
+ <input
+ type="text"
+ class="form-control"
+ id="adjustQuantityCurrency"
+ name="currency"
+ maxlength="10"
+ placeholder="{{ $snipeSettings->default_currency }}"
+ >
+ </x-form.stacked>
+ </div>
+ {{-- Shown by snipeit.js when the modal opens with pre-populated
+ cost/currency from the trigger's data-last-* attrs. Hidden as
+ soon as the user edits either field, so it disappears the moment
+ the pre-fill stops being authoritative. Custom id overrides
+ x-form.help's default "{name}-help" id via the attributes merge
+ because snipeit.js queries this exact id. --}}
+ <x-form.help name="adjustQuantityCost" id="adjustQuantityCostHint" style="display: none; margin-top: -5px;">
+ {{ trans('general.adjust_quantity_prefilled_from_last_order') }}
+ </x-form.help>
- <div class="form-group">
- <label for="adjustQuantityNote">{{ trans('general.notes') }}</label>
- <textarea class="form-control" id="adjustQuantityNote" name="note" rows="3" maxlength="65535" required></textarea>
- </div>
+ <x-form.stacked name="note">
+ <label for="adjustQuantityNote">{{ trans('general.notes') }}</label>
+ <textarea class="form-control" id="adjustQuantityNote" name="note" rows="3" maxlength="65535" required></textarea>
+ </x-form.stacked>
- {{-- Inlined instead of <x-input.file-upload> because that
- component wraps its markup in <x-form.row>, a Bootstrap 3
- horizontal-form scaffold (col-md-3 label + col-md-9
- input). The three fields above use vertical form-group
- styling, so the horizontal scaffold collided with the
- modal-footer top border. --}}
- <div class="form-group">
- <label for="adjustQuantityFile">{{ trans('general.file_upload') }}</label>
- <div>
- <label class="btn btn-sm btn-theme" for="adjustQuantityFile">
- {{ trans('button.select_file') }}
- <input
- type="file"
- name="file"
- class="js-uploadFile"
- id="adjustQuantityFile"
- data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}"
- accept="{{ config('filesystems.allowed_upload_mimetypes') }}"
- style="display:none"
- aria-label="file"
- aria-hidden="true"
- >
- </label>
- <span id="adjustQuantityFile-info"></span>
- <p class="help-block" id="adjustQuantityFile-status">
- {{ trans('general.upload_filetypes_help', ['allowed_filetypes' => config('filesystems.allowed_upload_extensions'), 'size' => \App\Helpers\Helper::file_upload_max_size_readable()]) }}
- </p>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
- <button type="submit" class="btn btn-primary pull-right">{{ trans('general.save') }}</button>
- </div>
- </form>
+ {{-- Inlined instead of x-input.file-upload because that
+ component wraps its markup in x-form.row, a Bootstrap 3
+ horizontal-form scaffold (col-md-3 label + col-md-9
+ input). The three fields above use vertical form-group
+ styling, so the horizontal scaffold collided with the
+ modal-footer top border. --}}
+ <x-form.stacked name="file">
+ <label for="adjustQuantityFile">{{ trans('general.file_upload') }}</label>
+ <div>
+ <label class="btn btn-sm btn-theme" for="adjustQuantityFile">
+ {{ trans('button.select_file') }}
+ <input
+ type="file"
+ name="file"
+ class="js-uploadFile"
+ id="adjustQuantityFile"
+ data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}"
+ accept="{{ config('filesystems.allowed_upload_mimetypes') }}"
+ style="display:none"
+ aria-label="file"
+ aria-hidden="true"
+ >
+ </label>
+ <span id="adjustQuantityFile-info"></span>
+ <x-form.help name="adjustQuantityFile">
+ {{ trans('general.upload_filetypes_help', ['allowed_filetypes' => config('filesystems.allowed_upload_extensions'), 'size' => \App\Helpers\Helper::file_upload_max_size_readable()]) }}
+ </x-form.help>
</div>
- </div>
-</div>
+ </x-form.stacked>
+</x-modals>
diff --git a/resources/views/blade/modals/index.blade.php b/resources/views/blade/modals/index.blade.php
new file mode 100644
index 0000000000..4ae55c04f3
--- /dev/null
+++ b/resources/views/blade/modals/index.blade.php
@@ -0,0 +1,60 @@
+@props([
+ 'id' => null,
+ 'title' => null,
+ 'action' => null,
+ 'ajax' => false,
+ 'submit_label' => null,
+ 'submit_class' => 'btn-primary',
+ 'labelledby' => null,
+ 'form_attrs' => '',
+ 'form_class' => null,
+])
+
+@php
+ $submitLabel = $submit_label ?? trans('general.save');
+ $labelledById = $labelledby ?? ($id ? $id.'Label' : null);
+ $onsubmit = $ajax ? ' onsubmit="return false"' : '';
+ $saveButtonAttrs = $ajax ? ' type="button" id="modal-save"' : ' type="submit"';
+@endphp
+
+@if ($id)
+<div class="modal fade" id="{{ $id }}" tabindex="-1" role="dialog" @if ($labelledById) aria-labelledby="{{ $labelledById }}" @endif aria-hidden="true">
+@endif
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('button.close') }}">
+ <span aria-hidden="true">&times;</span>
+ </button>
+ @isset($header)
+ {{ $header }}
+ @else
+ <h4 class="modal-title" @if ($labelledById) id="{{ $labelledById }}" @endif>{{ $title }}</h4>
+ @endisset
+ </div>
+
+ <form action="{{ $action }}" method="POST" @if ($form_class) class="{{ $form_class }}" @endif{!! $onsubmit !!} {!! $form_attrs !!}>
+ @csrf
+
+ @if ($ajax)
+ <x-alert type="danger" id="modal_error_msg" style="display:none"></x-alert>
+ @endif
+
+ <div class="modal-body">
+ {{ $slot }}
+ </div>
+
+ <div class="modal-footer">
+ @isset($footer)
+ {{ $footer }}
+ @else
+ <button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
+ <button class="btn {{ $submit_class }} pull-right"{!! $saveButtonAttrs !!}>{{ $submitLabel }}</button>
+ @endisset
+ </div>
+ </form>
+ </div>
+ </div>
+@if ($id)
+</div>
+@endif
diff --git a/resources/views/blade/modals/maintenance-complete.blade.php b/resources/views/blade/modals/maintenance-complete.blade.php
index 6e3cb8301a..778d2a9b95 100644
--- a/resources/views/blade/modals/maintenance-complete.blade.php
+++ b/resources/views/blade/modals/maintenance-complete.blade.php
@@ -4,27 +4,16 @@
partials/bootstrap-table.blade.php; the click handler that populates the
form action and shows this modal lives in resources/assets/js/snipeit.js
as a delegated `.complete-maintenance` handler. --}}
-<div class="modal fade" id="completeMaintenanceModal" tabindex="-1" role="dialog" aria-labelledby="completeMaintenanceModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('button.close') }}"><span aria-hidden="true">&times;</span></button>
- <h4 class="modal-title" id="completeMaintenanceModalLabel">{{ trans('admin/maintenances/form.mark_complete') }}</h4>
- </div>
- <form id="completeMaintenanceForm" method="POST" action="">
- @csrf
- <div class="modal-body">
- <p>{{ trans('admin/maintenances/message.complete.confirm') }}</p>
- <div class="form-group">
- <label for="completionNote">{{ trans('admin/maintenances/form.completion_notes') }}</label>
- <textarea class="form-control" id="completionNote" name="note" rows="3"></textarea>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
- <button type="submit" class="btn btn-success pull-right">{{ trans('admin/maintenances/form.mark_complete') }}</button>
- </div>
- </form>
- </div>
- </div>
-</div>
+<x-modals
+ id="completeMaintenanceModal"
+ :title="trans('admin/maintenances/form.mark_complete')"
+ :submit_label="trans('admin/maintenances/form.mark_complete')"
+ submit_class="btn-success"
+ form_attrs='id="completeMaintenanceForm"'
+>
+ <p>{{ trans('admin/maintenances/message.complete.confirm') }}</p>
+ <x-form.stacked name="note">
+ <label for="completionNote">{{ trans('admin/maintenances/form.completion_notes') }}</label>
+ <textarea class="form-control" id="completionNote" name="note" rows="3"></textarea>
+ </x-form.stacked>
+</x-modals>
diff --git a/resources/views/blade/modals/request-item.blade.php b/resources/views/blade/modals/request-item.blade.php
index 50cc31e5a2..22b6d815e9 100644
--- a/resources/views/blade/modals/request-item.blade.php
+++ b/resources/views/blade/modals/request-item.blade.php
@@ -1,96 +1,81 @@
-<div class="modal fade" id="requestItemModal" tabindex="-1" role="dialog" aria-labelledby="requestItemModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="{{ trans('button.close') }}">
- <span aria-hidden="true">&times;</span>
- </button>
- <h4 class="modal-title" id="requestItemModalLabel">
- {{ trans('general.request_item') }}
- <small class="request-item-name text-muted"></small>
- </h4>
- </div>
+{{-- Action URL is set per-click by snipeit.js from the trigger button's
+ data-request-url. Same shape as the adjust-quantity modal so the
+ moving parts stay familiar. --}}
+<x-modals
+ id="requestItemModal"
+ :submit_label="trans('button.request')"
+ form_attrs='id="requestItemForm" accept-charset="utf-8"'
+>
+ <x-slot:header>
+ <h4 class="modal-title" id="requestItemModalLabel">
+ {{ trans('general.request_item') }}
+ <small class="request-item-name text-muted"></small>
+ </h4>
+ </x-slot:header>
- {{-- Action URL is set per-click by snipeit.js from the trigger
- button's data-request-url. Same shape as the adjust-quantity
- modal so the moves-parts stay familiar. --}}
- <form id="requestItemForm" method="POST" action="" accept-charset="utf-8">
- @csrf
+ {{-- Snapshot of the tab the user was on when they
+ opened the modal. Snipeit.js reads the enclosing
+ .tab-pane on click and writes its id here so the
+ controller can restore the same tab on the
+ post-submit redirect. --}}
+ <input type="hidden" name="active_tab" id="requestItemActiveTab" value="">
- {{-- Snapshot of the tab the user was on when they
- opened the modal. Snipeit.js reads the enclosing
- .tab-pane on click and writes its id here so the
- controller can restore the same tab on the
- post-submit redirect. --}}
- <input type="hidden" name="active_tab" id="requestItemActiveTab" value="">
+ {{-- Qty row is hidden when the trigger sets
+ data-item-type="asset". Assets are 1:1
+ (you request THE asset, not N of it). The
+ hidden input keeps request-quantity=1
+ posted so the server-side path stays
+ uniform across every requestable type. --}}
+ <x-form.stacked name="request-quantity" id="requestItemQuantityRow">
+ <label for="requestItemQuantity">{{ trans('general.qty') }}</label>
+ <input
+ type="number"
+ class="form-control"
+ id="requestItemQuantity"
+ name="request-quantity"
+ min="1"
+ step="1"
+ value="1"
+ required
+ >
+ </x-form.stacked>
- <div class="modal-body">
- {{-- Qty row is hidden when the trigger sets
- data-item-type="asset" - assets are 1:1
- (you request THE asset, not N of it). The
- hidden input keeps request-quantity=1
- posted so the server-side path stays
- uniform across every requestable type. --}}
- <div class="form-group" id="requestItemQuantityRow">
- <label for="requestItemQuantity">{{ trans('general.qty') }}</label>
- <input
- type="number"
- class="form-control"
- id="requestItemQuantity"
- name="request-quantity"
- min="1"
- step="1"
- value="1"
- required
- >
- </div>
-
- {{-- Start / end dates are optional. Requesters who just
- want "whenever this becomes available" leave both
- blank; requesters reserving for a specific window
- (offsite event, project sprint) fill them in.
- end_date validates as after_or_equal:start_date in
- the controller. --}}
- <div class="row">
- <div class="col-md-6 form-group">
- <label for="requestItemStartDate">{{ trans('general.start_date') }}</label>
- <x-input.datepicker
- id="requestItemStartDate"
- name="start_date"
-
- />
- </div>
- <div class="col-md-6 form-group">
- <label for="requestItemEndDate">{{ trans('general.end_date') }}</label>
- <x-input.datepicker
- id="requestItemEndDate"
- name="end_date"
- />
- </div>
- </div>
-
- {{-- Optional free-text notes so the requester can
- attach context (why they need it, budget code,
- project, etc). Persisted on
- checkout_requests.notes and surfaced on the
- admin queue + in the "new request"
- notification. --}}
- <div class="form-group">
- <label for="requestItemNotes">{{ trans('general.notes') }}</label>
- <textarea
- id="requestItemNotes"
- name="notes"
- class="form-control"
- rows="3"
- ></textarea>
- </div>
- </div>
-
- <div class="modal-footer">
- <button type="button" class="btn btn-default pull-left" data-dismiss="modal">{{ trans('button.cancel') }}</button>
- <button type="submit" class="btn btn-primary pull-right">{{ trans('button.request') }}</button>
- </div>
- </form>
- </div>
+ {{-- Start / end dates are optional. Requesters who just
+ want "whenever this becomes available" leave both
+ blank; requesters reserving for a specific window
+ (offsite event, project sprint) fill them in.
+ end_date validates as after_or_equal:start_date in
+ the controller. --}}
+ <div class="row">
+ <x-form.stacked name="start_date" class="col-md-6">
+ <label for="requestItemStartDate">{{ trans('general.start_date') }}</label>
+ <x-input.datepicker
+ id="requestItemStartDate"
+ name="start_date"
+ />
+ </x-form.stacked>
+ <x-form.stacked name="end_date" class="col-md-6">
+ <label for="requestItemEndDate">{{ trans('general.end_date') }}</label>
+ <x-input.datepicker
+ id="requestItemEndDate"
+ name="end_date"
+ />
+ </x-form.stacked>
</div>
-</div>
+
+ {{-- Optional free-text notes so the requester can
+ attach context (why they need it, budget code,
+ project, etc). Persisted on
+ checkout_requests.notes and surfaced on the
+ admin queue + in the "new request"
+ notification. --}}
+ <x-form.stacked name="notes">
+ <label for="requestItemNotes">{{ trans('general.notes') }}</label>
+ <textarea
+ id="requestItemNotes"
+ name="notes"
+ class="form-control"
+ rows="3"
+ ></textarea>
+ </x-form.stacked>
+</x-modals>