|
@@ -96,13 +96,12 @@
|
|
|
}
|
|
|
if(countInbox != 0){
|
|
|
$("#notifications-inbox").removeClass('d-none');
|
|
|
- $("#notifications-inbox").append(countFriends);
|
|
|
+ $("#notifications-inbox").append(countInbox);
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- $('#list_notifications').on('click', e => {
|
|
|
-
|
|
|
+ $('#list_notifications_friends').on('click', e => {
|
|
|
const $listFriends = $('#list_friends .content');
|
|
|
let $html;
|
|
|
$.get(
|
|
@@ -123,6 +122,30 @@
|
|
|
}
|
|
|
);
|
|
|
});
|
|
|
+
|
|
|
+ $('#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 = '<div class="dropdown-divider"></div>';
|
|
|
+ $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>
|
|
|
<div class="header navbar">
|
|
@@ -159,7 +182,7 @@
|
|
|
|
|
|
<li class="notifications dropdown">
|
|
|
<span id="notifications-social" class="counter d-none"></span>
|
|
|
- <a id="list_notifications" href="#" class="dropdown-toggle no-after" data-toggle="dropdown">
|
|
|
+ <a id="list_notifications_friends" href="#" class="dropdown-toggle no-after" data-toggle="dropdown">
|
|
|
<i class="far fa-bell"></i>
|
|
|
</a>
|
|
|
|
|
@@ -171,16 +194,27 @@
|
|
|
<span class="badge badge-pill badge-warning float-right">View all</span>
|
|
|
</a>
|
|
|
<div class="content">
|
|
|
-
|
|
|
+ <div class="spinner"></div>
|
|
|
</div>
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
<li class="notifications">
|
|
|
<span id="notifications-inbox" class="counter d-none"></span>
|
|
|
- <a href="{{ url('legacy_main', { 'name' : 'messages/inbox.php' }) }}" class="no-after">
|
|
|
+ <a id="list_notifications_inbox" href="#" class="dropdown-toggle no-after" data-toggle="dropdown">
|
|
|
<i class="far fa-envelope"></i>
|
|
|
</a>
|
|
|
+ <ul id="list_inbox" class="dropdown-menu ">
|
|
|
+ <a class="dropdown-item">
|
|
|
+ <p id="notifications_text" class="mb-0 font-weight-normal float-left">
|
|
|
+ Recent messages
|
|
|
+ </p>
|
|
|
+ <span class="badge badge-pill badge-warning float-right">View all</span>
|
|
|
+ </a>
|
|
|
+ <div class="content">
|
|
|
+ <div class="spinner"></div>
|
|
|
+ </div>
|
|
|
+ </ul>
|
|
|
</li>
|
|
|
|
|
|
<li class="dropdown">
|