Files
serwerowe_stefanczyk/Lekcja_08/views/list.hbs
T

40 lines
1.3 KiB
Handlebars

<h2>list cars</h2>
<section>
<table>
<tr>
<th>_id</th>
<th>model</th>
<th>ubezpieczony</th>
<th>benzyna</th>
<th>uszkodzony</th>
<th>naped4x4</th>
<th></th>
{{#if (gte privilege_level 1)}}
<th></th>
{{/if}}
</tr>
{{#each car}}
<tr>
<td>{{_id}}</td>
<td>{{model}}</td>
<td>{{ubezpieczony}}</td>
<td>{{benzyna}}</td>
<td>{{uszkodzony}}</td>
<td>{{naped4x4}}</td>
<td style="text-align: center;">
<button
onclick="alert(`id: {{_id}}\nModel: {{model}}\nubezpieczony: {{ubezpieczony}}\nbenzyna: {{benzyna}}\nuszkodzony: {{uszkodzony}}\nnaped4x4: {{naped4x4}}`);">INFO</button>
</td>
{{#if (gte ../privilege_level 1)}}
<td>
{{#if inFavs}}
<button onclick="window.location = `/unfav?id={{_id}}`">UNFAV</button>
{{else}}
<button onclick="window.location = `/fav?id={{_id}}`">FAV</button>
{{/if}}
</td>
{{/if}}
</tr>
{{/each}}
</table>
</section>