Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
108 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Errors = new Mongo.Collection(null); | ||
|
||
throwError = function(message) { | ||
Errors.insert({message: message}); | ||
}; | ||
|
||
Template.errors.helpers({ | ||
errors: function() { | ||
return Errors.find(); | ||
} | ||
}); | ||
|
||
Template.error.rendered = function() { | ||
var error = this.data; | ||
Meteor.setTimeout(function () { | ||
Errors.remove(error._id); | ||
}, 3000); | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<template name="layout"> | ||
<div class="container"> | ||
{{> header}} | ||
{{> errors}} | ||
<div id="main"> | ||
{{> yield}} | ||
</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,14 @@ | ||
<template name="errors"> | ||
<div class="errors"> | ||
{{#each errors}} | ||
{{> error}} | ||
{{/each}} | ||
</div> | ||
</template> | ||
|
||
<template name="error"> | ||
<div class="alert alert-danger" role="alert"> | ||
<button type="button" class="close" data-dismiss="alert">×</button> | ||
{{message}} | ||
</div> | ||
</template> |
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
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