Initial commit
This commit is contained in:
commit
35745a89ec
44 changed files with 3342 additions and 0 deletions
51
client/General/headerbar.js
Normal file
51
client/General/headerbar.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { UpdateInfo } from '../../imports/api/updateInfo.js';
|
||||
|
||||
Template.headerBar.onCreated(function() {
|
||||
this.subscribe("UpdateVersion");
|
||||
this.subscribe("assignment");
|
||||
});
|
||||
|
||||
Template.headerBar.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.headerBar.helpers({
|
||||
adminReg: function() {
|
||||
return Session.get("adminreg");
|
||||
},
|
||||
myTheme: function() {
|
||||
return Session.get("myTheme");
|
||||
},
|
||||
updateExists: function() {
|
||||
let update = UpdateInfo.find({ viewed: false }).fetch();
|
||||
if (update.length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Template.headerBar.events({
|
||||
'click .navBtn' (event) {
|
||||
event.preventDefault();
|
||||
var clickedTarget = event.target.id;
|
||||
// console.log("clicked " + clickedTarget);
|
||||
if (clickedTarget == 'mainMenu') {
|
||||
FlowRouter.go('/');
|
||||
} else {
|
||||
// console.log("should be going to /" + clickedTarget);
|
||||
FlowRouter.go('/' + clickedTarget);
|
||||
}
|
||||
},
|
||||
'click .signOut': () => {
|
||||
FlowRouter.go('/');
|
||||
Meteor.logout();
|
||||
},
|
||||
'click #brandLogo' (event) {
|
||||
event.preventDefault();
|
||||
// FlowRouter.go('/dashboard');
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue