More cleanup for the study list

This commit is contained in:
Erik Ziegler 2016-06-08 17:33:43 +02:00
parent 093a97f0f3
commit 848251eba9
9 changed files with 30 additions and 51 deletions

View File

@ -40,20 +40,7 @@ Router.route('/', function() {
if (verifyEmail && Meteor.user().emails && !Meteor.user().emails[0].verified) { if (verifyEmail && Meteor.user().emails && !Meteor.user().emails[0].verified) {
this.render('emailVerification', routerOptions); this.render('emailVerification', routerOptions);
} else { } else {
this.render('lesionTracker', routerOptions); Session.set('activeContentId', 'worklistTab');
}
} else {
this.render('entrySignIn', routerOptions);
}
});
Router.route('/worklist', function() {
// Check user is logged in
if (Meteor.user() && Meteor.userId()) {
if (verifyEmail && Meteor.user().emails && !Meteor.user().emails[0].verified) {
this.render('emailVerification', routerOptions);
} else {
this.render('lesionTracker', routerOptions); this.render('lesionTracker', routerOptions);
} }

View File

@ -7,10 +7,10 @@ Meteor.startup(function() {
}, },
signIn: { signIn: {
displayFullName: true, displayFullName: true,
destination: '/worklist' destination: '/'
}, },
signUp: { signUp: {
destination: '/worklist' destination: '/'
}, },
themeColors: { themeColors: {
primary: '' primary: ''

View File

@ -3,20 +3,8 @@
// use this to repopulate the variable // use this to repopulate the variable
ViewerData = Session.get('ViewerData') || {}; ViewerData = Session.get('ViewerData') || {};
Template.lesionTracker.onCreated(function() { var worklistContentId = 'worklistTab';
// showViewer to go to viewer from audit var viewerContentId = 'viewerTab';
this.showWorklistMenu = new ReactiveVar(true);
// Get url and check worklist
var currentRoute = Router.current();
if (!currentRoute || !currentRoute.route) {
return;
}
var currentPath = currentRoute.route.path(this);
if (currentPath === '/' || currentPath === '/worklist') {
this.showWorklistMenu.set(false);
}
});
Template.lesionTracker.onRendered(function() { Template.lesionTracker.onRendered(function() {
var templateData = Template.currentData(); var templateData = Template.currentData();
@ -38,8 +26,6 @@ Template.lesionTracker.onRendered(function() {
Template.lesionTracker.events({ Template.lesionTracker.events({
'click .js-toggle-studyList': function() { 'click .js-toggle-studyList': function() {
var contentId = Session.get('activeContentId'); var contentId = Session.get('activeContentId');
var worklistContentId = 'worklistTab';
var viewerContentId = 'viewerTab';
if (contentId !== worklistContentId) { if (contentId !== worklistContentId) {
switchToTab(worklistContentId); switchToTab(worklistContentId);
@ -52,18 +38,16 @@ Template.lesionTracker.events({
Session.set('defaultSignInMessage', 'Tumor tracking in your browser.'); Session.set('defaultSignInMessage', 'Tumor tracking in your browser.');
Template.lesionTracker.helpers({ Template.lesionTracker.helpers({
showWorklistMenu: function() {
return Template.instance().showWorklistMenu.get();
},
studyListToggleText: function() { studyListToggleText: function() {
var contentId = Session.get('activeContentId'); var contentId = Session.get('activeContentId');
if (!contentId) {
// If the Viewer has not been opened yet, 'Back to viewer' should
// not be displayed
var viewerContentExists = !!Object.keys(ViewerData).length;
if (!viewerContentExists) {
return; return;
} }
var worklistContentId = 'worklistTab';
var viewerContentId = 'viewerTab';
if (contentId === worklistContentId) { if (contentId === worklistContentId) {
return 'Back to viewer'; return 'Back to viewer';
} else if (contentId === viewerContentId) { } else if (contentId === viewerContentId) {

View File

@ -1,5 +1,7 @@
@import "{design}/app" @import "{design}/app"
$expandedHeight = 160px
.topBar .topBar
height: $topBarHeight height: $topBarHeight
color: $textPrimaryColor color: $textPrimaryColor
@ -11,6 +13,7 @@
display: inline-block display: inline-block
img.logoImage img.logoImage
display: inline-block
height: 100% height: 100%
max-height: 50px max-height: 50px
margin: 0 5px margin: 0 5px
@ -42,11 +45,15 @@
&.studyList &.studyList
background-color: rgba(21, 25, 30, 0.7) background-color: rgba(21, 25, 30, 0.7)
height: 160px height: $expandedHeight
.brandSection .brandSection
margin-top: 50px width: 80%
margin-left: 50px padding-left: 50px
line-height: $expandedHeight
img.logoImage
margin: 5px 5px 15px 5px
.logoText .logoText
font-size: 30px font-size: 30px

View File

@ -21,12 +21,6 @@ Template.userAccountMenu.helpers({
} }
return !!Meteor.user().emails[0].verified; return !!Meteor.user().emails[0].verified;
},
showWorklistMenu: function() {
var currentPath = Router.current().route.path(this);
if (currentPath !== '/' && currentPath !== '/worklist') {
return true;
}
} }
}); });

View File

@ -4,7 +4,7 @@
Study list Study list
</div> </div>
<div class="studyCount pull-right"> <div class="studyCount pull-right">
85 {{numberOfStudies}}
</div> </div>
<div class="pull-right"> <div class="pull-right">
{{>worklistToolbar}} {{>worklistToolbar}}

View File

@ -24,6 +24,10 @@ Template.worklistResult.helpers({
}); });
}, },
numberOfStudies: function() {
return WorklistStudies.find().count();
},
showLoadingText: function() { showLoadingText: function() {
return Session.get('searchResults').showLoadingText; return Session.get('searchResults').showLoadingText;
}, },

View File

@ -5,7 +5,7 @@
<label for="btnImport"> <label for="btnImport">
<i class="fa fa-plus"></i> Add new study <i class="fa fa-plus"></i> Add new study
</label> </label>
<input id="btnImport" class="inputfile" type="file" webkitdirectory directory multiple> <input id="btnImport" type="file" webkitdirectory directory multiple>
</div> </div>
{{/if }} {{/if }}
</div> </div>

View File

@ -9,13 +9,16 @@
font-weight: 300 font-weight: 300
cursor: pointer cursor: pointer
*
pointer-events: none
&:hover &:hover
color: $hoverColor color: $hoverColor
&:active &:active
color: $activeColor color: $activeColor
.inputfile input
width: 0.1px; width: 0.1px;
height: 0.1px height: 0.1px
opacity: 0 opacity: 0