LT-160: Create user accounts and require login for access by using active-entry package

This commit is contained in:
Aysel Afsar 2016-01-27 08:35:06 -05:00
parent 4e38bbfa0b
commit 59a6905eb0
5 changed files with 47 additions and 5 deletions

View File

@ -12,7 +12,7 @@ if (Meteor.isClient){
destination: '/worklist'
},
themeColors: {
primary: 'black'
primary: ""
}
});
}

View File

@ -4,6 +4,19 @@
<img src="/images/logo.png">
<h4 class="name">Open Health Imaging Foundation</h4>
</a>
{{#if currentUser}}
<div id="userProfile" class="row-fluid">
<div class="dropdown clearfix">
<ul class="nav nav-pills pull-right">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{{fullName}}<b class="caret"></b></a>
<ul class="dropdown-menu pull-right">
<li><a href="#" id="logoutButton">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
{{/if}}
</div>
{{> yield}}
</template>

View File

@ -0,0 +1,13 @@
Template.layoutLesionTracker.events({
'click #logoutButton': function() {
Meteor.logout(function(){
Router.go('/entrySignIn');
});
}
});
Template.layoutLesionTracker.helpers({
'fullName': function() {
return Meteor.user().profile.fullName;
}
});

View File

@ -7,12 +7,18 @@
@media only screen and (min-device-width : 375px) and (max-device-width : 667px) and (orientation : portrait)
width: 15%
.navbar-brand
#userProfile
position: relative
float: right
.dropdown-toggle
color: #C1C1C1
.navbar-brand
display: inline-block
padding: 0
margin-right: 5px
height: 100%
width: 100%
img
height: 30px

View File

@ -28,11 +28,21 @@ var routerOptions = {
};
Router.route('/', function() {
this.render('worklist', routerOptions);
// Check user is logged in
if (!Meteor.user() || !Meteor.userId()) {
this.render('entrySignIn', routerOptions);
} else{
this.render('worklist', routerOptions);
}
});
Router.route('/worklist', function() {
this.render('worklist', routerOptions);
// Check user is logged in
if (!Meteor.user() || !Meteor.userId()) {
this.render('entrySignIn', routerOptions);
} else{
this.render('worklist', routerOptions);
}
});
Router.route('/viewer/:_id', {