Commit 2773151f authored by Christopher Fullarton's avatar Christopher Fullarton

Resolve jscs errors

parent 9751d1bc
......@@ -38,6 +38,7 @@
"getUserLanguage": true,
"moment": true,
"ServiceConfiguration": true,
"ActiveRoute": true
"ActiveRoute": true,
"prompt": true
}
}
//------------------------ IMPORTS
import {Meteor } from 'meteor/meteor';
import {Template } from 'meteor/templating';
import {Session } from 'meteor/session';
import {Meteor} from 'meteor/meteor';
import {Template} from 'meteor/templating';
import {Notifications } from '../../api/notifications.js';
......@@ -30,13 +29,21 @@ Template.admin_main.events({
Router.go('home');
},
'click #notificationsBtn_admin': function () {
var notifications = Notifications.find({read: false, target_type: 'admin', target: Meteor.userId() });
var notifications = Notifications.find({
read: false,
target_type: 'admin',
target: Meteor.userId()
});
notifications.forEach(function (notification) {
Meteor.call("setNotificationAsRead", notification._id);
});
},
'click #clearBtn_admin': function () {
var notifications = Notifications.find({cleared: false, target_type: 'admin', target: Meteor.userId()});
var notifications = Notifications.find({
cleared: false,
target_type: 'admin',
target: Meteor.userId()
});
notifications.forEach(function (notification) {
Meteor.call("setNotificationAsCleared", notification._id);
});
......@@ -50,13 +57,20 @@ Template.admin_main.helpers({
}
},
countNotifications: function () {
return Notifications.find({read: false, target_type: 'admin', target: Meteor.userId() }).count();
return Notifications.find({
read: false,
target_type: 'admin',
target: Meteor.userId()
}).count();
},
getNotifications: function () {
return Notifications.find({cleared: false, target_type: 'admin', target: Meteor.userId() }, {sort: {date: -1}});
return Notifications.find({
cleared: false,
target_type: 'admin',
target: Meteor.userId()
}, {sort: {date: -1}});
},
getLink: function () {
if (this.type === "Adminbenachrichtigung (Gemeldeter Kartensatz)" || this.type === "Gemeldeter Kartensatz") {
return "/admin/cardset/" + this.link_id;
} else {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment