completed content manager
This commit is contained in:
@@ -1,20 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="https://unpkg.com/htmx.org@2.0.1" integrity="sha384-QWGpdj554B4ETpJJC9z+ZHJcA/i59TyjxEPXiiUgN2WmTyV5OEZWCD6gQhgkdpB/" crossorigin="anonymous"></script>
|
||||
<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>
|
||||
|
||||
<p>Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.</p>
|
||||
<h3>Manager for SERA-HP's databases.</h3>
|
||||
|
||||
<button hx-get="/api/hello"
|
||||
hx-trigger="click"
|
||||
hx-swap="afterend"
|
||||
hx-target="#list"
|
||||
>
|
||||
Click Me!
|
||||
</button>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/new-news.html">New News</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="list"></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>
|
||||
|
||||
Reference in New Issue
Block a user