Add Clinical Meteor packages to Lesion Tracker
This commit is contained in:
1 parent
383b4ff4c0
commit
b2fa6ead3b
56 files changed
+2355
-9
No files matched your search
+52
@@ -0,0 +1,52 @@
|
||||
|
||||
/**
|
||||
* @summary Determines if a block of code should be displayed based on whether the logo is set to be displayed.
|
||||
* @locus Client
|
||||
* @memberOf Entry
|
||||
* @name {{logoIsDisplayed}}
|
||||
* @version 1.2.3
|
||||
* @returns {Boolean}
|
||||
* @example
|
||||
* ```html
|
||||
* {{#if logoIsDisplayed}}
|
||||
* <div class="entryLogo" style="background-image: url('{{logoUrl}}')"></div>
|
||||
* {{/if}}
|
||||
* ```
|
||||
*/
|
||||
Template.registerHelper("logoIsDisplayed", function (argument){
|
||||
var config = Session.get('Photonic.ActiveEntry');
|
||||
if(config && config.logo && config.logo.displayed){
|
||||
return config.logo.displayed;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* @summary Retruns the Url of the logo asset.
|
||||
* @locus Client
|
||||
* @memberOf Entry
|
||||
* @name {{logoUrl}}
|
||||
* @version 1.2.3
|
||||
* @returns {String}
|
||||
* @example
|
||||
* ```html
|
||||
* {{#if logoIsDisplayed}}
|
||||
* <div class="entryLogo" style="background-image: url('{{logoUrl}}')"></div>
|
||||
* {{/if}}
|
||||
* ```
|
||||
*/
|
||||
Template.registerHelper("logoUrl", function (argument){
|
||||
var config = Session.get('Photonic.ActiveEntry');
|
||||
if(config && config.logo && config.logo.url){
|
||||
return config.logo.url;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Template.registerHelper("getButtonColor", function (argument){
|
||||
return "background-color: " + Theme.getPaletteColor("colorB") + "; ";
|
||||
});
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
// @import 'client/app/stylesheets/util/reset.lessimport';
|
||||
// @import 'client/app/stylesheets/util/lesshat.lessimport';
|
||||
// @import 'client/app/stylesheets/util/typography.lessimport';
|
||||
|
||||
|
||||
// this probably wants to be moved into clinical:glass-ui
|
||||
input, button, select{
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
font-family: 'Open Sans', "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-style: 400;
|
||||
padding: .75rem 0;
|
||||
line-height: 1.5rem !important;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
//color: #333333;
|
||||
outline: none;
|
||||
padding-left: 3em;
|
||||
}
|
||||
|
||||
|
||||
.entryLogo{
|
||||
//background-color: lightgray;
|
||||
height: 200px;
|
||||
width: 200px;
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.btn-primary{
|
||||
background-color: forestgreen;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn-gray{
|
||||
background-color: #aaaaaa;
|
||||
color: white;
|
||||
}
|
||||
.btn-main{
|
||||
font-weight: 300;
|
||||
letter-spacing: 3px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.input-symbol {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.entryPage {
|
||||
text-align: center;
|
||||
|
||||
input, button{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fa{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
padding-left: 15px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.checkmarkIcon{
|
||||
position: absolute;
|
||||
color: #831d2c;
|
||||
}
|
||||
.btn-gray{
|
||||
width: 100%;
|
||||
}
|
||||
.checkmarkTitle{
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
.fa{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
padding-left: 15px;
|
||||
padding-top: 16px;
|
||||
// color: #555555;
|
||||
}
|
||||
|
||||
.wrapper-auth {
|
||||
//padding-top: 4em;
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
margin: 0 auto;
|
||||
max-width: 480px;
|
||||
width: 80%;
|
||||
}
|
||||
@media screen and (max-width: 480px) {
|
||||
margin: 0 auto;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
// .input-symbol{
|
||||
// border: 1px solid gray;
|
||||
// }
|
||||
|
||||
.title-auth {
|
||||
color: black;
|
||||
margin-bottom: .75rem;
|
||||
}
|
||||
|
||||
.subtitle-auth {
|
||||
color: black;
|
||||
//margin: 0 15% 3rem;
|
||||
margin-bottom: 2rem;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
form {
|
||||
input{
|
||||
color: #333333;
|
||||
height: 48px;
|
||||
border-left: solid 1px !important;
|
||||
}
|
||||
.input-symbol {
|
||||
margin-bottom: 1px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
//margin: 1em 5% 0;
|
||||
//width: 90%;
|
||||
margin-top: 1em;
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
// margin-left: 0;
|
||||
// margin-right: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-errors {
|
||||
margin-top: -2rem;
|
||||
.taskItems {
|
||||
//.title-caps;
|
||||
background: white;
|
||||
color: red;
|
||||
font-size: .625em; // 10px
|
||||
margin-bottom: 1px;
|
||||
padding: .7rem 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.link-auth-alt {
|
||||
//.font-s1;
|
||||
//.position(absolute, auto, 0, 1em, 0);
|
||||
color: black;
|
||||
display: inline-block;
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
bottom: 0;
|
||||
margin-top: 1rem;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
// @media only screen and (max-width: 704px) {
|
||||
// .fa{
|
||||
// left: 5%;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
exports.command = function () {
|
||||
this
|
||||
.execute(function () {
|
||||
return Meteor.logout();
|
||||
}).pause(1000);
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
exports.command = function (email, password) {
|
||||
|
||||
this.verify.elementPresent("#entrySignIn");
|
||||
|
||||
if (email) {
|
||||
this
|
||||
.verify.elementPresent("#signInPageEmailInput")
|
||||
.clearValue("#signInPageEmailInput")
|
||||
.setValue("#signInPageEmailInput", email);
|
||||
}
|
||||
|
||||
|
||||
if (password) {
|
||||
this
|
||||
.verify.elementPresent("#signInPagePasswordInput")
|
||||
.clearValue("#signInPagePasswordInput")
|
||||
.setValue("#signInPagePasswordInput", password);
|
||||
}
|
||||
|
||||
this.click("#signInToAppButton").pause(1000);
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
exports.command = function (fullname) {
|
||||
this
|
||||
.sectionBreak(".signOut()");
|
||||
|
||||
if (fullname) {
|
||||
this
|
||||
.verify.elementPresent("#usernameLink")
|
||||
.verify.containsText("#usernameLink", fullname);
|
||||
}
|
||||
|
||||
this
|
||||
.verify.elementPresent("#logoutLink")
|
||||
.click("#logoutLink").pause(1000);
|
||||
|
||||
if (fullname) {
|
||||
this
|
||||
.verify.elementPresent("#usernameLink")
|
||||
.verify.containsText("#usernameLink", "Sign In");
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
exports.command = function (email, password, title, message) {
|
||||
this
|
||||
// .verify.element("#entrySignIn").to.be.visible
|
||||
// .verify.element("#signInPageTitle").to.be.visible
|
||||
// .verify.element("#signInPageMessage").to.be.visible
|
||||
// .verify.element("#signInPageEmailInput").to.be.visible
|
||||
// .verify.element("#signInPagePasswordInput").to.be.visible
|
||||
// .verify.element("#signInToAppButton").to.be.visible
|
||||
// .verify.element("#needAnAccountButton").to.be.visible
|
||||
//
|
||||
|
||||
.verify.elementPresent("#entrySignIn")
|
||||
.verify.elementPresent("#signInPageTitle")
|
||||
.verify.elementPresent("#signInPageMessage")
|
||||
.verify.elementPresent("#signInPageEmailInput")
|
||||
.verify.elementPresent("#signInPagePasswordInput")
|
||||
.verify.elementPresent("#signInToAppButton")
|
||||
.verify.elementPresent("#needAnAccountButton");
|
||||
|
||||
if (email) {
|
||||
this.verify.containsText("#signInPageEmailInput", email);
|
||||
}
|
||||
if (password) {
|
||||
this.verify.containsText("#signInPageEmailInput", password);
|
||||
}
|
||||
|
||||
if (title) {
|
||||
this.verify.containsText("#signInPageTitle", title);
|
||||
}
|
||||
if (message) {
|
||||
this.verify.containsText("#signInPageMessage", message);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
<template name="entrySignIn">
|
||||
<div id="entrySignIn" class="page entryPage" style="{{getOpacityWithCorner}}">
|
||||
|
||||
<div class="content-scrollable">
|
||||
<div class="wrapper-auth">
|
||||
{{#if logoIsDisplayed}}
|
||||
<div id="entryAppLogo" class="entryLogo" style="background-image: url('{{logoUrl}}')"></div>
|
||||
{{/if}}
|
||||
|
||||
{{#if isLoggedIn}}
|
||||
<h1 id="signInPageTitle" class="title-auth">{{fullName}}</h1>
|
||||
<div id="signInPageMessage" class="subtitle-auth">You are currently signed in.</div>
|
||||
|
||||
<button id="logoutButton" class="btn-primary btn-main btn-large" style="{{getButtonColor}}">Logout</button>
|
||||
{{else}}
|
||||
<h1 id="signInPageTitle" class="title-auth">Sign In.</h1>
|
||||
<p id="signInPageMessage" class="subtitle-auth" style="{{getSignInMessageColor}}">{{getSignInMessage}}</p>
|
||||
|
||||
<form>
|
||||
<div class="input-symbol">
|
||||
<input id="signInPageEmailInput" type="text" name="email" placeholder="Your Email" style="{{getEmailValidationStyling}}" />
|
||||
<i class="fa fa-envelope-o" title="Your Email"></i>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div class="input-symbol">
|
||||
<input id="signInPagePasswordInput" type="password" name="password" placeholder="Password" style={{getPasswordValidationStyling}} />
|
||||
<span class="fa fa-lock" title="Password"></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br><br>
|
||||
<button id="signInToAppButton" class="btn-primary btn-main btn-large" style="{{getButtonColor}}">{{getButtonText}}</button>
|
||||
|
||||
<br><br>
|
||||
<button id="needAnAccountButton" class="btn-gray btn-main btn-large">Need an account?</button>
|
||||
|
||||
<br><br>
|
||||
<button id="forgotPasswordButton" class="btn-gray btn-main btn-large">Forgot password?</button>
|
||||
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
|
||||
// REFACTOR: Move to ActiveRecord object
|
||||
Session.set("defaultSignInMessage", "Improve your clinical practice with checklists.");
|
||||
|
||||
//==================================================================================================
|
||||
// ROUTER
|
||||
|
||||
Router.route('/entrySignIn', {
|
||||
template: 'entrySignIn',
|
||||
name: 'entrySignIn'
|
||||
});
|
||||
Router.route('/sign-in', {
|
||||
template: 'entrySignIn',
|
||||
name: 'signInRoute'
|
||||
});
|
||||
|
||||
//==================================================================================================
|
||||
// COMPONENT OUTPUTS
|
||||
|
||||
|
||||
|
||||
|
||||
Template.entrySignIn.helpers({
|
||||
getSignInMessageColor: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return "color: #a94442; background-color: #f2dede; border-color: #ebccd1;"
|
||||
} else {
|
||||
return "color: black;"
|
||||
}
|
||||
},
|
||||
getSignInMessage: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return ActiveEntry.errorMessages.get('signInError');
|
||||
} else {
|
||||
return Session.get('defaultSignInMessage');
|
||||
}
|
||||
},
|
||||
getButtonText: function () {
|
||||
return "Sign In";
|
||||
// if (ActiveEntry.errorMessages.get('signInError')){
|
||||
// return ActiveEntry.errorMessages.get('signInError');
|
||||
// } else {
|
||||
// return "Sign In";
|
||||
// }
|
||||
},
|
||||
getEmailValidationStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('email', "Email is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email is poorly formatted")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getPasswordValidationStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('password', "Password is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password is weak")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
// COMPONENT OUTPUTS
|
||||
|
||||
Template.entrySignIn.events({
|
||||
'click #logoutButton': function () {
|
||||
Meteor.logout();
|
||||
},
|
||||
'click #forgotPasswordButton': function (event) {
|
||||
event.preventDefault();
|
||||
Router.go('/forgotPassword');
|
||||
},
|
||||
"click #needAnAccountButton": function (event) {
|
||||
event.preventDefault();
|
||||
Router.go('/entrySignUp');
|
||||
},
|
||||
'keyup input[name="email"]': function (event, template) {
|
||||
var email = $('input[name="email"]').val();
|
||||
|
||||
ActiveEntry.verifyEmail(email);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change input[name="email"]': function (event, template) {
|
||||
var email = $('input[name="email"]').val();
|
||||
|
||||
ActiveEntry.verifyEmail(email);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'keyup #signInPagePasswordInput': function (event, template) {
|
||||
var password = $('input[name="password"]').val();
|
||||
|
||||
ActiveEntry.verifyPassword(password);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change #signInPagePasswordInput': function (event, template) {
|
||||
var password = $('input[name="password"]').val();
|
||||
|
||||
ActiveEntry.verifyPassword(password);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
// 'submit': function (event, template) {
|
||||
// event.preventDefault();
|
||||
// var emailValue = template.$('[name=email]').val();
|
||||
// var passwordValue = template.$('[name=password]').val();
|
||||
//
|
||||
// ActiveEntry.signIn(emailValue, passwordValue);
|
||||
// },
|
||||
'click #signInToAppButton': function (event, template){
|
||||
console.log('click #signInToAppButton');
|
||||
// var emailValue = template.$('[name=email]').val();
|
||||
// var passwordValue = template.$('[name=password]').val();
|
||||
var emailValue = template.$('#signInPageEmailInput').val();
|
||||
var passwordValue = template.$('#signInPagePasswordInput').val();
|
||||
|
||||
ActiveEntry.signIn(emailValue, passwordValue);
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@@ -0,0 +1,17 @@
|
||||
#entrySignIn{
|
||||
padding: 40px;
|
||||
input{
|
||||
padding-left: 40px;
|
||||
color: #333333 !important;
|
||||
}
|
||||
#errorMessages{
|
||||
padding-top: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
width: 100.5%;
|
||||
margin-bottom: 15px;
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// async version calls method on the server
|
||||
exports.command = function () {
|
||||
var client = this;
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(5000)
|
||||
.executeAsync(function (data, meteorCallback) {
|
||||
//return HipaaLogger.logEventObject(data);
|
||||
Meteor.call("dropEntryUsers", data, function (meteorError, meteorResult) {
|
||||
var response = (meteorError ? {
|
||||
error: meteorError
|
||||
} : {
|
||||
result: meteorResult
|
||||
});
|
||||
meteorCallback(response);
|
||||
});
|
||||
}, [], function (result) {
|
||||
//console.log("result.value", result.value);
|
||||
//client.assert.ok(result.value);
|
||||
}).pause(1000);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
// resetEntry.js
|
||||
exports.command = function () {
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(5000)
|
||||
.executeAsync(function (data, meteorCallback) {
|
||||
ActiveEntry.reset();
|
||||
}, []).pause(1000);
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
exports.command = function (email, password, fullName) {
|
||||
|
||||
this.verify.elementPresent("#entrySignUp");
|
||||
|
||||
if (email) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPageEmailInput")
|
||||
.clearValue("#signUpPageEmailInput")
|
||||
.setValue("#signUpPageEmailInput", email);
|
||||
}
|
||||
|
||||
|
||||
if (password) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPagePasswordInput")
|
||||
.clearValue("#signUpPagePasswordInput")
|
||||
.setValue("#signUpPagePasswordInput", password)
|
||||
|
||||
.verify.elementPresent("#signUpPagePasswordConfirmInput")
|
||||
.clearValue("#signUpPagePasswordConfirmInput")
|
||||
.setValue("#signUpPagePasswordConfirmInput", password);
|
||||
}
|
||||
|
||||
|
||||
if (fullName) {
|
||||
this
|
||||
.verify.elementPresent("#signUpPageFullNameInput")
|
||||
.clearValue("#signUpPageFullNameInput")
|
||||
.setValue("#signUpPageFullNameInput", fullName);
|
||||
}
|
||||
|
||||
|
||||
this.click("#signUpPageJoinNowButton").pause(300);
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
exports.command = function (email, password, fullName, message) {
|
||||
this
|
||||
.verify.elementPresent("#entrySignUp")
|
||||
.verify.elementPresent("#signUpPageTitle")
|
||||
.verify.elementPresent("#signUpPageMessage")
|
||||
.verify.elementPresent("#signUpPageFullNameInput")
|
||||
.verify.elementPresent("#signUpPageEmailInput")
|
||||
.verify.elementPresent("#signUpPagePasswordInput")
|
||||
.verify.elementPresent("#signUpPagePasswordConfirmInput")
|
||||
|
||||
.verify.elementPresent("#signUpPageJoinNowButton")
|
||||
.verify.elementPresent("#signUpPageSignInButton");
|
||||
|
||||
if (email) {
|
||||
this.verify.containsText("#signUpPageEmailInput", email);
|
||||
}
|
||||
if (password) {
|
||||
this.verify.containsText("#signUpPagePasswordInput", password)
|
||||
.verify.containsText("#signUpPagePasswordConfirmInput", password);
|
||||
}
|
||||
if (fullName) {
|
||||
this.verify.containsText("#signUpPageFullNameInput", fullName);
|
||||
}
|
||||
if (message) {
|
||||
this.verify.elementPresent("#errorMessages")
|
||||
.verify.containsText("#errorMessages", message);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
<template name="entrySignUp">
|
||||
<div id="entrySignUp" class="page entryPage" style="{{getOpacityWithCorner}}">
|
||||
|
||||
<div class="content-scrollable">
|
||||
<div class="wrapper-auth">
|
||||
{{#if logoIsDisplayed}}
|
||||
<div id="entryAppLogo" class="entryLogo" style="background-image: url('{{logoUrl}}')"></div>
|
||||
{{/if}}
|
||||
|
||||
<h1 id="signUpPageTitle" class="title-auth">Join.</h1>
|
||||
<div id="signUpPageMessage" class="subtitle-auth" style="{{getSignUpMessageColor}}">{{getSignUpMessage}}</div>
|
||||
|
||||
<form>
|
||||
{{#if errorMessages}}
|
||||
<div id="errorMessages" class="list-errors">
|
||||
{{#each errorMessages}}
|
||||
<div class="alert alert-danger list-item">{{this}}</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="input-symbol ">
|
||||
<input id="signUpPageFullNameInput" type="text" name="fullName" placeholder="Full Name" style="{{getFullNameStyling}}" />
|
||||
<i class="fa fa-user" title="Full Name"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol">
|
||||
<input id="signUpPageEmailInput" type="email" name="email" placeholder="Email Address" style="{{getEmailStyling}}" />
|
||||
<i class="fa fa-envelope-o" title="Your Email"></i>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol ">
|
||||
<input id="signUpPagePasswordInput" type="password" name="password" placeholder="Password" style="{{getPasswordStyling}}" />
|
||||
<span class="fa fa-lock" title="Password"></span>
|
||||
<!-- <span class="icon-lock" title="Password"></span> -->
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<div class="input-symbol">
|
||||
<input id="signUpPagePasswordConfirmInput" type="password" name="confirm" placeholder="Confirm Password" style="{{getConfirmPasswordStyling}}" />
|
||||
<span class="fa fa-lock" title="Confirm Password"></span>
|
||||
<!-- <span class="icon-lock" title="Confirm Password"></span> -->
|
||||
</div>
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
<button id="signUpPageJoinNowButton" type="submit" class="btn-primary btn-main btn-large" style="{{getButtonColor}}">Join Now</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<button id="signUpPageSignInButton" class="btn-gray btn-main btn-large">Have an account? Sign in</button>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <a id="signUpPageSignInButton" href="{{pathFor 'entrySignIn'}}" class="link-auth-alt">Have an account? Sign in</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
//==================================================================================================
|
||||
// ROUTER
|
||||
|
||||
Router.route('/entrySignUp', {
|
||||
template: 'entrySignUp',
|
||||
name: 'entrySignUp'
|
||||
});
|
||||
Router.route('/sign-up', {
|
||||
template: 'entrySignUp',
|
||||
name: 'signUpRoute'
|
||||
});
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
|
||||
|
||||
Template.entrySignUp.helpers({
|
||||
getSignUpMessageColor: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return "color: #a94442; background-color: #f2dede; border-color: #ebccd1;"
|
||||
} else {
|
||||
return "color: black;"
|
||||
}
|
||||
},
|
||||
getSignUpMessage: function (){
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return ActiveEntry.errorMessages.get('signInError');
|
||||
} else {
|
||||
return Session.get('defaultSignInMessage');
|
||||
}
|
||||
},
|
||||
getButtonText: function () {
|
||||
if (ActiveEntry.errorMessages.get('signInError')) {
|
||||
return ActiveEntry.errorMessages.get('signInError').message;
|
||||
} else {
|
||||
return "Sign In";
|
||||
}
|
||||
},
|
||||
getEmailStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('email', "Email is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email is poorly formatted")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('email', "Email present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getPasswordStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('password', "Password is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password is weak")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('password', "Password present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getConfirmPasswordStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('confirm', "Password is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('confirm', "Password is weak")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('confirm', "Passwords match")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
},
|
||||
getFullNameStyling: function () {
|
||||
if (ActiveEntry.errorMessages.equals('fullName', "Name is required")) {
|
||||
return "border: 1px solid #a94442";
|
||||
} else if (ActiveEntry.errorMessages.equals('fullName', "Name is probably not complete")) {
|
||||
return "border: 1px solid #f2dede";
|
||||
} else if (ActiveEntry.errorMessages.equals('fullName', "Name present")) {
|
||||
return "border: 1px solid green";
|
||||
} else {
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.entrySignUp.events({
|
||||
"click #signUpPageSignInButton": function (event) {
|
||||
event.preventDefault();
|
||||
Router.go('/entrySignIn');
|
||||
},
|
||||
'change, keyup #signUpPageEmailInput': function (event, template) {
|
||||
var email = $('[name="email"]').val();
|
||||
|
||||
ActiveEntry.verifyEmail(email);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPagePasswordInput': function (event, template) {
|
||||
var password = $('[name="password"]').val();
|
||||
|
||||
ActiveEntry.verifyPassword(password);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPagePasswordConfirmInput': function (event, template) {
|
||||
|
||||
var password = $('[name="password"]').val();
|
||||
var confirmPassword = $('[name="confirm"]').val();
|
||||
// var password = $('#signUpPagePasswordInput').val();
|
||||
// var confirmPassword = $('#signUpPagePasswordConfirmInput').val();
|
||||
|
||||
ActiveEntry.verifyConfirmPassword(password, confirmPassword);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
'change, keyup #signUpPageFullNameInput': function (event, template) {
|
||||
var fullName = template.$('[name="fullName"]').val();
|
||||
|
||||
ActiveEntry.verifyFullName(fullName);
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
},
|
||||
// TODO: this is outdated, and should be changed to match the signature/pattern in entrySignIn
|
||||
'click #signUpPageJoinNowButton': function (event, template) {
|
||||
event.preventDefault();
|
||||
|
||||
ActiveEntry.errorMessages.set('signInError', null);
|
||||
ActiveEntry.verifyPassword(event, template);
|
||||
|
||||
var newUser = {
|
||||
fullName: template.$('[name="fullName"]').val(),
|
||||
email: template.$('[name="email"]').val(),
|
||||
password: template.$('[name="password"]').val(),
|
||||
confirm: template.$('[name="confirm"]').val()
|
||||
};
|
||||
|
||||
ActiveEntry.signUp(
|
||||
newUser.email,
|
||||
newUser.password,
|
||||
newUser.confirm,
|
||||
newUser.fullName
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
#entrySignUp{
|
||||
padding: 40px;
|
||||
input{
|
||||
padding-left: 40px !important;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
exports.command = function () {
|
||||
this
|
||||
.verify.elementPresent("#forgotPassword"); return this;
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<template name="forgotPassword">
|
||||
<div id="forgotPassword" class="page entryPage" style="{{getOpacityWithCorner}}">
|
||||
<div class="content-scrollable">
|
||||
<div class="wrapper-auth">
|
||||
<div class="entryLogo" style="background-image: url('{{getLogoUrl}}')"></div>
|
||||
|
||||
<h1 id="signInPageTitle" class="title-auth">Forgot Password</h1>
|
||||
<div id="signInPageMessage" class="subtitle-auth" >Imdivrove your clincal practice with checklists.</div>
|
||||
|
||||
<form>
|
||||
<div class="input-symbol">
|
||||
<input id="signInPageEmailInput" type="email" name="email" placeholder="Your Email" style="{{getForgotPasswordStyle}}" />
|
||||
<i class="fa fa-envelope-o" title="Your Email"></i>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<button id="sendReminderButton" type="submit" class="btn-gray btn-main btn-large" style="{{getButtonColor}}">Send Reminder</button><br><br>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,22 @@
|
||||
//==========================================
|
||||
|
||||
Router.route('/forgotPassword', {
|
||||
name: "forgotPassword",
|
||||
template: "forgotPassword"
|
||||
});
|
||||
|
||||
|
||||
Template.forgotPassword.helpers({
|
||||
getForgotPasswordStyle: function (){
|
||||
return "border: 1px solid gray";
|
||||
}
|
||||
});
|
||||
|
||||
Template.forgotPassword.events({
|
||||
"submit": function (event, template) {
|
||||
event.preventDefault();
|
||||
|
||||
console.log('send reminder!');
|
||||
Accounts.forgotPassword({email: $('#signInPageEmailInput').val()});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
#forgotPassword{
|
||||
input{
|
||||
padding-left: 40px;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user