Skip to content

Commit ed2985e

Browse files
committed
Merge branch 'master' into enroll
2 parents 41bb7ac + c9100ed commit ed2985e

31 files changed

+226
-61
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ vendor/
77
packages
88
*.lock
99
*.sublime-workspace
10-
*.sublime-project
10+
*.sublime-project
11+
Makefile
12+
start_test.js
13+
phantom_runner.js

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ node_js:
33
- "0.10"
44
before_install:
55
- "curl -L http://git.io/ejPSng | /bin/sh"
6-
notifications:
7-
slack: differential:L6ydnf9YbCImkL3LHFfNRpf6
6+
env:
7+
- TEST_COMMAND=meteor

README.md

+22-29
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
---
2-
layout: default
3-
username: Differential
4-
repo: accounts-entry
5-
desc: Meteor sign up and sign in pages.
6-
version: 1.0.2
1+
[![Stories in Ready](https://badge.waffle.io/Differential/accounts-entry.png?label=ready&title=Ready)](https://waffle.io/Differential/accounts-entry)
2+
# Meteor accounts-entry [![Build Status](https://travis-ci.org/Differential/accounts-entry.png)](https://travis-ci.org/Differential/accounts-entry)
73

8-
---
4+
accounts-entry is a meteor package that relies on Iron Router and provides an alternative interface to accounts-ui, with whole pages for sign up and sign in.
95

10-
**NOTE:** Version 0.8.0 and higher or accounts-entry requires that you use Meteor 0.8.2 or higher. You also need to pass the pause param to AccountsEntry.signedInRequired if you are using it. If you were using master and extraSignUpFields, please review the docs for changes in the 0.8.0 release.
6+
## Getting started
7+
8+
Run:
119

12-
# accounts-entry
10+
```
11+
meteor add joshowens:accounts-entry
12+
```
1313

14-
[![Build Status](https://travis-ci.org/Differential/accounts-entry.png)](https://travis-ci.org/Differential/accounts-entry)
14+
You can install the `accounts-ui` package, as it is still used for OAuth setup.
1515

16-
accounts-entry is a meteorite package that relies on Iron Router and provides an
17-
alternative interface to accounts-ui, with whole pages for sign up
18-
and sign in.
1916

2017
We wanted something to work with that used [Iron Router](https://github.com/EventedMind/iron-router),
2118
[Bootstrap 3](https://github.com/mangasocial/meteor-bootstrap-3), and didn't require the forcing of
2219
the dropdown box that didn't seem to be easily styled. But we love the ease of adding more packages like `accounts-facebook` or `accounts-twitter`, so we fully support the OAuth packages by adding buttons to let people sign-up/sign-in with those services if you add them. By default, accounts-entry doesn't offer email/password login functionality. If you `mrt add accounts-password`, accounts-entry will offer your users the option to sign-up/sign-in with a username and password.
2320

24-
![Example](http://github.differential.io/accounts-entry/images/Example.png)
21+
![Example](http://github.differential.com/accounts-entry/images/Example.png)
2522

2623
Examples of the package in action (check out the sign up or sign in
2724
links):
@@ -30,23 +27,13 @@ links):
3027
* [https://carp.io/](https://carp.io/)
3128
* [https://getliquid.io/](https://getliquid.io/)
3229
* [http://support.unpolishedcr.com/](http://support.unpolishedcr.com/)
33-
* Email [email protected] to add your project to the list.
30+
* Submit PR with a description to add your project to the list.
3431

3532
[Changelog](https://github.com/BeDifferential/accounts-entry/blob/master/CHANGELOG.md)
3633

3734
## Compatibility
3835

39-
accounts-entry is presently compatible with Iron Router 0.6.0 and above. Since meteorite doesn't support semantic version locking, we are currently pegged to 0.6.4 of Iron-router.
40-
41-
## Getting started
42-
43-
Run:
44-
45-
```
46-
mrt add accounts-entry
47-
```
48-
49-
You can install the `accounts-ui` package, as it is still used for OAuth setup.
36+
accounts-entry is presently compatible with Iron Router 1.0.3 and above.
5037

5138
## Provided routes
5239

@@ -57,9 +44,9 @@ You will get routes and the necessary templates for:
5744
/sign-out
5845
/sign-up
5946
/forgot-password
47+
/verification-pending
6048
```
6149

62-
{% assign special = '{{> accountButtons}}' %}
6350
You can then either add links to those directly, or use the `{{ special }}` helper we provide to give you the apppropriate links for signed-in/signed-out users. The `{{ special }}` helper will display a sign-out link and the user's email address when they are signed-in.
6451

6552
## Ensuring signed in users for routes
@@ -84,7 +71,6 @@ Use `mrt add accounts-password` if you want to have email/username login authent
8471

8572
## Setting up OAuth/social integrations
8673

87-
{% assign loginButtons = '{{> loginButtons}}' %}
8874
Use `accounts-ui` to configure your social/OAuth integrations (or manually create records in your database, if you have those skills). We don't have the nice instructions on how to configure the services built into this package, but if you choose to use <code>{{ loginButtons }}</code> elsewhere in your application (even temporarily), you can configure OAuth logins there.
8975

9076
## Configuration
@@ -119,6 +105,13 @@ Since this is a young package, we are maintaining compatibility with accounts-ui
119105
type: "text", // The type of field you want
120106
required: true // Adds html 5 required property if true
121107
}]
108+
fluidLayout: false // Set to true to use bootstrap3 container-fluid and row-fluid classes.
109+
useContainer: true // Set to false to use an unstyled "accounts-entry-container" class instead of a bootstrap3 "container" or "container-fluid" class.
110+
signInAfterRegistration: true // Set to false to avoid prevent users being automatically signed up upon sign-up e.g. to wait until their email has been verified.
111+
emailVerificationPendingRoute: '/verification-pending' // The route to which users should be directed after sign-up. Only relevant if signInAfterRegistration is false.
112+
showSpinner: true // Show the spinner when the client is talking to the server (spin.js)
113+
spinnerOptions: { color: "#000", top: "80%" } // options as per [spin.js](http://fgnass.github.io/spin.js/)
114+
122115
});
123116
});
124117
```
@@ -152,4 +145,4 @@ dashboard (used after signing in).
152145

153146
## Interested in building a quick meteor app that starts with Accounts-Entry?
154147

155-
We've created a [meteor-boilerplate repo](http://github.differential.io/meteor-boilerplate/) that you can clone as a starting point for an app. It follows all our standards that we use for building apps for our clients.
148+
We've created a [meteor-boilerplate repo](http://github.differential.com/meteor-boilerplate/) that you can clone as a starting point for an app. It follows all our standards that we use for building apps for our clients.

client/entry.coffee

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
AccountsEntry =
22
settings:
33
wrapLinks: true
4-
homeRoute: '/home'
4+
homeRoute: '/'
55
dashboardRoute: '/dashboard'
66
passwordSignupFields: 'EMAIL_ONLY'
77
emailToLower: true
88
usernameToLower: false
99
entrySignUp: '/sign-up'
1010
extraSignUpFields: []
1111
showOtherLoginServices: true
12+
fluidLayout: false
13+
useContainer: true
14+
signInAfterRegistration: true
15+
emailVerificationPendingRoute: '/verification-pending'
16+
showSpinner: true
17+
spinnerOptions: { color: "#000", top: "80%" }
1218

1319
isStringEmail: (email) ->
1420
emailPattern = /^([\w.-]+)@([\w.-]+)\.([a-zA-Z.]{2,6})$/i

client/helpers.coffee

+25
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,28 @@ UI.registerHelper 'passwordLoginService', ->
3838

3939
UI.registerHelper 'showCreateAccountLink', ->
4040
return !Accounts._options.forbidClientAccountCreation
41+
42+
UI.registerHelper 'fluidLayout', ->
43+
AccountsEntry.settings.fluidLayout is true
44+
45+
UI.registerHelper 'talkingToServer', ->
46+
if AccountsEntry.settings.showSpinner is true
47+
Meteor.Spinner.options = AccountsEntry.settings.spinnerOptions
48+
return (Session.get('talkingToServer') is true)
49+
else
50+
return false
51+
52+
UI.registerHelper 'containerCSSClass', ->
53+
if AccountsEntry.settings.useContainer is false
54+
"accounts-entry-container"
55+
else
56+
if AccountsEntry.settings.fluidLayout is true
57+
"container-fluid"
58+
else
59+
"container"
60+
61+
UI.registerHelper 'rowCSSClass', ->
62+
if AccountsEntry.settings.fluidLayout is true
63+
"row-fluid"
64+
else
65+
"row"

client/t9n/arabic.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ar =
2525
configure: "تعديل"
2626
with: "مع"
2727
createAccount: "افتح حساب جديد"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "و"
2931
"Match failed": "المطابقة فشلت"
3032
"User not found": "اسم المستخدم غير موجود"

client/t9n/english.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ en =
2525
configure: "Configure"
2626
with: "with"
2727
createAccount: "Create an Account"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "and"
2931
"Match failed": "Match failed"
3032
"User not found": "User not found"

client/t9n/french.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ fr =
2525
configure: "Configurer"
2626
with: "avec"
2727
createAccount: "Créer un compte"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "et"
2931

3032
error:

client/t9n/german.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ de =
2525
configure: "Konfigurieren"
2626
with: "mit"
2727
createAccount: "Konto erzeugen"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "und"
2931

3032
error:

client/t9n/hebrew.coffee

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
he =
2+
signIn: "כניסה לחשבון"
3+
signin: "כניסה לחשבון"
4+
signOut: "יציאה"
5+
signUp: "חשבון חדש"
6+
OR: "או"
7+
forgotPassword: "שחכת סיסמא?"
8+
emailAddress: "כתובת Email"
9+
emailResetLink: "קישור לאיפוס Email"
10+
dontHaveAnAccount: "אין לך חשבון?"
11+
resetYourPassword: "איפוס סיסמא"
12+
updateYourPassword: "עדכון סיסמא"
13+
password: "סיסמא"
14+
usernameOrEmail: "שם משתמש או Email"
15+
email: "Email"
16+
ifYouAlreadyHaveAnAccount: "אם יש לך חשבון"
17+
signUpWithYourEmailAddress: "הירשם עם כתובת ה-Email"
18+
username: "שם משתמש"
19+
optional: "שדה רשות"
20+
signupCode: "קוד הרשמה"
21+
clickAgree: "על ידי סיום תהליך ההרשמה, הינך מסכים"
22+
privacyPolicy: "לתנאי הפרטיות"
23+
terms: "לתנאי השימוש"
24+
sign: "הירשם"
25+
configure: "הגדרות"
26+
with: "עם"
27+
createAccount: "חשבון חדש"
28+
and: "ו"
29+
"Match failed": "התאמה נכשלה (Match Failed)"
30+
"User not found": "המשתמש לא נמצא"
31+
32+
error:
33+
minChar: "הסיסמה חייבת לכלול 7 תווים."
34+
pwOneLetter: "הסיסמה חייבת לכלות אות אחת."
35+
pwOneDigit: "הסיסמה חייבת לכלות מספר אחד."
36+
usernameRequired: "חובה להזין שם משתמש."
37+
emailRequired: "חובה להזין Email."
38+
signupCodeRequired: "חובה להזין קוד הרשמה."
39+
signupCodeIncorrect: "קוד ההרשמה שגוי."
40+
signInRequired: "אין לך רשות לבצע פעולה זאת."
41+
usernameIsEmail: "שם המשתמש לא יכול להיות כתובת Email."
42+
43+
T9n.map "he", he

client/t9n/italian.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ it =
2525
configure: "Configura"
2626
with: "con"
2727
createAccount: "Crea un Account"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "e"
2931
"Match failed": "Riscontro fallito"
3032
"User not found": "Utente non trovato"

client/t9n/polish.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pl =
2525
configure: "Konfiguruj"
2626
with: "z"
2727
createAccount: "Utwórz konto"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "i"
2931

3032
error:

client/t9n/portuguese.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pt =
2525
configure: "Configurar"
2626
with: "com"
2727
createAccount: "Criar Conta"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "e"
2931
"Match failed": "Usuário ou senha não encontrado"
3032
"User not found": "Usuário não encontrado"

client/t9n/russian.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ru =
2525
configure: "Конфигурировать"
2626
with: "с"
2727
createAccount: "Создать аккаунт"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "и"
2931
"Match failed": "Не совпадают"
3032
"User not found": "Пользователь не найден"

client/t9n/slovene.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ sl =
2525
configure: "Nastavi"
2626
with: "z"
2727
createAccount: "Nova registracija"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "in"
2931
"Match failed": "Prijava neuspešna"
3032
"User not found": "Uporabnik ne obstaja"

client/t9n/spanish.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ es =
2424
configure: "Disposición"
2525
with: "con"
2626
createAccount: "Crear cuenta"
27+
verificationPending: "Confirm your email address"
28+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2729
and: "y"
2830

2931
error:

client/t9n/swedish.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ sv =
2525
configure: "Konfigurera"
2626
with: "med"
2727
createAccount: "Skapa ett konto"
28+
verificationPending: "Confirm your email address"
29+
verificationPendingDetails: "A confirmation email has been sent to the email address you provided. Click on the confirmation link in the email to activate your account."
2830
and: "och"
2931
"Match failed": "Matchning misslyckades"
3032
"User not found": "Användaren hittades inte"

client/views/forgotPassword/forgotPassword.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Template.entryForgotPassword.events
1313
Session.set('entryError', 'Email is required')
1414
return
1515

16+
Session.set 'talkingToServer', true
1617
Accounts.forgotPassword({
1718
email: Session.get('email')
1819
}, (error)->
20+
Session.set 'talkingToServer', false
1921
if error
2022
Session.set('entryError', error.reason)
2123
else

client/views/forgotPassword/forgotPassword.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template name='entryForgotPassword'>
2-
<div class="container">
3-
<div class="row">
2+
<div class="{{containerCSSClass}}">
3+
<div class="{{rowCSSClass}}">
44
{{#if logo}}
55
<div class="entry-logo">
66
<a href="/"><img src="{{logo}}" alt="logo"></a>
@@ -20,6 +20,9 @@ <h3>{{t9n 'forgotPassword'}}</h3>
2020
{{#if showSignupCode}}
2121
<p class="entry-signup-cta">{{t9n 'dontHaveAnAccount'}} <a href="{{pathFor 'entrySignUp'}}">{{t9n 'signUp'}}</a></p>
2222
{{/if}}
23+
{{#if talkingToServer}}
24+
{{> spinner}}
25+
{{/if}}
2326
</div>
2427
</div>
2528
</div>

client/views/resetPassword/resetPassword.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Template.entryResetPassword.events
3232

3333
if passwordErrors then return
3434

35+
Session.set 'talkingToServer', true
3536
Accounts.resetPassword Session.get('resetToken'), password, (error) ->
37+
Session.set 'talkingToServer', false
3638
if error
3739
Session.set('entryError', (error.reason || "Unknown error"))
3840
else

client/views/resetPassword/resetPassword.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template name='entryResetPassword'>
2-
<div class="container">
3-
<div class="row">
2+
<div class="{{containerCSSClass}}">
3+
<div class="{{rowCSSClass}}">
44
{{#if logo}}
55
<div class="entry-logo">
66
<a href="/"><img src="{{logo}}" alt="logo"></a>
@@ -20,6 +20,9 @@ <h3>{{t9n "resetYourPassword"}}</h3>
2020
{{#if showSignupCode}}
2121
<p class="entry-signup-cta">{{t9n 'dontHaveAnAccount'}} <a href="{{pathFor 'entrySignUp'}}">{{t9n 'signUp'}}</a></p>
2222
{{/if}}
23+
{{#if talkingToServer}}
24+
{{> spinner}}
25+
{{/if}}
2326
</div>
2427
</div>
2528
</div>

client/views/signIn/signIn.coffee

+2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ AccountsEntry.entrySignInEvents = {
3737

3838
Session.set('email', email)
3939
Session.set('password', $('input[name="password"]').val())
40+
Session.set 'talkingToServer', true
4041

4142
Meteor.loginWithPassword(Session.get('email'), Session.get('password'), (error)->
4243
Session.set('password', undefined)
44+
Session.set 'talkingToServer', false
4345
if error
4446
T9NHelper.accountsError error
4547
else if Session.get('fromWhere')

0 commit comments

Comments
 (0)