WebApp-Kategorien anzeigen
This commit is contained in:
parent
af9e2fc138
commit
9205d11802
2 changed files with 152 additions and 0 deletions
73
templates/categories.html
Normal file
73
templates/categories.html
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Kategorien</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Kategorien</h1>
|
||||
|
||||
<a href="/">Zurück</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>Neue Kategorie</h2>
|
||||
|
||||
<form action="/categories/add" method="post">
|
||||
|
||||
```
|
||||
<input
|
||||
type="text"
|
||||
name="category"
|
||||
placeholder="Neue Kategorie"
|
||||
required>
|
||||
|
||||
<button type="submit">
|
||||
Anlegen
|
||||
</button>
|
||||
```
|
||||
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<table border="1" cellpadding="5">
|
||||
|
||||
<tr>
|
||||
<th>Kategorie</th>
|
||||
<th>Schlüsselwörter</th>
|
||||
<th>Aktion</th>
|
||||
</tr>
|
||||
|
||||
{% for category, words in categories.items() %}
|
||||
|
||||
<tr>
|
||||
|
||||
```
|
||||
<td>
|
||||
{{ category }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ words|join(", ") }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a
|
||||
href="/categories/delete/{{ category }}"
|
||||
onclick="return confirm('Kategorie wirklich löschen?')">
|
||||
Löschen
|
||||
</a>
|
||||
</td>
|
||||
```
|
||||
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue