Various changes including contact messages in database, contact message notifications, notification emails, bugfixes and more
This commit is contained in:
@@ -48,9 +48,7 @@ function loadPosts(onLoad) {
|
||||
},
|
||||
success: function (data) {
|
||||
const $items = $(data);
|
||||
console.log(data);
|
||||
if(onLoad) {
|
||||
// $('#social-posts').isotope('insert', $items);
|
||||
$('#social-posts').append($items)
|
||||
.isotope('appended', $items);
|
||||
$('#load-more-button').fadeIn();
|
||||
@@ -61,11 +59,7 @@ function loadPosts(onLoad) {
|
||||
$('#load-more-button').html($('#load-more-button').attr('data-load'));
|
||||
autoHeight();
|
||||
$('#social-posts').isotope({filter: '*'}).isotope('layout');
|
||||
// $('#social-posts-list .social-post-item').each(function () {
|
||||
// $(this).css('height', $(this).outerHeight());
|
||||
// });
|
||||
offset += 1;
|
||||
// data = ' ';
|
||||
if(data === ' ') {
|
||||
$('#load-more-button').fadeOut().delay(1000).remove();
|
||||
$('#social-post-container').parent().append('<div class="alert alert-warning">' + $('#social-post-container').attr('data-error-msg') + '</div>');
|
||||
|
@@ -149,6 +149,7 @@ function sendContactMessage() {
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
$('#contactModal .modal-loading-container .modal-loading-icon i').removeClass('fa-cog fa-spin').addClass('fa-times').parents('.modal-loading-icon').addClass('error').append('<span>Ein unbekannter Fehler ist aufgetreten</span>');
|
||||
}
|
||||
});
|
||||
@@ -314,8 +315,9 @@ function loadNotificationsAsync() {
|
||||
if (data.status === 'success') {
|
||||
const container = $('#notificationMenu .list-group');
|
||||
for (let notification of data.notifications) {
|
||||
console.log(notification);
|
||||
container.append(`
|
||||
<a href="${notification.link}" class="list-group-item list-group-item-action flex-column align-items-start ${notification.unread === 1 ? '' : 'disabled'}">
|
||||
<a href="${notification.link}" class="list-group-item list-group-item-action flex-column align-items-start ${notification.unread ? '' : 'disabled'}">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">${notification.sender}</h5>
|
||||
<small>${notification.time}</small>
|
||||
@@ -325,7 +327,7 @@ function loadNotificationsAsync() {
|
||||
`)
|
||||
}
|
||||
if (data.notifications.length > 0) {
|
||||
const unread = data.notifications.filter(e => e.unread === 1);
|
||||
const unread = data.notifications.filter(e => e.unread);
|
||||
if (unread.length > 0) {
|
||||
$('#notificationCount').text(unread.length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user