Added a few more buttons

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-08-01 19:31:25 +01:00
parent ed651b6869
commit 16f1b5e23e
9 changed files with 142 additions and 48 deletions
@@ -33,7 +33,8 @@
data-side-pagination="client"
data-sort-order="asc"
data-sort-name="name"
id="customFieldsTable"
id="customFieldsetTable"
data-buttons="customFieldetButtons"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-fieldsets-{{ date('Y-m-d') }}",
@@ -130,6 +131,7 @@
data-sort-order="asc"
data-sort-name="name"
id="customFieldsTable"
data-buttons="customFieldButtons"
class="table table-striped snipe-table"
data-export-options='{
"fileName": "export-fields-{{ date('Y-m-d') }}",
+1 -4
View File
@@ -6,10 +6,6 @@
@parent
@stop
@section('header_right')
<a href="{{ route('departments.create') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}</a>
@stop
{{-- Page content --}}
@section('content')
<div class="row">
@@ -22,6 +18,7 @@
data-side-pagination="server"
data-sort-order="asc"
id="departmentsTable"
data-buttons="departmentButtons"
class="table table-striped snipe-table"
data-url="{{ route('api.departments.index') }}"
data-export-options='{
@@ -6,12 +6,6 @@
@parent
@stop
@section('header_right')
<a href="{{ route('depreciations.create') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}</a>
@stop
{{-- Page content --}}
@section('content')
@@ -26,6 +20,7 @@
data-side-pagination="server"
data-sort-order="asc"
id="depreciationsTable"
data-buttons="depreciationButtons"
class="table table-striped snipe-table"
data-url="{{ route('api.depreciations.index') }}"
data-export-options='{
+1
View File
@@ -26,6 +26,7 @@
data-sort-order="asc"
data-sort-name="name"
id="groupsTable"
data-buttons="groupButtons"
class="table table-striped snipe-table"
data-url="{{ route('api.groups.index') }}"
data-export-options='{
+2 -2
View File
@@ -24,9 +24,9 @@
@elseif (Request::get('status')=='Archived')
{{ trans('general.archived') }}
@elseif (Request::get('status')=='Deleted')
{{ trans('general.deleted') }}
{{ ucfirst(trans('general.deleted')) }}
@elseif (Request::get('status')=='byod')
{{ trans('general.byod') }}
{{ strtoupper(trans('general.byod')) }}
@endif
@else
{{ trans('general.all') }}
+1 -16
View File
@@ -6,22 +6,6 @@
@parent
@stop
{{-- Page title --}}
@section('header_right')
@can('create', \App\Models\Manufacturer::class)
<a href="{{ route('manufacturers.create') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}</a>
@endcan
@if (Request::get('deleted')=='true')
<a class="btn btn-default pull-right" href="{{ route('manufacturers.index') }}" style="margin-right: 5px;">{{ trans('general.show_current') }}</a>
@else
<a class="btn btn-default pull-right" href="{{ route('manufacturers.index', ['deleted' => 'true']) }}" style="margin-right: 5px;">
{{ trans('general.show_deleted') }}</a>
@endif
@stop
{{-- Page content --}}
@section('content')
@@ -55,6 +39,7 @@
data-side-pagination="server"
data-sort-order="asc"
id="manufacturersTable"
data-buttons="manufacturerButtons"
class="table table-striped snipe-table"
data-url="{{route('api.manufacturers.index', ['deleted' => (request('deleted')=='true') ? 'true' : 'false' ]) }}"
data-export-options='{
-12
View File
@@ -12,18 +12,6 @@
@parent
@stop
{{-- Page title --}}
@section('header_right')
@if (Request::get('status')=='deleted')
<a class="btn btn-default pull-right" href="{{ route('models.index') }}" style="margin-right: 5px;">{{ trans('admin/models/general.view_models') }}</a>
@else
<a class="btn btn-default pull-right" href="{{ route('models.index', ['status' => 'deleted']) }}" style="margin-right: 5px;">{{ trans('admin/models/general.view_deleted') }}</a>
@endif
@stop
{{-- Page content --}}
@section('content')
@@ -1343,7 +1343,19 @@
attributes: {
title: '{{ trans('admin/hardware/general.custom_export') }}'
}
}
},
btnShowDeleted: {
text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
icon: 'fa-solid fa-trash {{ (request()->input('status') == "Deleted") ? ' text-danger' : '' }}',
event () {
window.location.href = '{{ (request()->input('status') == "Deleted") ? route('hardware.index') : route('hardware.index', ['status' => 'Deleted']) }}';
},
attributes: {
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
}
},
});
@can('create', \App\Models\Location::class)
@@ -1384,6 +1396,64 @@
});
@endcan
@can('create', \App\Models\Depreciation::class)
// Accessory table buttons
window.depreciationButtons = () => ({
btnAdd: {
text: '{{ trans('general.create') }}',
icon: 'fa fa-plus',
event () {
window.location.href = '{{ route('depreciations.create') }}';
},
attributes: {
title: '{{ trans('general.create') }}',
@if ($snipeSettings->shortcuts_enabled == 1)
accesskey: 'n'
@endif
}
},
});
@endcan
@can('create', \App\Models\CustomField::class)
// Accessory table buttons
window.customFieldButtons = () => ({
btnAdd: {
text: '{{ trans('general.create') }}',
icon: 'fa fa-plus',
event () {
window.location.href = '{{ route('fields.create') }}';
},
attributes: {
title: '{{ trans('general.create') }}',
@if ($snipeSettings->shortcuts_enabled == 1)
accesskey: 'n'
@endif
}
},
});
@endcan
@can('create', \App\Models\CustomFieldset::class)
// Accessory table buttons
window.customFieldetButtons = () => ({
btnAdd: {
text: '{{ trans('general.create') }}',
icon: 'fa fa-plus',
event () {
window.location.href = '{{ route('fieldsets.create') }}';
},
attributes: {
title: '{{ trans('general.create') }}',
@if ($snipeSettings->shortcuts_enabled == 1)
accesskey: 'n'
@endif
}
},
});
@endcan
@can('create', \App\Models\Component::class)
// Compoment table buttons
window.componentButtons = () => ({
@@ -1422,6 +1492,56 @@
});
@endcan
@can('create', \App\Models\Manufacturer::class)
// Consumable table buttons
window.manufacturerButtons = () => ({
btnAdd: {
text: '{{ trans('general.create') }}',
icon: 'fa fa-plus',
event () {
window.location.href = '{{ route('manufacturers.create') }}';
},
attributes: {
title: '{{ trans('general.create') }}',
@if ($snipeSettings->shortcuts_enabled == 1)
accesskey: 'n'
@endif
},
btnShowDeleted: {
text: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}',
event () {
window.location.href = '{{ (request()->input('status') == "deleted") ? route('manufacturers.index') : route('manufacturers.index', ['status' => 'deleted']) }}';
},
attributes: {
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
}
},
},
});
@endcan
@can('create', \App\Models\Supplier::class)
// Consumable table buttons
window.supplierButtons = () => ({
btnAdd: {
text: '{{ trans('general.create') }}',
icon: 'fa fa-plus',
event () {
window.location.href = '{{ route('suppliers.create') }}';
},
attributes: {
title: '{{ trans('general.create') }}',
@if ($snipeSettings->shortcuts_enabled == 1)
accesskey: 'n'
@endif
}
},
});
@endcan
@can('create', \App\Models\Component::class)
// License table buttons
window.licenseButtons = () => ({
@@ -1533,6 +1653,17 @@
@endif
}
},
btnShowDeleted: {
text: '{{ (request()->input('status') == "deleted") ? trans('general.list_all') : trans('general.deleted') }}',
icon: 'fa-solid fa-trash {{ (request()->input('status') == "deleted") ? ' text-danger' : '' }}',
event () {
window.location.href = '{{ (request()->input('status') == "deleted") ? route('models.index') : route('models.index', ['status' => 'deleted']) }}';
},
attributes: {
title: '{{ (request()->input('status') == "Deleted") ? trans('general.list_all') : trans('general.deleted') }}',
}
},
});
@endcan
+1 -6
View File
@@ -10,12 +10,6 @@
@section('content')
@section('header_right')
@can('create', \App\Models\Supplier::class)
<a href="{{ route('suppliers.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
@endcan
@stop
<div class="row">
<div class="col-md-12">
<div class="box box-default">
@@ -27,6 +21,7 @@
data-side-pagination="server"
data-sort-order="asc"
id="suppliersTable"
data-buttons="supplierButtons"
class="table table-striped snipe-table"
data-url="{{ route('api.suppliers.index') }}"
data-export-options='{