78 lines
1.9 KiB
HTML
78 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Content Manager</title>
|
|
<script src="https://unpkg.com/htmx.org@2.0.2" integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ" crossorigin="anonymous"></script>
|
|
<style>
|
|
table, tr, td {
|
|
border: black solid 1px;
|
|
}
|
|
|
|
thead {
|
|
background-color: lightgray;
|
|
}
|
|
|
|
tbody {
|
|
background-color: beige;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Content Manager</h1>
|
|
|
|
<h3>Manager for SERA-HP's databases.</h3>
|
|
|
|
<ul>
|
|
<li>
|
|
<a href="/new-news.html">New News</a>
|
|
</li>
|
|
<li>
|
|
<a href="/new-gallery-image.html">New Gallery Image</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<h4>News</h4>
|
|
|
|
<button hx-get="/api/news-list" hx-trigger="click" hx-swap="innerHTML" hx-target="#news-entries">Refresh</button>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>ID</td>
|
|
<td>Date</td>
|
|
<td>Entry Type</td>
|
|
<td>Card Content</td>
|
|
<td>Actions</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="news-entries" hx-confirm='Are you sure you want to delete this news?' hx-target="closest tr" hx-swap="outerHTML"></tbody>
|
|
</table>
|
|
|
|
<h4>Gallery Images</h4>
|
|
|
|
<button hx-get="/api/gallery-image/list" hx-trigger="click" hx-swap="innerHTML" hx-target="#image-entries">Refresh</button>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<td>ID</td>
|
|
<td>Image Path</td>
|
|
<td>Caption</td>
|
|
<td>Actions</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="image-entries" hx-confirm='Are you sure you want to delete this image? (Actual data will not deleted.)' hx-target="closest tr" hx-swap="outerHTML"></tbody>
|
|
</table>
|
|
|
|
<script>
|
|
const buttons = document.getElementsByTagName('button');
|
|
|
|
window.addEventListener('load', () => {
|
|
for (const btn of buttons) {
|
|
btn.click();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|