|
@@ -229,7 +229,7 @@ Template.header.helpers({
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
Template.header.events({
|
|
Template.header.events({
|
|
@@ -343,6 +343,20 @@ Template.dashboard.helpers({
|
|
} else {
|
|
} else {
|
|
return {};
|
|
return {};
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ isAdmin: function() {
|
|
|
|
+ if (Meteor.user() && Meteor.user().profile) {
|
|
|
|
+ return Meteor.user().profile.rank === "admin";
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ isModerator: function() {
|
|
|
|
+ if (Meteor.user() && Meteor.user().profile && (Meteor.user().profile.rank === "admin" || Meteor.user().profile.rank === "moderator")) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -361,18 +375,6 @@ Template.dashboard.onCreated(function() {
|
|
Session.set("type", undefined);
|
|
Session.set("type", undefined);
|
|
});
|
|
});
|
|
|
|
|
|
-Template.dashboard.onRendered(function(){
|
|
|
|
- Rooms.find().fetch().forEach(function(room){
|
|
|
|
- if(room.private === true){
|
|
|
|
- $(".station h3").each(function(i, el){
|
|
|
|
- if($(el).text() === room.display && Meteor.user().profile.rank !== "admin"){
|
|
|
|
- $(el).parent().css("display", "none");
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
function executeCommand(command, params){
|
|
function executeCommand(command, params){
|
|
if (command === "help" || command === "commands") {
|
|
if (command === "help" || command === "commands") {
|
|
$('#helpModal').modal('show');
|
|
$('#helpModal').modal('show');
|