File: /var/www/vhost/disk-apps/alq-cali.bikenow.co/resources/views/app_section/list.blade.php
@extends('modules.head') @section('contenido')
<style>
a:hover,
a:active,
a:focus {
outline: none;
text-decoration: none;
color: #797D7F !important;
}
/* Ensure that the demo table scrolls */
/* th, */
td {
white-space: nowrap;
}
div.dataTables_wrapper {
height: fit-content;
margin: 0px 10px 0px 10px;
}
.dataTables_scrollBody {
max-height: none !important;
}
</style>
<div class="box-header">
<a class="auxiliar-black" href="{{ route('app_section.create') }}">
<button class="btn btnAdd pull-right">
<i style="margin-right:5px;" class="fa fa-plus"></i>{{ __('messages.app_section.add') }}
</button></a>
</div>
<!-- List -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ __('messages.app_section.list') }}</h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive ">
<table id="example2" class="stripe row-border order-column" style="width:100%" role="grid" aria-describedby="example2_info">
<thead>
<tr role="row">
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.name') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.image') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.description') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.path') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.priority') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.button_width') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.icon_name') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.text_color') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.button_color') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.button_link') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.tab') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.validate_data_type') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.chip_new') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.enable_on_home') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.enable_on_tabs') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.enable_on_settings') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.enable_section_on_home') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.app_section.link_section_home') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.carnet.segmentation') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">
{{ __('messages.tag.active') }}
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">
{{ __('messages.tag.actions') }}
</th>
</tr>
</thead>
</table>
</div>
<!-- /.box-body -->
</div>
<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/crud.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/app_section.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
let fixedColumns = false;
let isMobileDevice = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
if (!isMobileDevice) {
fixedColumns = {
left: 1,
right: 2
};
}
_table = $('#example2').DataTable({
responsive: true,
processing: true,
serverSide: true,
order: [],
language: {
url: window.DATATABLES_LANGUAGE_URL,
},
scrollX: true,
scrollCollapse: true,
paging: true,
fixedColumns: fixedColumns,
ajax: "{{ route('app_section.table') }}",
columns: [{
data: 'name',
name: 'name'
},
{
data: 'button_image',
name: 'button_image'
},
{
data: 'description',
name: 'description'
},
{
data: 'path',
name: 'path'
},
{
data: 'button_order',
name: 'button_order'
},
{
data: 'width',
name: 'button_width'
},
{
data: 'icon_name',
name: 'icon_name'
},
{
data: 'button_text_color',
name: 'button_text_color'
},
{
data: 'button_color',
name: 'button_color'
},
{
data: 'button_link',
name: 'button_link'
},
{
data: 'tab',
name: 'tab'
},
{
data: 'validate_data_type',
name: 'validate_data_type'
},
{
data: 'chip_new',
render: function(data, type, row) {
return row.chip_new ? 'Activo' : 'Inactivo';
},
name: 'chip_new'
},
{
data: 'enable_on_home',
render: function(data, type, row) {
return row.enable_on_home ? 'Activo' : 'Inactivo';
},
name: 'enable_on_home'
},
{
data: 'enable_on_tabs',
render: function(data, type, row) {
return row.enable_on_tabs ? 'Activo' : 'Inactivo';
},
name: 'enable_on_tabs'
},
{
data: 'enable_on_settings',
render: function(data, type, row) {
return row.enable_on_settings ? 'Activo' : 'Inactivo';
},
name: 'enable_on_settings'
},
{
data: 'enable_section_on_home',
render: function(data, type, row) {
return row.enable_section_on_home ? 'Activo' : 'Inactivo';
},
name: 'enable_section_on_home'
},
{
data: 'link_section_home',
fnCreatedCell: function(nTd, sData, oData, iRow, iCol) {
return sData ? $(nTd).html("<a href='" + sData + "' target='_blank'>Ver imagen</a>") : "";
},
name: 'link_section_home'
},
{
data: 'segmentation',
render: function(data, type, row) {
let tags = '';
if (row.segmentation) {
let list = row.segmentation.split(',');
let data = list.map(function(d) {
return '<li>' + d + '</li>';
});
tags = data.join('');
}
return tags;
},
name: 'tags.name',
},
{
data: 'active',
name: 'active'
},
{
data: 'actions',
name: 'actions'
}
]
});
// Paginacion
$('#example2').on('page.dt', function() {
window.actualPage = $('#example2').DataTable().page();
localStorage.setItem("setPaginaActual", $('#example2').DataTable().page());
});
$('#example2').on('init.dt', function() {
if (localStorage.getItem("setPaginaActual")) {
let paginationCurrent = Number(localStorage.getItem("setPaginaActual", $('#example2').DataTable().page()));
if (parseInt(localStorage.getItem("setPaginaActual")) != paginationCurrent)
$('#example2').DataTable().page(paginationCurrent).draw('page');
}
});
var info = '<i class="fa fa-info-circle" id="btn-info-busqueda"></i><div class="dropdown-menu" id="menuBusqueda" style="left: 50%; padding: 5px; background-color: #f9fb8f;"><p data-toggle="modal">Busqueda por Nombre, Orden y Link</p></div>';
$('#example2_filter').append(info);
$('#btn-info-busqueda').on('click', function() {
$('#menuBusqueda').toggle();
});
});
// Paginacion inicial
var URLactual = window.location.href;
document.addEventListener('click', function(e) {
if (e.target.closest('a')) {
var href = e.target.closest('a').href || '';
href = href.split('#')[0];
if (URLactual != href) {
localStorage.setItem("setPaginaActual", 0);
}
}
}, false);
</script>
@endsection