LT-162: Add server information modal in user account menu
This commit is contained in:
1 parent
72ecc5b40d
commit
161bbba5cf
12 files changed
+213
-80
No files matched your search
@@ -0,0 +1,54 @@
|
||||
Template.userAccountMenu.helpers({
|
||||
fullName: function() {
|
||||
return Meteor.user().profile.fullName;
|
||||
},
|
||||
|
||||
showWorklistMenu: function() {
|
||||
return Template.instance().showWorklistMenu.get();
|
||||
},
|
||||
|
||||
currentUser: function() {
|
||||
var verifyEmail = Meteor.settings && Meteor.settings.public && Meteor.settings.public.verifyEmail || false;
|
||||
|
||||
if (!Meteor.user() || !Meteor.userId()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!verifyEmail) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Meteor.user().emails[0].verified) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
Template.userAccountMenu.onCreated(function() {
|
||||
// showViewer to go to viewer from audit
|
||||
this.showWorklistMenu = new ReactiveVar(true);
|
||||
// Get url and check worklist
|
||||
var currentPath = Router.current().route.path(this);
|
||||
if (currentPath === '/' || currentPath === '/worklist') {
|
||||
this.showWorklistMenu.set(false);
|
||||
}
|
||||
});
|
||||
|
||||
Template.userAccountMenu.events({
|
||||
'click #serverInformation': function() {
|
||||
$('#serverInformationModal').modal('show');
|
||||
},
|
||||
'click #logoutButton': function() {
|
||||
Meteor.logout(function() {
|
||||
Router.go('/entrySignIn');
|
||||
});
|
||||
},
|
||||
'click #worklist': function(e, template) {
|
||||
template.showWorklistMenu.set(false);
|
||||
},
|
||||
'click #audit': function(e, template) {
|
||||
template.showWorklistMenu.set(true);
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user