Updated bootstrap tables

This commit is contained in:
snipe 2018-01-10 22:53:54 -08:00
parent 2bbb6001a8
commit 55b9f1207d
13 changed files with 55 additions and 42 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/jspdf.min.js vendored

Binary file not shown.

Binary file not shown.

BIN
public/js/xlsx.core.min.js vendored Normal file

Binary file not shown.

View file

@ -40,9 +40,9 @@
@section('moar_scripts') @section('moar_scripts')
@include ('partials.bootstrap-table', [ @include ('partials.bootstrap-table', [
'exportFile' => 'accessories-export',
'search' => true, 'search' => true,
'showFooter' => true, 'showFooter' => true,
'columns' => \App\Presenters\AccessoryPresenter::dataTableLayout() 'columns' => \App\Presenters\AccessoryPresenter::dataTableLayout(),
'exportFile' => 'accessories-export',
]) ])
@stop @stop

View file

@ -42,15 +42,16 @@
<div class="table-responsive"> <div class="table-responsive">
<table <table
name="licenseSeats" name="license-seats"
class="table table-striped snipe-table" class="table table-striped snipe-table"
id="licenseSeats" id="licenseSeats"
data-id-table="licenseSeats"
data-search="false" data-search="false"
data-url="{{route('api.license.seats',['licence_id' => $license->id]) }}" data-url="{{ route('api.license.seats',['licence_id' => $license->id]) }}"
data-export-options='{"fileName": "asset-assets"}' data-export="true"
data-export-options="{'fileName': 'license-seats'}"
data-cookie="true" data-cookie="true"
data-show-footer="true" data-cookie-id-table="licenseSeats-Table">
data-cookie-id-table="licenseSeats">
<thead> <thead>
<tr> <tr>
<th class="col-md-1" data-field="name">{{ trans('admin/licenses/general.seat') }}</th> <th class="col-md-1" data-field="name">{{ trans('admin/licenses/general.seat') }}</th>
@ -80,7 +81,7 @@
@if ($license->manufacturer) @if ($license->manufacturer)
<tr> <tr>
<td>{{ trans('admin/hardware/form.manufacturer') }}</td> <td>{{ trans('admin/hardware/form.manufacturer') }}:</td>
<td><p style="line-height: 23px;"> <td><p style="line-height: 23px;">
@can('view', \App\Models\Manufacturer::class) @can('view', \App\Models\Manufacturer::class)
<a href="{{ route('manufacturers.show', $license->manufacturer->id) }}"> <a href="{{ route('manufacturers.show', $license->manufacturer->id) }}">
@ -115,7 +116,7 @@
@if (!is_null($license->serial)) @if (!is_null($license->serial))
<tr> <tr>
<td>{{ trans('admin/licenses/form.license_key') }}</td> <td>{{ trans('admin/licenses/form.license_key') }}: </td>
<td style="word-wrap: break-word;overflow-wrap: break-word;word-break: break-word;"> <td style="word-wrap: break-word;overflow-wrap: break-word;word-break: break-word;">
@can('viewKeys', $license) @can('viewKeys', $license)
{!! nl2br(e($license->serial)) !!} {!! nl2br(e($license->serial)) !!}
@ -128,16 +129,16 @@
@endif @endif
@if (!is_null($license->license_name)) @if ($license->license_name!='')
<tr> <tr>
<td>{{ trans('admin/licenses/form.to_name') }}</td> <td>{{ trans('admin/licenses/form.to_name') }}: </td>
<td>{{ $license->license_name }}</td> <td>{{ $license->license_name }}</td>
</tr> </tr>
@endif @endif
@if (!is_null($license->license_email)) @if ($license->license_email!='')
<tr> <tr>
<td>{{ trans('admin/licenses/form.to_email') }}</td> <td>{{ trans('admin/licenses/form.to_email') }}:</td>
<td>{{ $license->license_email }}</td> <td>{{ $license->license_email }}</td>
</tr> </tr>
@endif @endif

View file

