Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging in and Registration, independent from accounts-ui
- Loading branch information
Showing
34 changed files
with
19,218 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Accounts.onEmailVerificationLink(function(token, done) { | ||
Accounts.verifyEmail(token); | ||
done(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<head> | ||
<base href="/"> | ||
<title>Quick Survey</title> | ||
</head> | ||
|
||
<body ng-app="quick-survey"> | ||
<div class="page-wrap"> | ||
<div class="nav" ng-controller="NavBarCtrl"> | ||
<div class="admin" ng-if="is_admin"> | ||
<a href="/">survey</a> | ||
<a href="/admin">admin</a> | ||
</div> | ||
<div class="registration" | ||
ng-if="state.current.name !== 'setup'"> | ||
<a class="button" | ||
ng-href="/login" | ||
ng-hide="$root.currentUser">Log in</a> | ||
<a class="button" | ||
ng-href="/register" | ||
ng-hide="$root.currentUser">Register</a> | ||
<div class="username" | ||
ng-show="$root.currentUser"> | ||
Hello <span ng-bind="$root.currentUser | displayName"></span> | ||
</div> | ||
<a class="button" | ||
ng-href="/logout" | ||
ng-show="$root.currentUser">Log out</a> | ||
</div> | ||
</div> | ||
<div ui-view | ||
class="container small-row" | ||
ng-class="{ admin: $state.includes('admin') }"> | ||
</div> | ||
</div> | ||
<div ng-show="loading"> | ||
<span></span> | ||
<span></span> | ||
<span></span> | ||
</div> | ||
<footer class="site-footer"> | ||
<div class="wide-row footer-wrapper"> | ||
<img src="/images/squirrel-small.png" alt="Quick Survey Squirrel Logo"/> | ||
<p>Powered by Quick-Survey, a self-hosted, easy-to-install survey tool that you control and own. Get started on <a href="https://github.com/simonv3/quick-survey"><i class="icon-github"></i> GitHub</a>. | ||
</p> | ||
</div> | ||
</footer> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
angular.module('quick-survey').filter('displayName', function () { | ||
return function (user) { | ||
if (!user) | ||
return; | ||
if (user.profile && user.profile.name) | ||
return user.profile.name; | ||
else if (user.emails) | ||
return user.emails[0].address; | ||
else | ||
return user; | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
angular.module("quick-survey").controller("LoginCtrl", | ||
function ($meteor, $state) { | ||
var vm = this; | ||
|
||
vm.credentials = { | ||
email: '', | ||
password: '' | ||
}; | ||
|
||
vm.error = ''; | ||
|
||
vm.sendEmailVerification = function() { | ||
Meteor.call('resendVerificationEmail', vm.credentials.email); | ||
}; | ||
|
||
vm.login = function () { | ||
$meteor.loginWithPassword(vm.credentials.email, vm.credentials.password).then( | ||
function () { | ||
$state.go('active-survey'); | ||
}, | ||
function (err) { | ||
vm.error = err; | ||
} | ||
); | ||
}; | ||
} | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
angular.module("quick-survey").controller("RegisterCtrl", | ||
function ($meteor, $state) { | ||
var vm = this; | ||
|
||
vm.credentials = { | ||
email: '', | ||
password: '' | ||
}; | ||
|
||
vm.error = ''; | ||
|
||
vm.register = function () { | ||
$meteor.createUser(vm.credentials).then( | ||
function (response) { | ||
console.log(vm.currentUser); | ||
vm.success = true; | ||
}, | ||
function (err) { | ||
if (err.error === 'account-created') $state.go('register-success') | ||
vm.error = err; | ||
} | ||
); | ||
}; | ||
} | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
angular.module("quick-survey").controller("ResetPasswordCtrl", | ||
function ($meteor, $state) { | ||
var vm = this; | ||
|
||
vm.credentials = { | ||
email: '' | ||
}; | ||
|
||
vm.error = ''; | ||
|
||
vm.reset = function () { | ||
$meteor.forgotPassword(vm.credentials.email).then( | ||
function () { | ||
$state.go('active-survey'); | ||
}, | ||
function (err) { | ||
vm.error = 'Error sending forgot password email - ' + err; | ||
} | ||
); | ||
}; | ||
} | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div class="frontend"> | ||
<h1>Log in</h1> | ||
<form class="registration-form" name="loginForm"> | ||
<!-- <div> | ||
<h2>Login with:</h2> | ||
<button>Twitter</button> | ||
<button>Facebook</button> | ||
</div> --> | ||
<div ng-show="lc.error" class="md-warn"> | ||
<small> | ||
{{ lc.error.reason }} | ||
<a ng-if="lc.error.error === 'verify-account'" ng-click="lc.sendEmailVerification()">Re-send. | ||
</a> | ||
</small> | ||
</div> | ||
<input type="text" | ||
ng-model="lc.credentials.email" | ||
placeholder="email" | ||
aria-label="email"/> | ||
<input type="password" | ||
ng-model="lc.credentials.password" | ||
placeholder="password" | ||
aria-label="password"/> | ||
<button ng-disabled="!loginForm.$valid" | ||
ng-click="lc.login()">Submit</button> | ||
</form> | ||
<div> | ||
<a href="/reset-password">Forgot password?</a> | ||
<a href="/register">Create an account</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="message empty-state success"> | ||
Great, check your e-mail for a verification e-mail! | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="frontend"> | ||
<h1>Register</h1> | ||
<form class="registration-form" | ||
name="registerForm"> | ||
<!-- <div> | ||
<h2>Register with:</h2> | ||
<button>Twitter</button> | ||
<button>Facebook</button> | ||
</div> --> | ||
<div ng-show="rc.error" class="message warning"> | ||
<small>{{ rc.error.reason }}</small> | ||
</div> | ||
|
||
<input type="email" | ||
ng-model="rc.credentials.email" | ||
placeholder="email" | ||
aria-label="email" | ||
required/> | ||
<input type="password" | ||
ng-model="rc.credentials.password" | ||
placeholder="password" | ||
aria-label="password" | ||
required/> | ||
<button ng-disabled="!registerForm.$valid" | ||
ng-click="rc.register()">Register</button> | ||
</form> | ||
<div ng-show="rc.success" class="message success"> | ||
<small>Great, check your email for a verification e-mail!</small> | ||
</div> | ||
<div> | ||
<a href="/reset-password">Forgot password?</a> | ||
<a href="/login">Log in</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="frontend"> | ||
<h1>Register</h1> | ||
<form class="login-form" name="resetPasswordForm"> | ||
<div> | ||
<h2>Register with:</h2> | ||
<button>Twitter</button> | ||
<button>Facebook</button> | ||
</div> | ||
<div ng-show="rc.error" class="md-warn"> | ||
<small>{{ rc.error }}</small> | ||
</div> | ||
<input type="text" | ||
ng-model="rpc.credentials.email" | ||
placeholder="email" | ||
aria-label="email" | ||
required/> | ||
<button ng-disabled="!resetPasswordForm.$valid" | ||
ng-click="rpc.register()">Submit</button> | ||
</form> | ||
<div> | ||
<a href="/resetpw">Forgot password?</a> | ||
<a href="/register">Create an account</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@-moz-keyframes spin { | ||
from { | ||
-moz-transform: rotate(0deg); | ||
-moz-transform: scale(2); | ||
} | ||
to { | ||
-moz-transform: scale(1); | ||
-moz-transform: rotate(360deg); | ||
} | ||
} | ||
@-webkit-keyframes spin { | ||
from { | ||
-webkit-transform: rotate(0deg); | ||
} | ||
to { | ||
-webkit-transform: rotate(360deg); | ||
} | ||
} | ||
@keyframes spin { | ||
from { | ||
transform: scale(2); | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: scale(1); | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.animation(@name, @duration, @iterationCount, @timingFunction) { | ||
-webkit-animation-name: @name; | ||
-webkit-animation-duration: @duration; | ||
-webkit-animation-iteration-count: @iterationCount; | ||
-webkit-animation-timing-function: @timingFunction; | ||
-moz-animation-name: @name; | ||
-moz-animation-duration: @duration; | ||
-moz-animation-iteration-count: @iterationCount; | ||
-moz-animation-timing-function: @timingFunction; | ||
-ms-animation-name: @name; | ||
-ms-animation-duration: @duration; | ||
-ms-animation-iteration-count: @iterationCount; | ||
-ms-animation-timing-function: @timingFunction; | ||
} |
Oops, something went wrong.