Last active
August 29, 2015 14:01
-
-
Save kingluddite/02b138f3d8e5dece2f32 to your computer and use it in GitHub Desktop.
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
Handlebars.registerHelper("formatDate", function(datetime) { | |
if (moment) { | |
return moment(datetime).format("MM/DD/YYYY"); | |
} | |
else { | |
return datetime; | |
} | |
}); |
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
<template name="Projects"> | |
<div class="page-header"> | |
<h1>Projects<small> list</small></h1> | |
</div> | |
<table class="table table-bordered table-striped table-hover"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Client</th> | |
<th>Due Date</th> | |
<th>Status</th> | |
</tr> | |
</thead> | |
<tbody> | |
{{#each projectList}} | |
{{> ProjectRow}} | |
{{/each}} | |
</tbody> | |
</table> | |
</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
<template name="ProjectRow"> | |
<tr class="projectRow"> | |
<td>{{name}}</td> | |
<td>{{client}}</td> | |
<td>{{duedate}}</td> | |
<td>{{status}}</td> | |
</tr> | |
</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
Template.Projects.projectList = function() { | |
return Projects.find(); | |
} |
helpers.js goes in /client/lib/helpers/ and is used to format date
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: projects.js goes inside /client/views/pages/projects/ directory
I created a separate folder to hold all stuff for the projects page.