diff --git a/resources/views/hardware/bulk-delete.blade.php b/resources/views/hardware/bulk-delete.blade.php index a9cbf6e037..86faff44a4 100644 --- a/resources/views/hardware/bulk-delete.blade.php +++ b/resources/views/hardware/bulk-delete.blade.php @@ -38,7 +38,7 @@ @foreach ($assets as $asset) - + {{ $asset->id }} {{ $asset->present()->name() }} diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php index 17f6645fe2..2ac0e835f6 100755 --- a/resources/views/hardware/bulk.blade.php +++ b/resources/views/hardware/bulk.blade.php @@ -149,7 +149,7 @@ @foreach ($assets as $key => $value) - + @endforeach diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index 746eaec1aa..31c585d51b 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -44,7 +44,7 @@ 'method' => 'POST', 'route' => ['hardware/bulkedit'], 'class' => 'form-inline', - 'id' => 'bulkEditForm']) }} + 'id' => 'bulkForm']) }}
@if (Input::get('status')!='Deleted') @@ -77,13 +77,13 @@ {{ trans('general.company') }} {{ trans('admin/hardware/table.image') }} {{ trans('admin/hardware/form.name') }} - {{ trans('admin/hardware/table.asset_tag') }} + {{ trans('admin/hardware/table.asset_tag') }} {{ trans('admin/hardware/table.serial') }} {{ trans('admin/hardware/form.model') }} {{ trans('admin/models/table.modelnumber') }} {{ trans('admin/hardware/table.status') }} {{ trans('admin/hardware/form.checkedout_to') }} - {{ trans('admin/hardware/table.location') }} + {{ trans('admin/hardware/table.location') }} {{ trans('general.category') }} {{ trans('general.manufacturer') }} {{ trans('admin/hardware/form.cost') }} @@ -130,31 +130,6 @@ @stop diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 6dbde71a08..27c3675bdb 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -53,4 +53,77 @@ $('.snipe-table').bootstrapTable({ }, }); + + + + // Handle whether or not the edit button should be disabled + $('.snipe-table').on('check.bs.table', function () { + $('#bulkEdit').removeAttr('disabled'); + }); + + $('.snipe-table').on('check-all.bs.table', function () { + $('#bulkEdit').removeAttr('disabled'); + }); + + $('.snipe-table').on('uncheck.bs.table', function () { + console.log($('.snipe-table').bootstrapTable('getSelections').length); + if ($('.snipe-table').bootstrapTable('getSelections').length == 0) { + $('#bulkEdit').attr('disabled', 'disabled'); + } + }); + + $('.snipe-table').on('uncheck-all.bs.table', function (e, row) { + $('#bulkEdit').attr('disabled', 'disabled'); + }); + + + function createdAtFormatter(value, row) { + if ((value) && (value.date)) { + return value.date; + } + } + + function trueFalseFormatter(value, row) { + if ((value) && ((value == 'true') || (value == '1'))) { + return ''; + } else { + return ''; + } + } + + function userFormatter(value, row) { + if (value.name) { + return ' ' + value.name + ''; + } else if (value) { + return ' ' + value + ''; + } + } + + function companyFormatter(value, row) { + if ((value) && (value[0].name)) { + return ' ' + value[0].name + ''; + } + } + + function locationFormatter(value, row) { + if ((value) && (value[0].name)) { + return ' ' + value[0].name + ''; + } + } + + function emailFormatter(value, row) { + if (value) { + return ' ' + value + ''; + } + } + + $(function () { + $('#bulkEdit').click(function () { + var selectedIds = $('.snipe-table').bootstrapTable('getSelections'); + $.each(selectedIds, function(key,value) { + $( "#bulkForm" ).append($('' )); + }); + + }); + }); diff --git a/resources/views/users/confirm-bulk-delete.blade.php b/resources/views/users/confirm-bulk-delete.blade.php index f1c6ff124b..af3032de99 100644 --- a/resources/views/users/confirm-bulk-delete.blade.php +++ b/resources/views/users/confirm-bulk-delete.blade.php @@ -50,9 +50,9 @@ Bulk Checkin & Delete isSuperUser() ? ' class="danger"':'') !!}> @if (Auth::id()!=$user->id) - + @else - + @endif @@ -90,7 +90,7 @@ Bulk Checkin & Delete - + diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 8d824e9875..e3a4abd40a 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -43,7 +43,7 @@ 'method' => 'POST', 'route' => ['users/bulkedit'], 'class' => 'form-inline', - 'id' => 'bulkEditForm']) }} + 'id' => 'bulkForm']) }} @if (Input::get('status')!='deleted') @can('delete', \App\Models\User::class) @@ -82,7 +82,7 @@ {{ trans('admin/users/table.username') }} - {{ trans('admin/users/table.manager') }} + {{ trans('admin/users/table.manager') }} {{ trans('admin/users/table.location') }} @@ -100,7 +100,9 @@ - {{ trans('general.groups') }} + + {{ trans('general.groups') }} + {{ trans('general.notes') }} {{ trans('admin/users/general.two_factor_enrolled') }} {{ trans('admin/users/general.two_factor_active') }} @@ -125,70 +127,15 @@ @stop