|
|
|
@ -1,106 +1,71 @@ |
|
|
|
|
{% autoescape false %} |
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
$(window).resize(function(){ |
|
|
|
|
var widthScreen = $(window).width(); |
|
|
|
|
if(widthScreen >= 1400){ |
|
|
|
|
$('body').addClass('sidebar-lg-show'); |
|
|
|
|
} else { |
|
|
|
|
$('body').removeClass('sidebar-lg-show'); |
|
|
|
|
} |
|
|
|
|
var main = $('#app-main'); |
|
|
|
|
var cardMain = $('#card-container'); |
|
|
|
|
var highAverage = main.height() - cardMain.height()-100; |
|
|
|
|
|
|
|
|
|
cardMain.css("height", highAverage+cardMain.height()+"px"); |
|
|
|
|
if(cardMain.height()>850){ |
|
|
|
|
cardMain.css("height", "auto"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$(document).ready(function() { |
|
|
|
|
//Width calculation for Sidebar |
|
|
|
|
var widthScreen = $(window).width(); |
|
|
|
|
|
|
|
|
|
if(widthScreen >= 1400){ |
|
|
|
|
$('body').addClass('sidebar-lg-show'); |
|
|
|
|
} |
|
|
|
|
// Calculation of Width for Card Container |
|
|
|
|
|
|
|
|
|
var main = $('#app-main'); |
|
|
|
|
var cardMain = $('#card-container'); |
|
|
|
|
var highAverage = main.height() - cardMain.height()-100; |
|
|
|
|
|
|
|
|
|
//cardMain.css("height", highAverage+cardMain.height()+"px"); |
|
|
|
|
cardMain.css("height", highAverage+cardMain.height()+"px"); |
|
|
|
|
if(cardMain.height()>850 || widthScreen <= 600){ |
|
|
|
|
cardMain.css("height", "auto"); |
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
$(function () { |
|
|
|
|
/** |
|
|
|
|
* Notifications Systems |
|
|
|
|
*/ |
|
|
|
|
$.get( |
|
|
|
|
'{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}', |
|
|
|
|
{'a': 'get_count_message'}, |
|
|
|
|
function (data) { |
|
|
|
|
var countFriends = data.ms_friends; |
|
|
|
|
var countInbox = data.ms_inbox |
|
|
|
|
if (countFriends != 0) { |
|
|
|
|
$("#notifications-social").removeClass('d-none'); |
|
|
|
|
$("#notifications-social").append(countFriends); |
|
|
|
|
} |
|
|
|
|
if (countInbox != 0) { |
|
|
|
|
$("#notifications-inbox").removeClass('d-none'); |
|
|
|
|
$("#notifications-inbox").append(countInbox); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Notifications Systems |
|
|
|
|
*/ |
|
|
|
|
$('#list_notifications_friends').on('click', e => { |
|
|
|
|
const $listFriends = $('#list_friends .content'); |
|
|
|
|
let $html; |
|
|
|
|
$.get( |
|
|
|
|
'{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}', |
|
|
|
|
{'a': 'get_count_message'}, |
|
|
|
|
{'a': 'get_notifications_friends'}, |
|
|
|
|
function (data) { |
|
|
|
|
var countFriends = data.ms_friends; |
|
|
|
|
var countInbox = data.ms_inbox |
|
|
|
|
if (countFriends != 0) { |
|
|
|
|
$("#notifications-social").removeClass('d-none'); |
|
|
|
|
$("#notifications-social").append(countFriends); |
|
|
|
|
} |
|
|
|
|
if(countInbox != 0){ |
|
|
|
|
$("#notifications-inbox").removeClass('d-none'); |
|
|
|
|
$("#notifications-inbox").append(countInbox); |
|
|
|
|
$listFriends.empty(); |
|
|
|
|
for (let i in data) { |
|
|
|
|
$html = '<a class="dropdown-item preview-item">'; |
|
|
|
|
$html += '<div class="preview-thumbnail"><img class="rounded-circle" src="' + data[i].avatar + '"/></div>'; |
|
|
|
|
$html += '<div class="preview-item-content flex-grow">'; |
|
|
|
|
$html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">' + data[i].date + '</span></h6>'; |
|
|
|
|
$html += '<p class="preview-text">' + data[i].content + '</p>'; |
|
|
|
|
$html += '</div></a>'; |
|
|
|
|
$listFriends.append($html); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#list_notifications_friends').on('click', e => { |
|
|
|
|
const $listFriends = $('#list_friends .content'); |
|
|
|
|
let $html; |
|
|
|
|
$.get( |
|
|
|
|
'{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}', |
|
|
|
|
{'a': 'get_notifications_friends'}, |
|
|
|
|
function (data) { |
|
|
|
|
$listFriends.empty(); |
|
|
|
|
for (let i in data){ |
|
|
|
|
$html = '<a class="dropdown-item preview-item">'; |
|
|
|
|
$html += '<div class="preview-thumbnail"><img class="rounded-circle" src="'+data[i].avatar+'"/></div>'; |
|
|
|
|
$html += '<div class="preview-item-content flex-grow">'; |
|
|
|
|
$html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">'+data[i].date+'</span></h6>'; |
|
|
|
|
$html += '<p class="preview-text">' + data[i].content + '</p>'; |
|
|
|
|
$html += '</div></a>'; |
|
|
|
|
$listFriends.append($html); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#list_notifications_inbox').on('click', e => { |
|
|
|
|
const $listInbox = $('#list_inbox .content'); |
|
|
|
|
let $html; |
|
|
|
|
$.get( |
|
|
|
|
'{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}', |
|
|
|
|
{'a': 'get_notifications_inbox'}, |
|
|
|
|
function (data) { |
|
|
|
|
$listInbox.empty(); |
|
|
|
|
for (let i in data){ |
|
|
|
|
$html = '<a class="dropdown-item preview-item" href="'+data[i].url+'">'; |
|
|
|
|
$html += '<div class="preview-thumbnail"><div class="preview-icon bg-info">'; |
|
|
|
|
$html += '<i class="far fa-envelope"></i>'; |
|
|
|
|
$html += '</div></div>'; |
|
|
|
|
$html += '<div class="preview-item-content flex-grow">'; |
|
|
|
|
$html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">'+data[i].date+'</span></h6>'; |
|
|
|
|
$html += '<p class="preview-text">' + data[i].title + '</p>'; |
|
|
|
|
$html += '</div></a>'; |
|
|
|
|
$listInbox.append($html); |
|
|
|
|
} |
|
|
|
|
$('#list_notifications_inbox').on('click', e => { |
|
|
|
|
const $listInbox = $('#list_inbox .content'); |
|
|
|
|
let $html; |
|
|
|
|
$.get( |
|
|
|
|
'{{ url('legacy_main', { name : 'inc/ajax/message.ajax.php'}) }}', |
|
|
|
|
{'a': 'get_notifications_inbox'}, |
|
|
|
|
function (data) { |
|
|
|
|
$listInbox.empty(); |
|
|
|
|
for (let i in data) { |
|
|
|
|
$html = '<a class="dropdown-item preview-item" href="' + data[i].url + '">'; |
|
|
|
|
$html += '<div class="preview-thumbnail"><div class="preview-icon bg-info">'; |
|
|
|
|
$html += '<i class="far fa-envelope"></i>'; |
|
|
|
|
$html += '</div></div>'; |
|
|
|
|
$html += '<div class="preview-item-content flex-grow">'; |
|
|
|
|
$html += '<h6 class="preview-subject">' + data[i].fullname + '<span class="date-ago float-right">' + data[i].date + '</span></h6>'; |
|
|
|
|
$html += '<p class="preview-text">' + data[i].title + '</p>'; |
|
|
|
|
$html += '</div></a>'; |
|
|
|
|
$listInbox.append($html); |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
<header class="app-header navbar"> |
|
|
|
|
<button class="navbar-toggler sidebar-toggler d-lg-none mr-auto" type="button" data-toggle="sidebar-show"> |
|
|
|
|
<span class="navbar-toggler-icon"></span> |
|
|
|
|