mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Updated buttons on models
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
f82266fade
commit
eb8d43a804
|
@ -41,9 +41,9 @@
|
|||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-barcode fa-2x"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
<span class="hidden-xs hidden-sm">
|
||||
{{ trans('general.assets') }}
|
||||
{!! ($model->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($model->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
@ -332,39 +332,47 @@
|
|||
</div>
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;">
|
||||
<a href="{{ route('models.edit', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print">{{ trans('admin/models/table.edit') }}</a>
|
||||
<a href="{{ route('models.edit', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-warning btn-social hidden-print">
|
||||
<x-icon type="edit" />
|
||||
{{ trans('admin/models/table.edit') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('create', \App\Models\AssetModel::class)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;">
|
||||
<a href="{{ route('models.clone.create', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print">{{ trans('admin/models/table.clone') }}</a>
|
||||
<a href="{{ route('models.clone.create', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-info btn-social hidden-print">
|
||||
<x-icon type="clone" />
|
||||
{{ trans('admin/models/table.clone') }}
|
||||
</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('delete', \App\Models\AssetModel::class)
|
||||
@if ($model->assets_count > 0)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;">
|
||||
<button class="btn btn-block btn-sm btn-primary hidden-print disabled" data-tooltip="true" data-placement="top" data-title="{{ trans('general.cannot_be_deleted') }}">{{ trans('general.delete') }}</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="col-md-12" style="padding-top: 10px;">
|
||||
|
||||
@if ($model->deleted_at!='')
|
||||
<form method="POST" action="{{ route('models.restore.store', $model->id) }}">
|
||||
@csrf
|
||||
<button style="width: 100%;" class="btn btn-sm btn-warning btn-social hidden-print">
|
||||
<x-icon type="restore" />
|
||||
{{ trans('button.restore') }}
|
||||
</button>
|
||||
</form>
|
||||
@elseif ($model->assets()->count() > 0)
|
||||
<button class="btn btn-block btn-sm btn-danger btn-social hidden-print disabled" data-tooltip="true" data-placement="top" data-title="{{ trans('general.cannot_be_deleted') }}">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<button class="btn btn-block btn-sm btn-danger btn-social delete-asset" data-toggle="modal" title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $model->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}">
|
||||
<x-icon type="delete" />
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="text-center col-md-12" style="padding-top: 30px; padding-bottom: 30px;">
|
||||
@if ($model->deleted_at!='')
|
||||
<form method="POST" action="{{ route('models.restore.store', $model->id) }}">
|
||||
@csrf
|
||||
<button style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('button.restore') }}</button>
|
||||
</form>
|
||||
@else
|
||||
<button class="btn btn-block btn-sm btn-danger delete-asset" data-toggle="modal" title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}" data-content="{{ trans('general.sure_to_delete_var', ['item' => $model->name]) }}" data-target="#dataConfirmModal" data-tooltip="true" data-placement="top" data-title="{{ trans('general.delete_what', ['item'=> trans('general.asset_model')]) }}">{{ trans('general.delete') }} </button>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
|
||||
|
|
Loading…
Reference in a new issue