delete button progress

This commit is contained in:
akemidx 2023-04-12 18:33:44 -04:00
parent d94bed3f57
commit b1e68be545
3 changed files with 6 additions and 66 deletions

View file

@ -12,6 +12,7 @@ return [
'clone' => 'Clone Asset',
'deployable' => 'Deployable',
'deleted' => 'This asset has been deleted.',
'delete_confirm' => 'Are you sure you want to delete this asset?',
'edit' => 'Edit Asset',
'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.',
'model_invalid' => 'The Model of this Asset is invalid.',

View file

@ -6,67 +6,6 @@
@parent
@stop
{{-- Right header --}}
@section('header_right')
@can('manage', \App\Models\Asset::class)
@if ($asset->deleted_at=='')
<div class="dropdown pull-right">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
@if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1'))
@if (($asset->assigned_to != '') && ($asset->deleted_at==''))
@can('checkin', \App\Models\Asset::class)
<li role="menuitem">
<a href="{{ route('hardware.checkin.create', $asset->id) }}">
{{ trans('admin/hardware/general.checkin') }}
</a>
</li>
@endcan
@elseif (($asset->assigned_to == '') && ($asset->deleted_at==''))
@can('checkout', \App\Models\Asset::class)
<li role="menuitem">
<a href="{{ route('hardware.checkout.create', $asset->id) }}">
{{ trans('admin/hardware/general.checkout') }}
</a>
</li>
@endcan
@endif
@endif
@can('update', \App\Models\Asset::class)
<li role="menuitem">
<a href="{{ route('hardware.edit', $asset->id) }}">
{{ trans('admin/hardware/general.edit') }}
</a>
</li>
@endcan
@can('create', \App\Models\Asset::class)
<li role="menuitem">
<a href="{{ route('clone/hardware', $asset->id) }}">
{{ trans('admin/hardware/general.clone') }}
</a>
</li>
@endcan
@can('audit', \App\Models\Asset::class)
<li role="menuitem">
<a href="{{ route('asset.audit.create', $asset->id) }}">
{{ trans('general.audit') }}
</a>
</li>
@endcan
</ul>
</div>
@endif
@endcan
@stop
{{-- Page content --}}
@section('content')
@ -923,10 +862,10 @@
@can('delete', $asset)
@if ($asset->deleted_at=='')
<div class="col-md-12" style="padding-top: 30px; padding-bottom: 30px;">
<form action="{{ route('delete/assetfile', [$asset->id,$fileId->id]) }}" method="POST">
<form action="{{ route('hardware/delete', ['assetId' => $asset->id]) }}" method="POST" onsubmit="return confirm( {{trans('general/message.delete_confirm')}} )">
{{csrf_field()}}
{{ method_field("DELETE")}}
<button style="width: 100%;" class="btn btn-sm btn-warning hidden-print" >{{ trans('button.delete')}}</button>
<button style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('button.delete')}}</button>
</form>
</div>
@endif

View file

@ -146,9 +146,9 @@ Route::group(
[AssetFilesController::class, 'show']
)->name('show/assetfile');
Route::delete('{assetId}/showfile/{fileId}/delete',
[AssetFilesController::class, 'destroy']
)->name('delete/assetfile');
Route::delete('{assetId}/delete',
[AssetsController::class, 'destroy']
)->name('hardware/delete');
Route::post(
'bulkedit',