Commit 5f6f6fbb0bf85763f17b89075fbd69b3adc65b33

Authored by Ryan Glover
1 parent 62a1d9344a
Exists in master

Clean up spacing. Add an .editorconfig to permanently wrangle spacing in editors.

... ... @@ -0,0 +1,23 @@
  1 +# EditorConfig – Follow the rules, hippie.
  2 +# Make sure to install the plugin for your editor: http://editorconfig.org/#download (we use SublimeText or Atom).
  3 +# http://editorconfig.org
  4 +
  5 +# Root
  6 +root = true
  7 +
  8 +[*]
  9 +indent_style = space
  10 +indent_size = 2
  11 +end_of_line = lf
  12 +charset = utf-8
  13 +trim_trailing_whitespace = true
  14 +insert_final_newline = true
  15 +
  16 +[*.js]
  17 +indent_size = 2
  18 +
  19 +[*.coffee]
  20 +indent_size = 2
  21 +
  22 +[*.md]
  23 +trim_trailing_whitespace = false
... ...
client/controllers/public/login.coffee
1 1 ###
2   - Controller: Login
3   - Template: /client/views/public/login.html
  2 + Controller: Login
  3 + Template: /client/views/public/login.html
4 4 ###
5 5  
6 6 # Created
7 7 Template.login.created = ->
8   - # Code to run when template is created goes here.
  8 + # Code to run when template is created goes here.
9 9  
10 10 # Rendered
11 11 Template.login.rendered = ->
12   - # Code to run when template is rendered goes here.
  12 + # Code to run when template is rendered goes here.
13 13  
14 14 # Helpers
15 15 Template.login.helpers(
16   - example: ->
17   - # Code to run for helper function.
  16 + example: ->
  17 + # Code to run for helper function.
18 18 )
19 19  
20 20 # Events
21 21 Template.login.events(
22   - 'submit form': (e,t) ->
  22 + 'submit form': (e,t) ->
23 23  
24   - # Prevent form from submitting.
25   - e.preventDefault()
  24 + # Prevent form from submitting.
  25 + e.preventDefault()
26 26  
27   - # Grab the user's details.
28   - user =
29   - email: t.find('[name="emailAddress"]').value
30   - password: t.find('[name="password"]').value
  27 + # Grab the user's details.
  28 + user =
  29 + email: t.find('[name="emailAddress"]').value
  30 + password: t.find('[name="password"]').value
31 31  
32   - # Log the user in.
33   - Meteor.loginWithPassword(user.email, user.password, (error)->
34   - alert error.reason if error
35   - )
  32 + # Log the user in.
  33 + Meteor.loginWithPassword(user.email, user.password, (error)->
  34 + alert error.reason if error
  35 + )
36 36 )
... ...
client/controllers/public/recover-password.coffee
1 1 ###
2   - Controller: Recover Password
3   - Template: /client/views/public/recover-password.html
  2 + Controller: Recover Password
  3 + Template: /client/views/public/recover-password.html
4 4 ###
5 5  
6 6 # Created
7 7 Template.recoverPassword.created = ->
8   - # Code to run when template is created goes here.
  8 + # Code to run when template is created goes here.
9 9  
10 10 # Rendered
11 11 Template.recoverPassword.rendered = ->
12   - # Code to run when template is rendered goes here.
  12 + # Code to run when template is rendered goes here.
13 13  
14 14 # Helpers
15 15 Template.recoverPassword.helpers(
16   - example: ->
17   - # Code to run for helper function.
  16 + example: ->
  17 + # Code to run for helper function.
18 18 )
19 19  
20 20 # Events
21 21 Template.recoverPassword.events(
22   - 'click .example': (e,t) ->
23   - # Code to run for example event.
  22 + 'click .example': (e,t) ->
  23 + # Code to run for example event.
24 24 )
... ...
client/controllers/public/reset-password.coffee
1 1 ###
2   - Controller: Reset Password
3   - Template: /client/views/public/reset-password.html
  2 + Controller: Reset Password
  3 + Template: /client/views/public/reset-password.html
4 4 ###
5 5  
6 6 # Created
7 7 Template.resetPassword.created = ->
8   - # Code to run when template is created goes here.
  8 + # Code to run when template is created goes here.
9 9  
10 10 # Rendered
11 11 Template.resetPassword.rendered = ->
12   - # Code to run when template is rendered goes here.
  12 + # Code to run when template is rendered goes here.
13 13  
14 14 # Helpers
15 15 Template.resetPassword.helpers(
16   - example: ->
17   - # Code to run for helper function.
  16 + example: ->
  17 + # Code to run for helper function.
18 18 )
19 19  
20 20 # Events
21 21 Template.resetPassword.events(
22   - 'click .example': (e,t) ->
23   - # Code to run for example event.
  22 + 'click .example': (e,t) ->
  23 + # Code to run for example event.
24 24 )
... ...
client/controllers/public/signup.coffee
1 1 ###
2   - Controller: Signup
3   - Template: /client/views/public/signup.html
  2 + Controller: Signup
  3 + Template: /client/views/public/signup.html
