snipe-it/resources/views/partials/bootstrap-table.blade.php
Daniel Meltzer 61543f3a04 Add presenters for models. (#3098)
* Add presenters for models.  Move bootstrap table JSON generation to these presenters, which cleans up controllers a lot.  Move view specific modifications from the models to the presenters as well.

* Fix some issues found by travis and codacy

* Fix a few more issues found while testing.

* Attempt another acceptance test fix

* Try something else

* Maybe..
2016-12-23 17:52:00 -08:00

58 lines
2.3 KiB
PHP

{{-- 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('assets/js/bootstrap-table.js') }}"></script>
<script src="{{ asset('assets/js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('assets/js/extensions/export/bootstrap-table-export.js?v=1') }}"></script>
<script src="{{ asset('assets/js/extensions/cookie/bootstrap-table-cookie.js?v=1') }}"></script>
<script src="{{ asset('assets/js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('assets/js/extensions/export/jquery.base64.js') }}"></script>
<script src="{{ asset('assets/js/extensions/multiple-sort/bootstrap-table-multiple-sort.js') }}"></script>
<script>
$('.snipe-table').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
undefinedText: '',
iconsPrefix: 'fa',
showRefresh: true,
@if (isset($search))
search: true,
@endif
pageSize: {{ $snipeSettings->per_page }},
pagination: true,
sidePagination: 'server',
sortable: true,
cookie: true,
cookieExpire: '2y',
@if (isset($columns))
columns: {!! $columns !!},
@endif
mobileResponsive: true,
@if (isset($multiSort))
showMultiSort: true,
@endif
showExport: true,
showColumns: true,
exportDataType: 'all',
exportTypes: ['csv', 'excel', 'txt','json', 'xml'],
exportOptions: {
fileName: '{{ $exportFile . "-" }}' + (new Date()).toISOString().slice(0,10),
},
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
paginationLastText: "{{ trans('general.last') }}",
paginationPreText: "{{ trans('general.previous') }}",
paginationNextText: "{{ trans('general.next') }}",
pageList: ['10','25','50','100','150','200'],
icons: {
paginationSwitchDown: 'fa-caret-square-o-down',
paginationSwitchUp: 'fa-caret-square-o-up',
columns: 'fa-columns',
@if( isset($multiSort))
sort: 'fa fa-sort-amount-desc',
plus: 'fa fa-plus',
minus: 'fa fa-minus',
@endif
refresh: 'fa-refresh'
},
});
</script>