{{--
Fields of the agreement form (#2957 slice 13, card #3099), shared by partials/createForm and
partials/editForm. Expects $agreement (null on create). The same names as before: status
(Agreement::$status), title (required), trigger_code, start_time and stop_time as text in the
old "Y-m-d H:i:00" format (empty = no limit; the jQuery datetimepicker is gone, DESIGN.md) and
content (TinyMCE, class "tinymce"). The content textarea is not "required": TinyMCE hides it,
and the old create page skipped the browser check for the same reason.
--}}
@php
$agreement = $agreement ?? null;
$status = (string) old('status', $agreement ? $agreement->status : '');
$statuses = [
\App\Models\Agreement::$status['active'] => __('agreement.nh.active'),
\App\Models\Agreement::$status['inactive'] => __('agreement.nh.inactive'),
];
$time = fn ($value) => $value ? \Carbon\Carbon::parse($value)->format('Y-m-d H:i:s') : null;
@endphp