Lesion Tracker Redesign so far
This commit is contained in:
1 parent
b247e89d8b
commit
a9a4f3f82b
109 files changed
+2972
-936
No files matched your search
@@ -1,12 +1,15 @@
|
||||
Template.userAccountMenu.helpers({
|
||||
fullName: function() {
|
||||
return Meteor.user().profile.fullName;
|
||||
name: function() {
|
||||
var nameSplit = Meteor.user().profile.fullName.split(' ');
|
||||
var lastName = nameSplit[nameSplit.length - 1];
|
||||
nameSplit[nameSplit.length - 1] = lastName.substr(0, 1) + '.';
|
||||
return nameSplit.join(' ');
|
||||
},
|
||||
currentUser: function() {
|
||||
var verifyEmail = Meteor.settings && Meteor.settings.public && Meteor.settings.public.verifyEmail || false;
|
||||
|
||||
if (!Meteor.user() || !Meteor.userId()) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!verifyEmail) {
|
||||
@@ -17,18 +20,13 @@ Template.userAccountMenu.helpers({
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Meteor.user().emails[0].verified) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return !!Meteor.user().emails[0].verified;
|
||||
},
|
||||
showWorklistMenu: function() {
|
||||
var currentPath = Router.current().route.path(this);
|
||||
if (currentPath === '/' || currentPath === '/worklist') {
|
||||
return false;
|
||||
if (currentPath !== '/' && currentPath !== '/worklist') {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -39,8 +37,62 @@ Template.userAccountMenu.events({
|
||||
'click #logoutButton': function() {
|
||||
// Remove reviewers info for the user
|
||||
Meteor.call('removeUserFromReviewers', Meteor.userId());
|
||||
|
||||
Meteor.logout(function() {
|
||||
Router.go('/entrySignIn');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Template.userAccountMenu.onRendered(function() {
|
||||
var oldUserId;
|
||||
var lastLoginModalInterval;
|
||||
|
||||
this.autorun(function() {
|
||||
// Hook login/logout
|
||||
var user = Meteor.user();
|
||||
var newUserId = user._id;
|
||||
|
||||
if (oldUserId === null && newUserId) {
|
||||
Session.set('showLastLoginModal', true);
|
||||
|
||||
// Log
|
||||
HipaaLogger.logEvent({
|
||||
eventType: 'init',
|
||||
userId: user._id,
|
||||
userName: user.fullName
|
||||
});
|
||||
|
||||
} else if (newUserId === null && oldUserId) {
|
||||
// Set showLastLoginModal as null
|
||||
Session.set('showLastLoginModal', null);
|
||||
|
||||
// Destroy interval for last login modal
|
||||
Meteor.clearInterval(lastLoginModalInterval);
|
||||
console.log('The user logged out');
|
||||
|
||||
// Log
|
||||
// TODO: eventType is not defined for logout in hipaa-audit-log
|
||||
/*HipaaLogger.logEvent({
|
||||
eventType: 'logout',
|
||||
userId: oldUserId,
|
||||
userName: userName
|
||||
});*/
|
||||
|
||||
// Remove the user from Reviewers
|
||||
Meteor.call('removeUserFromReviewers', oldUserId);
|
||||
}
|
||||
|
||||
oldUserId = Meteor.userId();
|
||||
|
||||
// Trigger last login date popup
|
||||
if (Session.get('showLastLoginModal')) {
|
||||
Modal.show('lastLoginModal');
|
||||
|
||||
lastLoginModalInterval = Meteor.setInterval(function() {
|
||||
Modal.hide('lastLoginModal');
|
||||
Session.set('showLastLoginModal', null);
|
||||
}, 3000);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user