Added HTML
This commit is contained in:
27
frontend/htmx/contents/dash/base.html
Normal file
27
frontend/htmx/contents/dash/base.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ .Title }}</title>
|
||||
|
||||
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
|
||||
|
||||
<link rel="stylesheet" href="/static/css/app.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<nav>
|
||||
<a href="/dashboard">Dashboard</a>
|
||||
<a href="/items">Inventar</a>
|
||||
<a href="/projects">Projekte</a>
|
||||
<a href="/locations">Orte</a>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
{{ template "content" . }}
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
24
frontend/htmx/contents/dash/dashboard.html
Normal file
24
frontend/htmx/contents/dash/dashboard.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ define "content" }}
|
||||
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
<div class="cards">
|
||||
|
||||
<div class="card">
|
||||
<h2>{{ .Stats.Items }}</h2>
|
||||
<p>Items</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>{{ .Stats.Projects }}</h2>
|
||||
<p>Projekte</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>{{ .Stats.Locations }}</h2>
|
||||
<p>Orte</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
21
frontend/htmx/contents/dash/inventory.html
Normal file
21
frontend/htmx/contents/dash/inventory.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ define "content" }}
|
||||
|
||||
<h1>Inventar</h1>
|
||||
|
||||
<input
|
||||
type="search"
|
||||
name="q"
|
||||
placeholder="Suchen..."
|
||||
hx-get="/api/items/search"
|
||||
hx-trigger="keyup changed delay:300ms"
|
||||
hx-target="#items"
|
||||
>
|
||||
|
||||
<div
|
||||
id="items"
|
||||
hx-get="/api/items"
|
||||
hx-trigger="load"
|
||||
>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
32
frontend/htmx/contents/dash/itemlist.html
Normal file
32
frontend/htmx/contents/dash/itemlist.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<table>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Kategorie</th>
|
||||
<th>Gesamt</th>
|
||||
<th>Frei</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
{{ range . }}
|
||||
|
||||
<tr>
|
||||
|
||||
<td>{{ .Name }}</td>
|
||||
|
||||
<td>{{ .Category }}</td>
|
||||
|
||||
<td>{{ .TotalQuantity }}</td>
|
||||
|
||||
<td>{{ .FreeQuantity }}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
11
frontend/htmx/contents/dash/locations.html
Normal file
11
frontend/htmx/contents/dash/locations.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{ define "content" }}
|
||||
|
||||
<h1>Lagerorte</h1>
|
||||
|
||||
<div
|
||||
hx-get="/api/locations"
|
||||
hx-trigger="load"
|
||||
>
|
||||
</div>
|
||||
|
||||
{{ end }}
|
||||
21
frontend/htmx/contents/dash/projects.html
Normal file
21
frontend/htmx/contents/dash/projects.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ define "content" }}
|
||||
|
||||
<h1>Projekte</h1>
|
||||
|
||||
<button
|
||||
hx-get="/projects/new"
|
||||
hx-target="#modal"
|
||||
>
|
||||
Neues Projekt
|
||||
</button>
|
||||
|
||||
<div
|
||||
hx-get="/api/projects"
|
||||
hx-trigger="load"
|
||||
hx-target="this"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div id="modal"></div>
|
||||
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user