Files
sera-new-hp/src-manager/pages/index.html

51 lines
1.2 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>
</ul>
<button hx-get="/api/news-list" hx-trigger="click" hx-swap="innerHTML" hx-target="#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="entries" hx-confirm='Are you sure you want to delete this news?' hx-target="closest tr" hx-swap="outerHTML"></tbody>
</table>
<script>
htmx.ajax('GET', '/api/news-list', {target: '#entries', swap: 'innerHTML'});
</script>
</body>
</html>