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,38 +1,46 @@
|
||||
<template name="userAccountMenu">
|
||||
{{#if currentUser}}
|
||||
<div id="userAccountMenu" class="row-fluid">
|
||||
<div class="list-group panel">
|
||||
<a href="#userMenu" class="list-group-item" id="userName" data-toggle="collapse" data-parent="#userAccountMenu">{{fullName}} {{currentPath}}<span class="caret"></span></a>
|
||||
|
||||
<div class="collapse pos-absolute" id="userMenu">
|
||||
|
||||
{{#if showWorklistMenu}}
|
||||
<a href="worklist" id="worklist" data-toggle="collapse" data-target="#userMenu" class="list-group-item sub-item">
|
||||
<div id="userAccountMenu" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{name}} {{currentPath}} | <i class="fa fa-cog fa-lg"></i>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
{{#if showWorklistMenu}}
|
||||
<li>
|
||||
<a href="worklist" id="worklist">
|
||||
<i class="fa fa-list-ul"></i> Worklist
|
||||
</a>
|
||||
{{else}}
|
||||
<!--TODO: Move this elsewhere in the Worklist? -->
|
||||
<span data-toggle="collapse" data-target="#userMenu" class="list-group-item sub-item externalItem">{{>optionsButton }}</span>
|
||||
<a href="audit" id="audit" data-toggle="collapse" data-target="#userMenu" class="list-group-item sub-item">
|
||||
</li>
|
||||
{{else}}
|
||||
<!--TODO: Move this elsewhere in the Worklist? -->
|
||||
<li>
|
||||
{{>optionsButton }}
|
||||
</li>
|
||||
<li>
|
||||
<a href="/audit" id="audit">
|
||||
<i class="fa fa-list-ul"></i> View Audit Log
|
||||
</a>
|
||||
{{/if}}
|
||||
|
||||
<a href="#itemSettings" class="list-group-item sub-item" data-toggle="collapse" data-parent="#itemSettings"><i class="fa fa-cog fa-lg"></i> Settings <span class="caret"></span></a>
|
||||
<div class="collapse list-group-submenu" id="itemSettings">
|
||||
<a href="#" id="serverInformation" class="list-group-item sub-sub-item" data-parent="#itemSettings" data-toggle="collapse" data-target="#itemSettings,#userMenu"><i class="fa fa-server fa-lg"></i> Server Information</a>
|
||||
</div>
|
||||
|
||||
<a href="#itemProfile" class="list-group-item sub-item" data-toggle="collapse" data-parent="#itemProfile" ><i class="fa fa-user fa-lg"></i> Profile <span class="caret"></span></a>
|
||||
<div class="collapse list-group-submenu" id="itemProfile">
|
||||
<a href="changePassword" id="changePassword" class="list-group-item sub-sub-item" data-parent="#itemProfile" data-toggle="collapse" data-target="#itemProfile,#userMenu"><i class="fa fa-lock"></i> Change Password</a>
|
||||
</div>
|
||||
|
||||
<a href="#" id="logoutButton" data-toggle="collapse" data-target="#userMenu" class="list-group-item sub-item">
|
||||
</li>
|
||||
{{/if}}
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<a id="serverInformation">
|
||||
<i class="fa fa-server fa-lg"></i> Server Information
|
||||
</a>
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<a href="changePassword" id="changePassword">
|
||||
<i class="fa fa-lock"></i> Change Password
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="logoutButton">
|
||||
<i class="fa fa-power-off"></i> Logout
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,34 +1,15 @@
|
||||
@import "{design}/app"
|
||||
|
||||
#userAccountMenu
|
||||
position: relative
|
||||
float: right
|
||||
padding: 5px
|
||||
height: 100%
|
||||
line-height: 40px
|
||||
z-index: 999
|
||||
|
||||
.list-group
|
||||
background-color: transparent
|
||||
color: white
|
||||
line-height: 35px
|
||||
margin-left: 10px
|
||||
.list-group-item
|
||||
padding: 5px 10px
|
||||
width: 200px
|
||||
a#userName
|
||||
padding: 0
|
||||
background-color: transparent
|
||||
color: white
|
||||
border: solid 1px transparent
|
||||
text-align: right
|
||||
display: inline-block
|
||||
width: auto
|
||||
#userMenu
|
||||
position: absolute
|
||||
right: 0
|
||||
.externalItem
|
||||
a
|
||||
color: #555
|
||||
.dropdown-toggle
|
||||
cursor: pointer
|
||||
text-decoration: none
|
||||
background-color: $primaryBackgroundColor
|
||||
color: $textSecondaryColor
|
||||
|
||||
.list-group-submenu
|
||||
.sub-sub-item
|
||||
padding-left: 20px
|
||||
padding-right: 20px
|
||||
ul.dropdown-menu
|
||||
li
|
||||
cursor: pointer
|
||||
Reference in new issue
Block a user