2016-01-24 09:12:10 +01:00
|
|
|
// at the beginning
|
|
|
|
|
Session.set("templateName", "start");
|
2015-12-27 06:26:48 +01:00
|
|
|
|
2016-01-24 09:12:10 +01:00
|
|
|
Template.body.helpers({
|
|
|
|
|
template_name: function() {
|
|
|
|
|
return Session.get("templateName");
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-10-15 15:58:41 +02:00
|
|
|
|
|
|
|
|
controller_state = function() {
|
|
|
|
|
var controller = Session.get('controller_id');
|
|
|
|
|
var result = {}
|
|
|
|
|
if (controller) {
|
|
|
|
|
result = ControllerState.findOne({
|
|
|
|
|
controller_id: controller
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!result) {
|
|
|
|
|
result = {}
|
|
|
|
|
};
|
|
|
|
|
return result;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
accessible = function(feature) {
|
|
|
|
|
var controller = controller_state();
|
|
|
|
|
|
|
|
|
|
console.log('cotnroller ', controller);
|
|
|
|
|
if (!controller.features) return false;
|
|
|
|
|
|
|
|
|
|
return controller.features[feature] === true;
|
|
|
|
|
}
|