@props([ 'type', 'template', ]) {{-- Right-column "Saved Templates" panel shared by the three custom report pages (asset / component / consumable). Report-type-specific bits (Livewire component type, the route name for the show-form guard) are derived from $type. --}} @php $showFormRoutes = match ($type) { 'asset' => ['reports/custom'], 'component' => ['reports/custom', 'reports.custom.component'], 'consumable' => ['reports/custom', 'reports.custom.consumable'], }; @endphp @if (request()->routeIs('report-templates.edit')) {{-- Edit mode: template name + is_shared are the only fields the edit page adds on top of the report-config form. Rendered here in the sidebar (rather than shoehorned into the main form's box header, which crowded the two-line header). form="custom-report-form" associates these inputs with the report form even though they live outside its DOM subtree so they still POST as part of it. --}}

{{ trans('admin/reports/general.template_name') }}

@if ($template->created_by == auth()->id()) @endif {{-- The main form's submit button is buried under the report- configuration box further down the page, which makes it unclear that a name / is_shared change here needs the main form to be submitted. Explicit Save here as an anchor so the user can clearly see what they're saving. --}}
@endif @if (! request()->routeIs('report-templates.edit'))
@if ($template->name) @if ($template->created_by == auth()->id()) {!! ($template->is_shared ? ''.' '.trans('admin/reports/general.template_shared_with_others') : ''.' '.trans('admin/reports/general.template_not_shared')) !!} @else {!! ($template->is_shared ? ''.' '.trans('admin/reports/general.template_shared') : ''.' '.trans('admin/reports/general.template_not_shared')) !!} @endif @endif
@if ($template->created_by == auth()->id()) @if (request()->routeIs('report-templates.show')) {{ trans('general.update') }} {{-- .delete-asset is the snipeit.js delete-confirm modal trigger class (legacy name; not asset-specific). --}} {{ trans('general.delete') }} @endif @endif
@endif @if (request()->routeIs(...$showFormRoutes))
{{-- data-report-save-template hooks the shared submit handler in snipeit.js (`form[data-report-save-template]`). That handler forwards the template name + type into the main custom-report form and submits it to templates.store. --}}
@csrf

{{ trans('admin/reports/message.about_templates') }}

{!! trans('admin/reports/message.saving_templates_description') !!}

@endif