mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
notification centre improvements
This commit is contained in:
parent
1bb6ecb2ba
commit
addd9a8f02
34 changed files with 80 additions and 13 deletions
|
@ -406,12 +406,16 @@ VE.notifications.get_list = function(){
|
|||
acc.push(tpl.finalize());
|
||||
});
|
||||
|
||||
if(!Object.keys(data).length){
|
||||
var tpl = Tpl.get('notification_empty', 'WEB');
|
||||
acc.push(tpl.finalize());
|
||||
}
|
||||
|
||||
$('.notification-container').html(acc.done()).show();
|
||||
|
||||
$('.notification-container .mark-seen').click(function(event){
|
||||
/// TODO add token
|
||||
VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", ""));
|
||||
// VE.notifications.delete($(event.target).attr('id').replace("notification-", ""));
|
||||
// VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", ""));
|
||||
VE.notifications.delete($(event.target).attr('id').replace("notification-", ""));
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -419,10 +423,12 @@ VE.notifications.get_list = function(){
|
|||
|
||||
|
||||
VE.notifications.delete = function(id){
|
||||
$('#notification-'+id).parents('li').remove();
|
||||
$('#notification-'+id).parents('li').hide();
|
||||
$.ajax({
|
||||
url: "/delete/notification/?delete=1¬ification_id="+id+"&token="+$('#token').attr('token')
|
||||
});
|
||||
if($('.notification-container li:visible').length == 0)
|
||||
$('.l-profile__notifications').removeClass('updates').removeClass('active');
|
||||
}
|
||||
|
||||
VE.notifications.mark_seen = function(id){
|
||||
|
|
|
@ -63,3 +63,4 @@ App.Constants.FM_READ_BY_OTHERS = '<?=__('read by others')?>';
|
|||
App.Constants.FM_WRITE_BY_OTHERS = '<?=__('write by others')?>';
|
||||
App.Constants.FM_EXECUTE_BY_OTHERS = '<?=__('execute/search by others')?>';
|
||||
|
||||
App.Constants.NOTIFICATIONS_EMPTY = '<?=__('no notifications')?>';
|
||||
|
|
|
@ -6,13 +6,18 @@ App.Templates.html = {
|
|||
WEB: {
|
||||
hint: [''],
|
||||
notification: [
|
||||
'<li class="~!:UNSEEN~!"><span class="mark-seen" id="notification-~!:ID~!"> </span>\
|
||||
<span class="title"><span class="icon ~!:TYPE~!"> </span>~!:TOPIC~!</span>\
|
||||
'<li class="~!:UNSEEN~!"><span class="unselectable mark-seen" id="notification-~!:ID~!"> </span>\
|
||||
<span class="title"><span class="unselectable icon ~!:TYPE~!"> </span>~!:TOPIC~!</span>\
|
||||
~!:NOTICE~!\
|
||||
</li>'
|
||||
],
|
||||
notification_empty: [
|
||||
'<li class="empty">\
|
||||
'+App.Constants.NOTIFICATIONS_EMPTY+'\
|
||||
</li>'
|
||||
]
|
||||
|
||||
},
|
||||
|
||||
// file manager
|
||||
//
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue