80 lines
3.7 KiB
Handlebars
80 lines
3.7 KiB
Handlebars
<div class="page-header">
|
|
<div>
|
|
<h2>Timetables</h2>
|
|
<p>Store grouped events with start and end times so a timetable region can show what is coming up next.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-outline card-primary" data-table-search-container data-table-pagination-card>
|
|
<div class="card-header">
|
|
<h3 class="card-title">Saved groups</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 timetables" aria-label="Search timetables" data-table-search />
|
|
</div>
|
|
{{#if (hasPermission currentUser 'timetables.create')}}
|
|
<a class="btn btn-primary btn-sm" href="/data-sources/timetables/new">Add timetable group</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 data-table-sort-key="name">Name</th>
|
|
<th data-table-sort-key="description">Description</th>
|
|
<th data-table-sort-key="timezone">Time zone</th>
|
|
<th data-table-sort-key="entries">Entries</th>
|
|
<th data-table-sort-key="next_start">Next start</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#if timetableGroups.length}}
|
|
{{#each timetableGroups}}
|
|
<tr data-table-search-row>
|
|
<td data-label="Name">{{name}}</td>
|
|
<td data-label="Description" class="text-break">{{short_description}}</td>
|
|
<td data-label="Time zone">{{timeZone}}</td>
|
|
<td data-label="Entries">{{entry_count}}</td>
|
|
<td data-label="Next start">
|
|
{{#if nextStartValue}}
|
|
<time datetime="{{nextStartValue}}">{{nextStartLabel}}</time>
|
|
{{else}}
|
|
{{nextStartLabel}}
|
|
{{/if}}
|
|
</td>
|
|
<td data-label="Actions">
|
|
{{#if (anyPermission ../currentUser 'timetables.create' 'timetables.update' 'timetables.delete')}}
|
|
<div class="actions">
|
|
{{#if (hasPermission ../currentUser 'timetables.update')}}
|
|
<a class="btn btn-sm btn-primary" href="/data-sources/timetables/{{id}}/edit">Edit</a>
|
|
{{/if}}
|
|
{{#if (hasPermission ../currentUser 'timetables.create')}}
|
|
<a class="btn btn-sm btn-secondary" href="/data-sources/timetables/{{id}}/duplicate">Dupe</a>
|
|
{{/if}}
|
|
{{#if (hasPermission ../currentUser 'timetables.delete')}}
|
|
<form class="inline-form" method="post" action="/data-sources/timetables/{{id}}/delete" data-confirm-message="Delete this timetable group?">
|
|
{{#if inUse}}
|
|
<button class="btn btn-sm btn-outline-danger" type="submit" disabled>Delete</button>
|
|
{{else}}
|
|
<button class="btn btn-sm btn-danger" type="submit">Delete</button>
|
|
{{/if}}
|
|
</form>
|
|
{{/if}}
|
|
</div>
|
|
{{else}}
|
|
<span class="empty">-</span>
|
|
{{/if}}
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
{{else}}
|
|
<tr data-table-search-empty-default><td colspan="6" class="empty">No timetable groups yet.</td></tr>
|
|
{{/if}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{> table-pagination pagination=pagination basePath="/data-sources/timetables" alwaysShow=true}}
|
|
</div> |