Skip to content

Instantly share code, notes, and snippets.

@jkresner
Created December 3, 2012 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkresner/4193240 to your computer and use it in GitHub Desktop.
Save jkresner/4193240 to your computer and use it in GitHub Desktop.
Meteor Template
Template.hacks_detail.hack = -> Hacks.findOne({ _id : Session.get('hack_id') })
Template.hacks_detail.creatorName = ->
owner = Meteor.users.findOne @owner
if owner then displayName(owner) else ''
<template name="hacks_detail">
<h2>hack details:</h2>
<table class="table table-bordered table-striped">
<colgroup>
<col class="span1">
<col class="span7">
</colgroup>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
{{#with hack}}
<tbody>
<tr>
<td><label>Name</label>
</td><td>{{ title }}</td>
</tr>
<tr>
<td><label>By</label>
</td><td>{{ creatorName }}</td>
</tr>
<tr>
<td><label>Description</label>
</td><td>{{ description }}</td>
</tr>
<tr>
<td><label>Github Url</label>
</td><td>{{ url_github }}</td>
</tr>
<tr>
<td><label>Public</label>
</td><td>{{ ispublic }}</td>
</tr>
<tr>
<td><label>Start</label>
</td><td>{{ start }}</td>
</tr>
<tr>
<td><label>End</label>
</td><td>{{ end }}</td>
</tr>
</tbody>
{{/with}}
</table>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment