@extends('layouts/default') {{-- Page title --}} @section('title') @if ($item->id) {{ trans('admin/maintenances/form.update') }} @else {{ trans('admin/maintenances/form.create') }} @endif @parent @stop {{-- Page content --}} @section('content') @if ($item->id) {{ $item->title }} @endif @if (! $item->id) @include ('partials.forms.edit.asset-select', [ 'translated_name' => trans('general.assets'), 'fieldname' => 'selected_assets[]', 'multiple' => true, 'required' => true, 'select_id' => 'assigned_assets_select', 'asset_selector_div_id' => 'assets_for_maintenance_div', 'asset_ids' => $item->id ? $item->asset()->pluck('id')->toArray() : old('selected_assets'), 'asset_id' => $item->id ? $item->asset()->pluck('id')->toArray() : null, ]) @else @if ($item->asset->company) {{ $item->asset->company->name }} @endif {{ $item->asset ? $item->asset->present()->fullName : '' }} @if ($item->asset->location) {{ $item->asset->location->name }} @endif @endif @include ('partials.forms.edit.maintenance_type') {{-- Editable actual-completion date. Available on create as well as edit so users can backfill historical maintenances that were already done before being recorded. Setting this from null → date is equivalent to clicking Mark Complete (fires MaintenanceComplete, stamps completed_by, computes asset_maintenance_time). Clearing it un-completes the row. default_now MUST stay false — the field must never prefill with today. Editing a maintenance to change something unrelated should not accidentally stamp it complete just because the datetimepicker helpfully defaulted the empty value to now. --}} @stop