File: /var/www/vhost/disk-apps/qas.sports-crowd.com/resources/views/notifications/notifications.blade.php
@extends('modules.head') @section('contenido')
<style>
/* 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;
}
.bold {
font-weight: bold;
}
.message {
min-width: 400px !important;
white-space: normal;
}
</style>
<div class="box-header">
<a class="btn btn-app btnReportProducts" onclick="clearAllNotifications()">
<i class="fa fa-trash"></i> {{ Lang::get('messages.screen_notifications_clear_all') }}
</a>
<a class="auxiliar-black" href="{{url('/notifications/add')}}">
<button class="btn btnAdd pull-right">
<i style="margin-right:5px;" class="fa fa-plus"></i>{{ Lang::get('messages.screen_notifications_tag1')}}
</button>
</a>
</div>
<!-- List notifications-->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.screen_notifications_tag2')}}</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">{{ Lang::get('messages.screen_notifications_tag3')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending"> {{ Lang::get('messages.screen_notifications_tag8')}} </th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending"> {{ Lang::get('messages.screen_notifications_tag10')}} </th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.screen_notifications_tag4')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.screen_notifications_tag6')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.screen_banners_tag23')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.screen_notifications_tag11')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.screen_notifications_tag5')}}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ __('messages.events.title_15')}}</th>
</tr>
</thead>
</table>
</div>
<!-- /.box-body -->
</div>
<script src="{{ asset('js/jQuery/jquery-2.2.3.min.js') }}"></script>
<script src="{{ asset('js/notifications.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
var sort_col = $('#example2').find("th:contains(" + Lang.get('messages.screen_notifications_tag5') + ")")[0].cellIndex;
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: [
[sort_col, 'desc']
],
language: {
url: window.DATATABLES_LANGUAGE_URL,
},
scrollX: true,
scrollCollapse: true,
paging: true,
fixedColumns: fixedColumns,
ajax: "{{ route('notifications.table') }}",
columns: [{
data: 'message',
className: "message",
name: 'message'
},
{
data: 'user',
name: 'user_id'
},
{
data: 'link',
name: 'link'
},
{
data: 'when_send',
name: 'when_send'
},
{
data: 'name',
name: 'admin_id'
},
{
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: 'notifications_origin',
name: 'notifications_origin'
},
{
data: 'created_at',
name: 'created_at'
},
{
data: 'actions',
name: 'actions'
},
]
});
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();
});
});
</script>
@endsection