73 lines
2.9 KiB
Handlebars
73 lines
2.9 KiB
Handlebars
<div class="page-header">
|
|
<div>
|
|
<h2>Screens</h2>
|
|
<p>Register display endpoints and keep playlist assignments in sync.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card card-outline card-primary" data-table-search-container>
|
|
<div class="card-header">
|
|
<h3 class="card-title">Existing screens</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 screens" aria-label="Search screens" data-table-search />
|
|
</div>
|
|
{{#if (hasPermission currentUser 'screens.create')}}
|
|
<a class="btn btn-primary btn-sm" href="/screens/new">Add screen</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>Player URL</th>
|
|
<th>Playlist</th>
|
|
<th>Connected clients</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#if screens.length}}
|
|
{{#each screens}}
|
|
<tr data-table-search-row>
|
|
<td data-label="Name">{{name}}</td>
|
|
<td data-label="Player URL"><a href="{{playerUrl slug}}" target="_blank">{{playerUrl slug}}</a></td>
|
|
<td data-label="Playlist">{{playlist_name}}</td>
|
|
<td data-label="Connected clients">
|
|
{{#if player_connection_count}}
|
|
<div class="connection-count">{{player_connection_count}} connected</div>
|
|
{{else}}
|
|
<span class="empty">No clients connected.</span>
|
|
{{/if}}
|
|
</td>
|
|
<td data-label="Actions">
|
|
{{#if (anyPermission ../currentUser 'screens.update' 'screens.delete')}}
|
|
<div class="actions">
|
|
{{#if (hasPermission ../currentUser 'screens.update')}}
|
|
<a class="btn btn-sm btn-primary" href="/screens/{{id}}/edit">Edit</a>
|
|
{{/if}}
|
|
{{#if (hasPermission ../currentUser 'screens.delete')}}
|
|
<form class="inline-form" method="post" action="/screens/{{id}}/delete" data-confirm-message="Delete this screen?">
|
|
<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="5" class="empty">No screens yet.</td></tr>
|
|
{{/if}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{{> table-pagination pagination=pagination basePath="/screens"}}
|
|
</div>
|
|
|