4 4 ###
5 5  
6 6 # Created
7 7 Template.signup.created = ->
8   - # Code to run when template is created goes here.
  8 + # Code to run when template is created goes here.
9 9  
10 10 # Rendered
11 11 Template.signup.rendered = ->
12   - # Code to run when template is rendered goes here.
  12 + # Code to run when template is rendered goes here.
13 13  
14 14 # Helpers
15 15 Template.signup.helpers(
16   - example: ->
17   - # Code to run for helper function.
  16 + example: ->
  17 + # Code to run for helper function.
18 18 )
19 19  
20 20 # Events
21 21 Template.signup.events(
22   - 'submit form': (e,t) ->
23   -
24   - # Prevent form from submitting.
25   - e.preventDefault()
26   -
27   - # Grab the user's details.
28   - user =
29   - email: t.find('[name="emailAddress"]').value
30   - password: t.find('[name="password"]').value
31   -
32   - # Create the user's account.
33   - Meteor.call 'createUserAccount', user, (error) ->
34   -
35   - # If the account is created successfully, log the user in using the credentials
36   - # from above.
37   - if error
38   - alert error.reason
39   - else
40   - Meteor.loginWithPassword(user.email, user.password, (error)->
41   - alert error.reason if error
42   - )
43   -
  22 + 'submit form': (e,t) ->
  23 +
  24 + # Prevent form from submitting.
  25 + e.preventDefault()
  26 +
  27 + # Grab the user's details.
  28 + user =
  29 + email: t.find('[name="emailAddress"]').value
  30 + password: t.find('[name="password"]').value
  31 +
  32 + # Create the user's account.
  33 + Meteor.call 'createUserAccount', user, (error) ->
  34 +
  35 + # If the account is created successfully, log the user in using the credentials
  36 + # from above.
  37 + if error
  38 + alert error.reason
  39 + else
  40 + Meteor.loginWithPassword(user.email, user.password, (error)->
  41 + alert error.reason if error
  42 + )
44 43 )
... ...
client/helpers/helpers-ui.coffee
1 1 ###
2   - UI Helpers
3   - Define UI helpers for common template functionality.
  2 + UI Helpers
  3 + Define UI helpers for common template functionality.
4 4 ###
5 5  
6 6 # Example Helper
7 7 UI.registerHelper('example', ->
8   - # Helper code goes here.
  8 + # Helper code goes here.
9 9 )
... ...
client/layouts/layout-default.html
1 1 <template name="layoutDefault">
2   - {{>yield}}
  2 + {{>yield}}
3 3 </template>
... ...
client/routes/filters.coffee
1 1 ###
2   - Route Filters
3   - Filters for managing user access to application routes.
  2 + Route Filters
  3 + Filters for managing user access to application routes.
4 4 ###
5 5  
6 6 # Define Filters
7 7  
8 8 ###
9   - Filter: Check if a User is Logged In
10   - If a user is not logged in and attempts to go to an authenticated route,
11   - re-route them to the login screen.
  9 + Filter: Check if a User is Logged In
  10 + If a user is not logged in and attempts to go to an authenticated route,
  11 + re-route them to the login screen.
12 12 ###
13 13 checkUserLoggedIn = ->
14   - if not Meteor.loggingIn() and not Meteor.user()
15   - Router.go '/login'
16   - @pause
  14 + if not Meteor.loggingIn() and not Meteor.user()
  15 + Router.go '/login'
  16 + @pause
17 17  
18 18 ###
19   - Filter: Check if a User Exists
20   - If a user is logged in and attempts to go to a public route, re-route
21   - them to the main "logged in" screen.
  19 + Filter: Check if a User Exists
  20 + If a user is logged in and attempts to go to a public route, re-route
  21 + them to the main "logged in" screen.
22 22 ###
23 23 userAuthenticated = ->
24   - if not Meteor.loggingIn() and Meteor.user()
25   - Router.go '/'
  24 + if not Meteor.loggingIn() and Meteor.user()
  25 + Router.go '/'
26 26  
27 27 # Run Filters
28 28  
29 29 Router.onBeforeAction checkUserLoggedIn, except: [
30   - 'signup',
31   - 'login',
32   - 'recover-password',
33   - 'reset-password'
  30 + 'signup',
  31 + 'login',
  32 + 'recover-password',
  33 + 'reset-password'
34 34 ]
35 35  
36 36 Router.onBeforeAction userAuthenticated, only: [
37   - 'signup',
38   - 'login',
39   - 'recover-password',
40   - 'reset-password'
  37 + 'signup',
  38 + 'login',
  39 + 'recover-password',
  40 + 'reset-password'
41 41 ]
... ...
client/routes/routes-authenticated.coffee
1 1 Router.map(->
2   - @route('index',
3   - path: '/'
4   - template: 'index'
5   - onBeforeAction: ->
6   - # Code to run before route goes here.
7   - )
  2 + @route('index',
  3 + path: '/'
  4 + template: 'index'
  5 + onBeforeAction: ->
  6 + # Code to run before route goes here.
  7 + )
8 8 )
... ...
client/routes/routes-public.coffee
1 1 Router.map(->
2 2  
3   - @route('signup',
4   - path: '/signup'
5   - template: 'signup'
6   - onBeforeAction: ->
7   - # Code to run before route goes here.
8   - )
  3 + @route('signup',
  4 + path: '/signup'
  5 + template: 'signup'
  6 + onBeforeAction: ->
  7 + # Code to run before route goes here.
  8 + )
9 9  
10   - @route('login',
11   - path: '/login'
12   - template: 'login'
13   - onBeforeAction: ->
14   - # Code to run before route goes here.
15   - )
  10 + @route('login',
  11 + path: '/login'
  12 + template: 'login'
  13 + onBeforeAction: ->
  14 + # Code to run before route goes here.
  15 + )
16 16  
17   - @route('recover-password',
18   - path: '/recover-password'
19   - template: 'recoverPassword'
20   - onBeforeAction: ->
21   - # Code to run before route goes here.
22   - )
  17 + @route('recover-password',
  18 + path: '/recover-password'
  19 + template: 'recoverPassword'
  20 + onBeforeAction: ->
  21 + # Code to run before route goes here.
  22 + )
23 23  
24   - @route('reset-password',
25   - path: '/reset-password'
26   - template: 'resetPassword'
27   - onBeforeAction: ->
28   - # Code to run before route goes here.
29   - )
  24 + @route('reset-password',
  25 + path: '/reset-password'
  26 + template: 'resetPassword'
  27 + onBeforeAction: ->
  28 + # Code to run before route goes here.
  29 + )
30 30 )
... ...
client/stylesheets/sass/globals/_extends.scss
1 1 /*
2   - Clearfix
3   - via http://nicolasgallagher.com/micro-clearfix-hack
  2 + Clearfix
  3 + via http://nicolasgallagher.com/micro-clearfix-hack
4 4 */
5 5 %clearfix {
6 6 *zoom: 1;
... ...
client/stylesheets/sass/views/public/_login.scss
1 1 .login label {
2   - display: block;
3   - @extend %clearfix;
  2 + display: block;
  3 + @extend %clearfix;
4 4 }
... ...
client/views/authenticated/index.html
1 1 <template name="index">
2   - <h1>Index</h1>
  2 + <h1>Index</h1>
3 3 </template>
... ...
client/views/public/login.html
1 1 <template name="login">
2   - <form id="application-login" class="login">
3   - <div class="form-group">
4   - <label for="emailAddress">Email Address</label>
5   - <input type="email" name="emailAddress" class="form-control" placeholder="Email Address">
6   - </div> <!-- end .form-group -->
7   - <div class="form-group">
8   - <label for="password"><span class="pull-left">Password</span> <a class="pull-right" href="{{pathFor 'recover-password'}}">Forgot Password?</a></label>
9   - <input type="password" name="password" class="form-control" placeholder="Password">
10   - </div> <!-- end .form-group -->
11   - <div class="form-group">
12   - <input type="submit" class="btn btn-success" value="Login">
13   - </div> <!-- end .form-group -->
14   - </form>
15   - <p>Don't have an account? <a href="{{pathFor 'signup'}}">Sign Up</a>.</p>
  2 + <form id="application-login" class="login">
  3 + <div class="form-group">
  4 + <label for="emailAddress">Email Address</label>
  5 + <input type="email" name="emailAddress" class="form-control" placeholder="Email Address">
  6 + </div> <!-- end .form-group -->
  7 + <div class="form-group">
  8 + <label for="password"><span class="pull-left">Password</span> <a class="pull-right" href="{{pathFor 'recover-password'}}">Forgot Password?</a></label>
  9 + <input type="password" name="password" class="form-control" placeholder="Password">
  10 + </div> <!-- end .form-group -->
  11 + <div class="form-group">
  12 + <input type="submit" class="btn btn-success" value="Login">
  13 + </div> <!-- end .form-group -->
  14 + </form>
  15 + <p>Don't have an account? <a href="{{pathFor 'signup'}}">Sign Up</a>.</p>
16 16 </template>
... ...
client/views/public/notFound.html
1 1 <template name="notFound">
2   - <h1>404 &mdash; Not Found.</h1>
  2 + <h1>404 &mdash; Not Found.</h1>
3 3 </template>
... ...
client/views/public/recover-password.html
1 1 <template name="recoverPassword">
2   - <h1>Recover Password</h1>
  2 + <h1>Recover Password</h1>
3 3 </template>
... ...
client/views/public/reset-password.html
1 1 <template name="resetPassword">
2   - <h1>Reset Password</h1>
  2 + <h1>Reset Password</h1>
3 3 </template>
... ...
client/views/public/signup.html
1 1 <template name="signup">
2   - <form id="application-signup" class="signup">
3   - <div class="form-group">
4   - <label for="emailAddress">Email Address</label>
5   - <input type="email" name="emailAddress" class="form-control" placeholder="Email Address">
6   - </div> <!-- end .form-group -->
7   - <div class="form-group">
8   - <label for="password">Password</label>
9   - <input type="password" name="password" class="form-control" placeholder="Password">
10   - </div> <!-- end .form-group -->
11   - <div class="form-group">
12   - <input type="submit" class="btn btn-success" value="Sign Up">
13   - </div> <!-- end .form-group -->
14   - </form>
15   - <p>Already have an account? <a href="{{pathFor 'login'}}">Log In</a>.</p>
  2 + <form id="application-signup" class="signup">
  3 + <div class="form-group">
  4 + <label for="emailAddress">Email Address</label>
  5 + <input type="email" name="emailAddress" class="form-control" placeholder="Email Address">
  6 + </div> <!-- end .form-group -->
  7 + <div class="form-group">
  8 + <label for="password">Password</label>
  9 + <input type="password" name="password" class="form-control" placeholder="Password">
  10 + </div> <!-- end .form-group -->
  11 + <div class="form-group">
  12 + <input type="submit" class="btn btn-success" value="Sign Up">
  13 + </div> <!-- end .form-group -->
  14 + </form>
  15 + <p>Already have an account? <a href="{{pathFor 'login'}}">Log In</a>.</p>
16 16 </template>
... ...
collections/example.coffee
... ... @@ -2,24 +2,24 @@
2 2  
3 3 # Allow
4 4 Example.allow
5   - insert: (userId, doc) ->
6   - # ...
7   - update: (userId, doc, fields, modifier) ->
8   - # ...
9   - remove: (userId, doc) ->
10   - # ...
11   - fetch: ['owner'],
12   - transform: () ->
13   - # ...
  5 + insert: (userId, doc) ->
  6 + # ...
  7 + update: (userId, doc, fields, modifier) ->
  8 + # ...
  9 + remove: (userId, doc) ->
  10 + # ...
  11 + fetch: ['owner'],
  12 + transform: () ->
  13 + # ...
14 14  
15 15 # Deny
16 16 Example.deny
17   - insert: (userId, doc) ->
18   - # ...
19   - update: (userId, doc, fields, modifier) ->
20   - # ...
21   - remove: (userId, doc) ->
22   - # ...
23   - fetch: ['locked']
24   - transform: () ->
25   - # ...
  17 + insert: (userId, doc) ->
  18 + # ...
  19 + update: (userId, doc, fields, modifier) ->
  20 + # ...
  21 + remove: (userId, doc) ->
  22 + # ...
  23 + fetch: ['locked']
  24 + transform: () ->
  25 + # ...
... ...
server/admin/accounts.coffee
1 1 ###
2   - Accounts
3   - Server side account creation and manipulation methods.
  2 + Accounts
  3 + Server side account creation and manipulation methods.
4 4  
5   - Configuration:
6   - - forbidClientAccountCreation: Disallow client side account creation.
  5 + Configuration:
  6 + - forbidClientAccountCreation: Disallow client side account creation.
7 7  
8   - Methods:
9   - - createUserAccount: Performs a server-side account creation using the Meteor Accounts Password package.
  8 + Methods:
  9 + - createUserAccount: Performs a server-side account creation using the Meteor Accounts Password package.
10 10 ###
11 11  
12 12 # Configuration:
13 13 Accounts.config(
14   - forbidClientAccountCreation: true
  14 + forbidClientAccountCreation: true
15 15 )
16 16  
17 17 # Define Methods
18 18 Meteor.methods(
19 19  
20   - createUserAccount: (user)->
  20 + createUserAccount: (user)->
21 21  
22   - # Check values against correct pattern.
23   - pattern = { email: String, password: String }
24   - check(user, pattern)
  22 + # Check values against correct pattern.
  23 + pattern = { email: String, password: String }
  24 + check(user, pattern)
25 25  
26   - # Create the user.
27   - Accounts.createUser(user)
  26 + # Create the user.
  27 + Accounts.createUser(user)
28 28 )
... ...