Add show management and going-live controls to admin
- admin/shows.php: list shows - admin/show_edit.php: add, edit and delete shows, with validated background image uploads saved under generated names - admin/index.php: queue the next show, switch the live show, or clear the queue - includes/broadcasts.php: setBroadcastShow() and clearQueuedShow(), shared by the dashboard and cli/set_show.php - includes/admin_layout.php: flash messages and Shows nav link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
babb71660c
commit
6e61fc6bda
7 files changed
+297
-12
No files matched your search
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
require __DIR__ . '/../includes/auth.php';
|
||||
require __DIR__ . '/../includes/admin_layout.php';
|
||||
|
||||
$admin = requireAdmin();
|
||||
$shows = getDB()->query('SELECT id, slug, name, background_image FROM shows ORDER BY name')->fetchAll();
|
||||
|
||||
adminHeader('Shows', $admin);
|
||||
?>
|
||||
<ul class="actions">
|
||||
<li><a href="show_edit.php" class="button primary small">Add a show</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="table-wrapper">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Background</th>
|
||||
<th>Name</th>
|
||||
<th>Slug</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($shows as $show): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php if ($show['background_image']): ?>
|
||||
<img src="../images/backgrounds/<?= e(rawurlencode($show['background_image'])) ?>" alt="" style="width:80px;height:50px;object-fit:cover;border-radius:4px;display:block;">
|
||||
<?php else: ?>
|
||||
<em>Default</em>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= e($show['name']) ?></td>
|
||||
<td><code><?= e($show['slug']) ?></code></td>
|
||||
<td><a href="show_edit.php?id=<?= (int)$show['id'] ?>">Edit</a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!$shows): ?>
|
||||
<tr><td colspan="4">No shows yet.</td></tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
adminFooter();
|
||||
Reference in new issue
Block a user