Commit c8b07469ee4d0807f321311a66ff22b4bbf21aed

Authored by Ryan Glover
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.
... ... @@ -19,4 +19,5 @@ browser-policy
19 19 meteorhacks:npm
20 20  
21 21  
22   -npm-container
23 22 \ No newline at end of file
  23 +npm-container
  24 +themeteorchef:bert
... ...
... ... @@ -68,6 +68,7 @@ spacebars-compiler@1.0.4
68 68 srp@1.0.2
69 69 standard-app-packages@1.0.4
70 70 templating@1.0.11
  71 +themeteorchef:bert@1.0.1
71 72 themeteorchef:jquery-validation@1.13.1
72 73 tracker@1.0.5
73 74 twbs:bootstrap@3.3.1_2
... ...
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 }
... ...
client/layouts/layout-default.html
1 1 <template name="layoutDefault">
  2 + {{>bertAlert}}
2 3 {{>header}}
3 4 <div class="container">
4 5 {{>yield}}
... ...