Implementieren der PWA, Multi-Instanzen-Passwort-Schutz und Kassen-Löschfunktion
This commit is contained in:
89
templates/admin.html
Normal file
89
templates/admin.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>erdbeerhannah 🍓💶 - Admin</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="theme-color" content="#dc3545">
|
||||
<link rel="apple-touch-icon" href="/static/icon-192x192.png">
|
||||
</head>
|
||||
|
||||
<body class="bg-light">
|
||||
<div class="container mt-5">
|
||||
<h2 class="mb-4">Kassen-Konfiguration</h2>
|
||||
<p>Dies ist die Konfiguration für deine Kasse: <strong>{{ instance_id }}</strong></p>
|
||||
<p>Speichere dir diese URL ab, um später Änderungen vorzunehmen.</p>
|
||||
<div class="alert alert-info">
|
||||
Deine Kasse ist erreichbar unter: <a href="{{ url_for('index', instance_id=instance_id) }}">/{{ instance_id
|
||||
}}</a>
|
||||
</div>
|
||||
|
||||
<form method="post" class="bg-white p-4 shadow-sm rounded">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Position</th>
|
||||
<th>Name</th>
|
||||
<th>Preis (€)</th>
|
||||
<th>Icon/Emoji</th>
|
||||
<th>Farbe (Bootstrap Klasse)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for i in range(1, 7) %}
|
||||
{% set prod = products[i] %}
|
||||
<tr>
|
||||
<td class="align-middle">{{ i }}</td>
|
||||
<td><input type="text" class="form-control" name="name_{{ i }}" value="{{ prod['name'] }}"
|
||||
required></td>
|
||||
<td><input type="number" step="0.01" class="form-control" name="price_{{ i }}"
|
||||
value="{{ prod['price'] }}" required></td>
|
||||
<td><input type="text" class="form-control" name="icon_{{ i }}" value="{{ prod['icon'] }}"
|
||||
required></td>
|
||||
<td>
|
||||
<select class="form-control" name="color_{{ i }}">
|
||||
<option value="btn-primary" {% if prod['color_class']=='btn-primary' %}selected{% endif
|
||||
%}>Blau (Primary)</option>
|
||||
<option value="btn-secondary" {% if prod['color_class']=='btn-secondary' %}selected{%
|
||||
endif %}>Grau (Secondary)</option>
|
||||
<option value="btn-success" {% if prod['color_class']=='btn-success' %}selected{% endif
|
||||
%}>Grün (Success)</option>
|
||||
<option value="btn-danger" {% if prod['color_class']=='btn-danger' %}selected{% endif
|
||||
%}>Rot (Danger)</option>
|
||||
<option value="btn-warning" {% if prod['color_class']=='btn-warning' %}selected{% endif
|
||||
%}>Gelb (Warning)</option>
|
||||
<option value="btn-info" {% if prod['color_class']=='btn-info' %}selected{% endif %}>
|
||||
Hellblau (Info)</option>
|
||||
<option value="btn-dark" {% if prod['color_class']=='btn-dark' %}selected{% endif %}>
|
||||
Schwarz (Dark)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<a href="{{ url_for('index', instance_id=instance_id) }}" class="btn btn-secondary">Zurück zur
|
||||
Kasse</a>
|
||||
<button type="submit" name="action" value="delete" class="btn btn-danger ml-2"
|
||||
onclick="return confirm('Möchtest du diese Kasse wirklich unwiderruflich löschen? Alle zugehörigen Verkaufsdaten und Produkteinstellungen gehen verloren.');">🗑️
|
||||
Kasse löschen</button>
|
||||
</div>
|
||||
<button type="submit" name="action" value="save" class="btn btn-success">Speichern & Zur Kasse</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user