Commit 17630149 authored by Adrian Guthmann's avatar Adrian Guthmann

added Bert alert for admins

parent f2380d0f
......@@ -51,7 +51,8 @@
"reportedcardsetadmin": "Adminbenachrichtigung (Gemeldeter Kartensatz)",
"lecturer": "Dozenten-Anfrage",
"heading": "Aufgaben warten!",
"content": "Im Kartensatz: "
"content": "Im Kartensatz: ",
"admin": "Sie sind ein Admin!"
},
"input-group": {
"newcarddeck": "Neuer Kartensatz"
......
......@@ -49,7 +49,8 @@
"reportedcardset": "Reported cardset",
"reporteduseradmin": "Admin notification (Reported user)",
"reportedcardsetadmin": "Admin notification (Reported cardset)",
"lecturer": "Lecturer request"
"lecturer": "Lecturer request",
"admin": "You're an admin!"
},
"input-group": {
"newcarddeck": "New deck of cards"
......
......@@ -44,6 +44,7 @@ export function notification(title, message) {
}
var query = {};
var popup = true;
function prepareQuery() {
query = {};
......@@ -210,8 +211,17 @@ Template.category.onDestroyed(function () {
});
Template.pool.onRendered(function () {
var toLearn = Cardsets.find({webNotification: true, learningActive: true}).fetch();
for (var i = 0; i < toLearn.length; ++i) {
notification(TAPi18n.__('notifications.heading'), TAPi18n.__('notifications.content') + toLearn[i].name);
if (popup) {
if (Meteor.userId() && Roles.userIsInRole(Meteor.userId(), [
'admin',
'editor'
])) {
Bert.alert(TAPi18n.__('notifications.admin'), 'success', 'growl-bottom-right');
}
var toLearn = Cardsets.find({webNotification: true, learningActive: true}).fetch();
for (var i = 0; i < toLearn.length; ++i) {
notification(TAPi18n.__('notifications.heading'), TAPi18n.__('notifications.content') + toLearn[i].name);
}
popup = false;
}
});
{
"public": {
"rooturl": "http://localhost:3000",
"cas": {
"loginUrl": "https://cas.thm.de/cas/login",
"serviceParam": "service",
"popupWidth": 810,
"popupHeight": 610
},
"displayLoginButtons": {
"displayFacebook": true,
"displayTwitter": true,
"displayGoogle": true,
"displayCas": true
},
"env": "Sandbox",
"BT_MERCHANT_ID": "7jspbjz7zk4vkh67",
"BT_PUBLIC_KEY": "bf7p9crbdv2359gv"
},
"private": {
"BT_PRIVATE_KEY": "b508f71a0e0b01940b0fbe75940debb9"
},
"admin": {
"name": "hg13345"
},
"facebook": {
"api": "162760697401847",
"secret": "151daa9c4bc95310e9e1fb90accd70f8"
},
"twitter": {
"api": "I8LcQC0NetusL9c5F3EFJUXMl",
"secret": "2z0kNAtYcSU5lQKk6FDRR60gxuFawB4TM7tWvnU7yKk6EHHpYh"
},
"google": {
"api": "131328643116-j00jrgjupbbfeft1a9o0p5ling05vsus.apps.googleusercontent.com",
"secret": "2-P5Vy6VI0eOrKIlOCZZq8cR"
},
"cas": {
"baseUrl": "https://cas.thm.de/cas",
"autoClose": true
}
}
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