2022-06-01 10:15:55 +03:00
|
|
|
<x-layouts.admin>
|
|
|
|
<x-slot name="title">{{ trans('general.title.edit', ['type' => trans_choice('general.reports', 1)]) }}</x-slot>
|
|
|
|
|
|
|
|
<x-slot name="content">
|
|
|
|
<x-form.container>
|
|
|
|
<x-form id="report" method="PATCH" :route="['reports.update', $report->id]" :model="$report">
|
|
|
|
<x-form.section>
|
|
|
|
<x-slot name="head">
|
|
|
|
<x-form.section.head title="{{ trans('general.general') }}" description="" />
|
|
|
|
</x-slot>
|
|
|
|
|
|
|
|
<x-slot name="body">
|
|
|
|
<x-form.group.text name="name" label="{{ trans('general.name') }}" />
|
|
|
|
|
|
|
|
<x-form.group.text name="class_disabled" label="{{ trans_choice('general.types', 1) }}" value="{{ $classes[$report->class] }}" disabled />
|
|
|
|
|
|
|
|
<x-form.input.hidden name="class" :value="$report->class" />
|
|
|
|
|
|
|
|
<x-form.group.textarea name="description" label="{{ trans('general.description') }}" />
|
|
|
|
</x-slot>
|
|
|
|
</x-form.section>
|
|
|
|
|
|
|
|
<x-form.section>
|
|
|
|
<x-slot name="head">
|
|
|
|
<x-form.section.head title="{{ trans_choice('reports.preferences', 2) }}" description="" />
|
|
|
|
</x-slot>
|
|
|
|
|
|
|
|
<x-slot name="body">
|
|
|
|
<x-form.input.hidden name="report" value="invalid" data-field="settings" />
|
|
|
|
|
|
|
|
@foreach($class->getFields() as $field)
|
|
|
|
@php $type = $field['type']; @endphp
|
|
|
|
|
|
|
|
@switch($type)
|
|
|
|
@case('text')
|
|
|
|
@case('textGroup')
|
|
|
|
<x-form.group.text
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
data-field="settings"
|
|
|
|
:attributes="$field['attributes']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('email')
|
|
|
|
@case('emailGroup')
|
|
|
|
<x-form.group.email
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
data-field="settings"
|
|
|
|
:attributes="$field['attributes']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('password')
|
|
|
|
@case('passwordGroup')
|
2022-07-21 16:59:19 +03:00
|
|
|
<x-form.group.password
|
2022-06-01 10:15:55 +03:00
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
data-field="settings"
|
|
|
|
:attributes="$field['attributes']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('textarea')
|
|
|
|
@case('textareaGroup')
|
|
|
|
<x-form.group.textarea
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
data-field="settings"
|
|
|
|
:attributes="$field['attributes']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('date')
|
|
|
|
@case('dateGroup')
|
|
|
|
<x-form.group.date
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
:value="isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null"
|
|
|
|
data-field="settings"
|
|
|
|
:attributes="array_merge([
|
|
|
|
'model' => 'form.settings'.'.'.$field['name'],
|
|
|
|
'show-date-format' => company_date_format(),
|
|
|
|
], $field['attributes'])"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('select')
|
|
|
|
@case('selectGroup')
|
|
|
|
<x-form.group.select
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
:options="$field['values']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:selected="isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : $field['selected']"
|
2022-06-01 10:15:55 +03:00
|
|
|
data-field="settings"
|
|
|
|
:attributes="$field['attributes']"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('radio')
|
|
|
|
@case('radioGroup')
|
|
|
|
<x-form.group.radio
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
:attributes="array_merge([
|
|
|
|
'data-field' => 'settings'
|
|
|
|
], $field['attributes'])"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@case('checkbox')
|
|
|
|
@case('checkboxGroup')
|
|
|
|
<x-form.group.checkbox
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
:attributes="array_merge([
|
|
|
|
'data-field' => 'settings'
|
|
|
|
], $field['attributes'])"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@break
|
|
|
|
|
|
|
|
@default
|
|
|
|
<x-form.group.text
|
|
|
|
name="{{ $field['name'] }}"
|
|
|
|
label="{{ $field['title'] }}"
|
|
|
|
:attributes="array_merge([
|
|
|
|
'data-field' => 'settings'
|
|
|
|
], $field['attributes'])"
|
2022-07-21 16:59:19 +03:00
|
|
|
:dynamic-attributes="$field['attributes']"
|
2022-06-01 10:15:55 +03:00
|
|
|
/>
|
|
|
|
@endswitch
|
|
|
|
@endforeach
|
|
|
|
</x-slot>
|
|
|
|
</x-form.section>
|
|
|
|
|
|
|
|
@can('update-common-reports')
|
|
|
|
<x-form.section>
|
|
|
|
<x-slot name="foot">
|
|
|
|
<x-form.buttons cancel-route="reports.index" />
|
|
|
|
</x-slot>
|
|
|
|
</x-form.section>
|
|
|
|
@endcan
|
|
|
|
</x-form>
|
|
|
|
</x-form.container>
|
|
|
|
</x-slot>
|
|
|
|
|
|
|
|
<x-script folder="common" file="reports" />
|
|
|
|
</x-layouts.admin>
|