65 lines
2.5 KiB
Handlebars
65 lines
2.5 KiB
Handlebars
<div class="page-header">
|
|
<div>
|
|
<h2>Slide templates</h2>
|
|
<p>Design reusable canvas layouts and region definitions.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-outline card-primary" data-table-search-container>
|
|
<div class="card-header">
|
|
<h3 class="card-title">Existing templates</h3>
|
|
<div class="card-tools d-flex flex-nowrap align-items-center gap-2">
|
|
<div class="input-group input-group-sm flex-shrink-1" style="width: min(14rem, 100%);">
|
|
<span class="input-group-text" aria-hidden="true"><i class="bi bi-search"></i></span>
|
|
<input type="search" class="form-control" placeholder="Search templates" aria-label="Search templates" data-table-search />
|
|
</div>
|
|
{{#if (hasPermission currentUser 'templates.create')}}
|
|
<a class="btn btn-primary btn-sm" href="/templates/new">Create template</a>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
<div class="card-body table-responsive p-0">
|
|
<table class="table table-striped w-100 mb-0" data-table-searchable>
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Canvas</th>
|
|
<th>Regions</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#if templates.length}}
|
|
{{#each templates}}
|
|
<tr data-table-search-row>
|
|
<td data-label="Name">{{name}}</td>
|
|
<td data-label="Canvas">{{canvas_size_width}}x{{canvas_size_height}}</td>
|
|
<td data-label="Regions">{{regionCount}}</td>
|
|
<td data-label="Actions">
|
|
{{#if (anyPermission ../currentUser 'templates.update' 'templates.delete')}}
|
|
<div class="actions">
|
|
{{#if (hasPermission ../currentUser 'templates.update')}}
|
|
<a class="btn btn-sm btn-primary" href="/templates/{{id}}/edit">Edit</a>
|
|
{{/if}}
|
|
{{#if (hasPermission ../currentUser 'templates.delete')}}
|
|
<form class="inline-form" method="post" action="/templates/{{id}}/delete" data-confirm-message="Delete this template?">
|
|
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
|
</form>
|
|
{{/if}}
|
|
</div>
|
|
{{else}}
|
|
<span class="empty">-</span>
|
|
{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
{{else}}
|
|
<tr data-table-search-empty-default><td colspan="4" class="empty">No templates yet.</td></tr>
|
|
{{/if}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{> table-pagination pagination=pagination basePath="/templates"}}
|
|
</div>
|
|
|