Added gallery database and refactored src-manager
This commit is contained in:
@@ -27,9 +27,14 @@
|
||||
<li>
|
||||
<a href="/new-news.html">New News</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/new-gallery-image.html">New Gallery Image</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<button hx-get="/api/news-list" hx-trigger="click" hx-swap="innerHTML" hx-target="#entries">Refresh</button>
|
||||
<h4>News</h4>
|
||||
|
||||
<button hx-get="/api/news-list" hx-trigger="click" hx-swap="innerHTML" hx-target="#news-entries">Refresh</button>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -40,11 +45,33 @@
|
||||
<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>
|
||||
<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>
|
||||
htmx.ajax('GET', '/api/news-list', {target: '#entries', swap: 'innerHTML'});
|
||||
const buttons = document.getElementsByTagName('button');
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
for (const btn of buttons) {
|
||||
btn.click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user