@ -1,15 +1,16 @@
{{-- This Will load our default bootstrap-table settings on any table with a class of "snipe-table" and export it to the passed 'exportFile' name --}} <script src="{{ asset('js/bootstrap-table.min.js') }}"></script>
<script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script> <script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.min.js?v=1') }}"></script> <script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.min.js?v=1') }}"></script>
@if (!isset($simple_view))
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js?v=1') }}"></script> <script src="{{ asset('js/extensions/export/bootstrap-table-export.js?v=1') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script> <script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script> <script src="{{ asset('js/FileSaver.min.js') }}"></script>
<script src="{{ asset('js/xlsx.core.min.js') }}"></script>
<script src="{{ asset('js/jspdf.min.js') }}"></script> <script src="{{ asset('js/jspdf.min.js') }}"></script>
<script src="{{ asset('js/jspdf.plugin.autotable.js') }}"></script> <script src="{{ asset('js/jspdf.plugin.autotable.js') }}"></script>
<script src="{{ asset('js/extensions/export/jquery.base64.js') }}"></script> <script src="{{ asset('js/extensions/export/tableExport.min.js') }}"></script>
@if (!isset($simple_view))
<script src="{{ asset('js/extensions/toolbar/bootstrap-table-toolbar.js') }}"></script> <script src="{{ asset('js/extensions/toolbar/bootstrap-table-toolbar.js') }}"></script>
<script src="{{ asset('js/extensions/sticky-header/bootstrap-table-sticky-header.js') }}"></script> <script src="{{ asset('js/extensions/sticky-header/bootstrap-table-sticky-header.js') }}"></script>
@endif @endif
@ -17,6 +18,9 @@
<script nonce="{{ csrf_token() }}"> <script nonce="{{ csrf_token() }}">
var $table = $('.snipe-table'); var $table = $('.snipe-table');
$(function () { $(function () {
buildTable($table, 20, 50); buildTable($table, 20, 50);
}); });
@ -34,6 +38,12 @@
$('.snipe-table').bootstrapTable('destroy').bootstrapTable({ $('.snipe-table').bootstrapTable('destroy').bootstrapTable({
classes: 'table table-responsive table-no-bordered', classes: 'table table-responsive table-no-bordered',
ajaxOptions: {
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
undefinedText: '', undefinedText: '',
iconsPrefix: 'fa', iconsPrefix: 'fa',
search: {{ (isset($search)) ? 'true' : 'false' }}, search: {{ (isset($search)) ? 'true' : 'false' }},
@ -69,10 +79,32 @@
@endif @endif
refresh: 'fa-refresh' refresh: 'fa-refresh'
}, },
@if (!isset($simple_view)) showExport: true,
exportDataType: 'all',
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
exportOptions: {
fileName: '{{ ((isset($exportFile)) ? $exportFile : 'table') }}-' + (new Date()).toISOString().slice(0,10),
ignoreColumn: ['actions','image','change','checkbox','checkincheckout','icon'],
worksheetName: "Snipe-IT Export",
escape: false,
jspdf: {
orientation: 'l',
autotable: {
styles: {
rowHeight: 20,
fontSize: 10,
overflow: 'linebreak',
},
headerStyles: {fillColor: 255, textColor: 0},
//alternateRowStyles: {fillColor: [60, 69, 79], textColor: 255}
}
}
},
@if (!isset($simple_view))
showRefresh: true, showRefresh: true,
showExport: true,
stickyHeader: true, stickyHeader: true,
stickyHeaderOffsetY: stickyHeaderOffsetY + 'px', stickyHeaderOffsetY: stickyHeaderOffsetY + 'px',
@ -87,28 +119,8 @@
showMultiSort: true, showMultiSort: true,
@endif @endif
@if (isset($exportFile))
exportDataType: 'all',
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
exportOptions: {
fileName: '{{ $exportFile . "-" }}' + (new Date()).toISOString().slice(0,10),
ignoreColumn: ['actions','change','checkbox','checkincheckout','icon'],
worksheetName: "Snipe-IT Export",
jspdf: {
orientation: 'l',
autotable: {
styles: {
rowHeight: 20,
fontSize: 10,
overflow: 'linebreak',
},
headerStyles: {fillColor: 255, textColor: 0},
//alternateRowStyles: {fillColor: [60, 69, 79], textColor: 255}
}
}
},
@endif
@endif @endif
pageList: ['20', '30','50','100','150','200'] pageList: ['20', '30','50','100','150','200']