Fixed back button

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-26 10:40:48 +01:00
parent 64082ada1e
commit 243ab51def
5 changed files with 6 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<!-- begin redirect submit options --> <!-- begin redirect submit options -->
@props([ @props([
'route' => 'hardware.index', 'index_route',
'button_label', 'button_label',
'disabled_select' => false, 'disabled_select' => false,
'options' => [], 'options' => [],
@ -10,7 +10,7 @@
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<a class="btn btn-link" href="{{ route($route) }}">{{ trans('button.cancel') }}</a> <a class="btn btn-link" href="{{ $index_route ? route($index_route) : url()->previous() }}">{{ trans('button.cancel') }}</a>
</div> </div>
<div class="col-md-9 text-right"> <div class="col-md-9 text-right">

View file

@ -128,7 +128,7 @@
</div> <!--/.box-body--> </div> <!--/.box-body-->
<x-redirect_submit_options <x-redirect_submit_options
route="hardware.index" index_route="hardware.index"
:button_label="trans('general.checkout')" :button_label="trans('general.checkout')"
:disabled_select="!$asset->model" :disabled_select="!$asset->model"
:options="[ :options="[

View file

@ -176,7 +176,7 @@
</div> <!--/.box-body--> </div> <!--/.box-body-->
<x-redirect_submit_options <x-redirect_submit_options
route="hardware.index" index_route="hardware.index"
:button_label="trans('general.checkout')" :button_label="trans('general.checkout')"
:disabled_select="!$asset->model" :disabled_select="!$asset->model"
:options="[ :options="[

View file

@ -3,6 +3,7 @@
'createText' => trans('admin/hardware/form.create'), 'createText' => trans('admin/hardware/form.create'),
'updateText' => trans('admin/hardware/form.update'), 'updateText' => trans('admin/hardware/form.update'),
'topSubmit' => true, 'topSubmit' => true,
'index_route' => 'hardware.index',
'helpText' => trans('help.assets'), 'helpText' => trans('help.assets'),
'helpPosition' => 'right', 'helpPosition' => 'right',
'formAction' => ($item->id) ? route('hardware.update', ['hardware' => $item->id]) : route('hardware.store'), 'formAction' => ($item->id) ? route('hardware.update', ['hardware' => $item->id]) : route('hardware.store'),

View file

@ -67,7 +67,7 @@
{{ csrf_field() }} {{ csrf_field() }}
@yield('inputFields') @yield('inputFields')
<x-redirect_submit_options <x-redirect_submit_options
route="hardware.index" :index_route="$index_route ?? null"
:button_label="trans('general.save')" :button_label="trans('general.save')"
:options="$options ?? []" :options="$options ?? []"
/> />