Adapting header to the new structure

This commit is contained in:
Bruno Alves de Faria committed 2017-03-21 10:16:47 -03:00
1 parent 2d52c9ef0a
commit e83b5348ff
34 files changed
+395 -154

No files matched your search

+46 -3
View File
@@ -1,3 +1,6 @@
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { ReactiveVar } from 'meteor/reactive-var';
import { OHIF } from 'meteor/ohif:core';
const studylistContentId = 'studylistTab';
@@ -7,12 +10,50 @@ const viewerContentId = 'viewerTab';
// If there is currently any Session data for this object,
// use this to repopulate the variable
Template.app.onCreated(() => {
const instance = Template.instance();
instance.headerClasses = new ReactiveVar('');
ViewerData = Session.get('ViewerData') || {};
OHIF.header.setDropdownItems([{
action: OHIF.user.audit,
text: 'View Audit Log',
iconClasses: 'log',
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#log',
separatorAfter: true
}, {
action: () => OHIF.ui.showDialog('themeSelectorModal'),
text: 'Themes',
iconClasses: 'theme',
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#theme',
separatorAfter: true
}, {
action: () => OHIF.ui.showDialog('serverInformationModal'),
text: 'Server Information',
iconClasses: 'server',
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#server',
separatorAfter: true
}, {
action: OHIF.user.changePassword,
text: 'Change Password',
iconClasses: 'password',
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#password'
}, {
action: OHIF.user.logout,
text: 'Logout',
iconClasses: 'logout',
iconSvgUse: 'packages/ohif_user-management/assets/user-menu-icons.svg#logout'
}]);
instance.autorun(() => {
const contentId = Session.get('activeContentId');
instance.headerClasses.set(contentId === viewerContentId ? '' : 'header-big');
});
});
Template.app.onRendered(() => {
const contentId = Session.get('activeContentId');
if(contentId === viewerContentId) {
if (contentId === viewerContentId) {
switchToTab(contentId);
}
});
@@ -56,9 +97,11 @@ Template.app.events({
});
Template.app.helpers({
userName: OHIF.user.getName,
studyListToggleText() {
const contentId = Session.get('activeContentId');
// If the Viewer has not been opened yet, 'Back to viewer' should
// not be displayed
const viewerContentExists = !!Object.keys(ViewerData).length;
@@ -82,4 +125,4 @@ Template.app.helpers({
}
});
Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');
Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');