Skip to content

Instantly share code, notes, and snippets.

@ritcheyer
Last active December 14, 2015 16:59
Show Gist options
  • Save ritcheyer/5118766 to your computer and use it in GitHub Desktop.
Save ritcheyer/5118766 to your computer and use it in GitHub Desktop.
I want to display the number of records returned in this policies dataset, but not sure how..
<!--
===================================
Update: using {{ policies.length }}
===================================
-->
{{#if policies.length}}
<table id="policiesTable" class="policy-table table-framework table-panel table-striped" border="0" cellpadding="0" cellspacing="0">
<thead class="table-head">
<tr>
<th class="policy-name">Name</th>
<th class="policy-description">Description</th>
<th class="policy-type hide">Type</th>
<th class="table-actions">Actions</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4">{{policies.length}}</td>
</tr>
</tfoot>
<tbody class="table-body">
{{!
<!-- keep around for testing <eritchey
<tr class="table-row">
<td class="policy-name">Policy Name</td>
<td class="policy-description">Lorem ipsum dolor sit amet, nonummy ligula volutpat hac integer nonummy. Suspendisse ultricies, congue etiam tellus, erat libero, nulla eleifend, mauris pellentesque. Suspendisse integer praesent vel, integer gravida mauris, fringilla vehicula lacinia non</td>
<td class="policy-type hide">Policy Type</td>
<td class="table-actions">
<a href="/policy/scaling/edit/' + policyData.id + '/" class="icon-edit" title="Edit this Policy"><span class="hide">Edit this Policy</span></a>
<i data-policyid="' + policyData.id + '" class="separator icon-trash" title="Delete this Policy"><span class="hide">Delete this Policy</span></i>
</td>
</tr>
-->
}}
{{#each policies}}
<tr class="table-row">
<td class="policy-name">{{policyName}}</td>
<td class="policy-description">{{description}}</td>
<td class="policy-type hide">{{policyType}}</td>
<td class="table-actions">
<ul class="form-group">
<li class="table-action"><a href="#policies/scaling/edit/{{id}}" class="icon-edit" title="Edit this Policy"><span class="hide">Edit this Policy</span></a></li>
<li class="table-action"><i data-policyid="{{id}}" class="icon-trash" title="Delete this Policy"><span class="hide">Delete this Policy</span></i></li>
</ul>
</td>
</tr>
{{/each}}
</tbody>
<caption class="hide msg"></caption>
</table>
{{else}}
<p>You haven't created any policies yet.</p>
{{/if}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment