Commit c8b07469ee4d0807f321311a66ff22b4bbf21aed
1 parent
6b05a17126
Exists in
master
Add themeteorchef:bert to help us with alerts.
Update /client/layouts/layout-default.html to include bertAlert template. Update all client-side controllers to use Bert for error and success messages. Closes #9.
Showing
8 changed files
with
18 additions
and
6 deletions
Show diff stats
.meteor/packages
.meteor/versions
client/controllers/authenticated/header.js
... | ... | @@ -37,7 +37,9 @@ Template.header.events({ |
37 | 37 | 'click .logout': function(){ |
38 | 38 | Meteor.logout(function(error){ |
39 | 39 | if(error){ |
40 | - alert(error.reason); | |
40 | + Bert.alert(error.reason, 'danger'); | |
41 | + } else { | |
42 | + Bert.alert('Succesfully logged out!', 'success'); | |
41 | 43 | } |
42 | 44 | }); |
43 | 45 | } | ... | ... |
client/controllers/public/login.js
... | ... | @@ -45,7 +45,9 @@ Template.login.rendered = function(){ |
45 | 45 | // Log the user in. |
46 | 46 | Meteor.loginWithPassword(user.email, user.password, function(error){ |
47 | 47 | if(error){ |
48 | - alert(error.reason); | |
48 | + Bert.alert(error.reason, 'danger'); | |
49 | + } else { | |
50 | + Bert.alert('Logged in!', 'success'); | |
49 | 51 | } |
50 | 52 | }); |
51 | 53 | } | ... | ... |
client/controllers/public/recover-password.js
... | ... | @@ -37,7 +37,9 @@ Template.recoverPassword.rendered = function(){ |
37 | 37 | // Call the send reset password email method. |
38 | 38 | Accounts.forgotPassword({email: email}, function(error){ |
39 | 39 | if(error){ |
40 | - alert(error.reason); | |
40 | + Bert.alert(error.reason, 'danger'); | |
41 | + } else { | |
42 | + Bert.alert('Check your inbox for a reset link!', 'success'); | |
41 | 43 | } |
42 | 44 | }); |
43 | 45 | } | ... | ... |
client/controllers/public/reset-password.js
... | ... | @@ -46,8 +46,9 @@ Template.resetPassword.rendered = function(){ |
46 | 46 | // Reset the user's password. |
47 | 47 | Accounts.resetPassword(token, password, function(error){ |
48 | 48 | if(error){ |
49 | - alert(error.reason); | |
49 | + Bert.alert(error.reason, 'danger'); | |
50 | 50 | } else { |
51 | + Bert.alert('Password successfully reset!', 'success'); | |
51 | 52 | Session.set('resetPasswordToken', null); |
52 | 53 | } |
53 | 54 | }); | ... | ... |
client/controllers/public/signup.js
... | ... | @@ -47,7 +47,9 @@ Template.signup.rendered = function(){ |
47 | 47 | // Create the user's account. |
48 | 48 | Accounts.createUser({email: user.email, password: user.password}, function(error){ |
49 | 49 | if(error){ |
50 | - alert(error.reason); | |
50 | + Bert.alert(error.reason, 'danger'); | |
51 | + } else { | |
52 | + Bert.alert('Welcome!', 'success'); | |
51 | 53 | } |
52 | 54 | }); |
53 | 55 | } | ... | ... |