File: /var/www/vhost/disk-apps/teamdemo.sports-crowd.com/resources/views/videos_club/list.blade.php
@extends('modules.head')
@section('extra-css')
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');
*{
font-family: 'Poppins', sans-serif;
margin:0; padding:0;
box-sizing: border-box;
outline: none; border:none;
text-decoration: none;
text-transform: capitalize;
}
.container{
width: 100%;
max-width: 1200px;
margin:100px auto;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap:20px;
}
.container .main-video-container{
flex:1 1 700px;
height: 400px;
border-radius: 5px;
box-shadow: 0 5px 15px rgba(0,0,0,.1);
background-color: #fff;
padding:15px;
}
.container .main-video-container .main-video{
margin-bottom: 7px;
border-radius: 5px;
width: 100%;
}
.container .main-video-container .main-vid-title{
font-size: 20px;
color:#444;
}
.container .video-list-container{
flex:1 1 350px;
height: 400px;
overflow-y: scroll;
border-radius: 5px;
box-shadow: 0 5px 15px rgba(0,0,0,.1);
background-color: #fff;
padding:15px;
}
.container .video-list-container::-webkit-scrollbar{
width: 10px;
}
.container .video-list-container::-webkit-scrollbar-track{
background-color: #fff;
border-radius: 5px;
}
.container .video-list-container::-webkit-scrollbar-thumb{
background-color: #444;
border-radius: 5px;
}
.container .video-list-container .list{
display: flex;
align-items: center;
gap:15px;
padding:10px;
background-color: #eee;
cursor: pointer;
border-radius: 5px;
margin-bottom: 10px;
}
.container .video-list-container .list:last-child{
margin-bottom: 0;
}
.container .video-list-container .list.active{
background-color: #444;
}
.container .video-list-container .list.active .list-title{
color:#fff;
}
.container .video-list-container .list .list-video {
width: 100px;
height: 101.5px;
border-radius: 5px;
}
.container .video-list-container .list .list-title{
font-size: 17px;
color:#444;
}
@media (max-width:1200px){
.container{
margin:0;
}
}
@media (max-width:450px){
.container .main-video-container .main-vid-title{
font-size: 15px;
text-align: center;
}
.container .video-list-container .list{
flex-flow: column;
gap:10px;
}
.container .video-list-container .list .list-video{
width: 100%;
}
.container .video-list-container .list .list-title{
font-size: 15px;
text-align: center;
}
}
.badge-container {
position: relative;
display: inline-block;
}
.product-badge {
position: absolute;
top: 10px;
}
.expiredDate {
background-color: #FB5656 !important;
}
</style>
@endsection
@section('contenido')
<div class="box-header">
<a class="auxiliar-black" href="{{ url('/videos/add') }}">
<button class="btn btnAdd pull-right">
<i style="margin-right:5px;" class="fa fa-plus"></i>
{{ Lang::get('messages.videos_club.add') }}
</button></a>
</div>
<!-- List Data -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ Lang::get('messages.videos_club.title') }}</h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive ">
<table id="example2" class="table table-bordered table-hover dataTable" 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.videos_club.name') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.title_table') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.created_at') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.init_date') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.end_date') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.description') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.academy_tournaments.segmentation') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.likes_enabled') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.comments_enabled') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">{{ Lang::get('messages.videos_club.active') }}</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">{{ Lang::get('messages.videos_club.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/videos_club.js') . '?v=' . time() }}"></script>
<script src="{{ asset('js/bootstrap/js/bootstrap.min.js') }}"></script>
<script async src="//www.instagram.com/embed.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var sort_col = $('#example2').find("th:contains(" + Lang.get('messages.videos_club.name')+ ")")[0].cellIndex;
_table = $('#example2').DataTable({
responsive: true,
processing: true,
serverSide: true,
order: [
[sort_col, 'desc']
],
language: {
url: window.DATATABLES_LANGUAGE_URL,
},
ajax: "{{ route('videos.table') }}",
columns: [
{
data: 'name',
name: 'name'
},
{
data: 'image',
name: 'image'
},
{
data: 'created_at',
name: 'created_at'
},
{
data: 'init_date',
name: 'init_date'
},
{
data: 'end_date',
name: 'end_date'
},
{
data: 'description',
name: 'description'
},
{
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: 'likes_enabled',
name: 'likes_enabled',
render: function(data) {
return data == 1 ? 'Sí' : 'No';
}
},
{
data: 'comments_enabled',
name: 'comments_enabled',
render: function(data) {
return data == 1 ? 'Sí' : 'No';
}
},
{
data: 'active',
name: 'active'
},
{
data: 'actions',
name: 'actions'
},
],
"createdRow": function(row, data, dataIndex) {
var currentDate = new Date();
var endDate = new Date(data.end_date);
console.log(endDate, currentDate, "data fechas");
if (endDate < currentDate) {
console.log(data, "data");
$(row).addClass('expiredDate');
}
}
});
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