|
@@ -7,6 +7,7 @@ Meteor.startup(function() {
|
|
|
Meteor.subscribe("queues");
|
|
|
Meteor.subscribe("chat");
|
|
|
Meteor.subscribe("playlists");
|
|
|
+Meteor.subscribe("alerts");
|
|
|
|
|
|
var minterval;
|
|
|
var hpSound = undefined;
|
|
@@ -79,7 +80,6 @@ Handlebars.registerHelper('active', function(path) {
|
|
|
return curPath() == path ? 'active' : '';
|
|
|
});
|
|
|
|
|
|
-
|
|
|
Template.header.helpers({
|
|
|
currentUser: function() {
|
|
|
return Meteor.user();
|
|
@@ -536,6 +536,12 @@ Template.room.onRendered(function() {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+Template.alerts.helpers({
|
|
|
+ alerts: function() {
|
|
|
+ return Alerts.find({active: true});
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
Template.room.helpers({
|
|
|
chat: function() {
|
|
|
Meteor.setTimeout(function() {
|
|
@@ -666,6 +672,38 @@ Template.room.helpers({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+var allAlertSub = undefined;
|
|
|
+
|
|
|
+Template.alertsDashboard.onCreated(function() {
|
|
|
+ if (allAlertSub === undefined) {
|
|
|
+ allAlertSub = Meteor.subscribe("allAlerts");
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+Template.alertsDashboard.helpers({
|
|
|
+ "activeAlerts": function() {
|
|
|
+ return Alerts.find({active: true});
|
|
|
+ },
|
|
|
+ "inactiveAlerts": function() {
|
|
|
+ return Alerts.find({active: false});
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+Template.alertsDashboard.events({
|
|
|
+ "click #calart-create": function() {
|
|
|
+ Meteor.call("addAlert", $("#calert-description").val(), $("#calert-priority").val().toLowerCase(), function (err, res) {
|
|
|
+ if (err) {
|
|
|
+ alert("Error " + err.error + ": " + err.reason);
|
|
|
+ } else {
|
|
|
+ $("#calert-description").val("");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ "click #ralert-button": function() {
|
|
|
+ Meteor.call("removeAlerts");
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
Template.admin.helpers({
|
|
|
queueCount: function(i) {
|
|
|
var queues = Queues.find({}).fetch();
|