Praxissofttware/views/services.ejs

109 lines
2.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Leistungen</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
</head>
<body>
<nav class="navbar navbar-dark bg-dark px-3">
<span class="navbar-brand">🧾 Leistungen</span>
<a href="/dashboard" class="btn btn-outline-light btn-sm">Dashboard</a>
</nav>
<div class="container mt-4">
<h4>Leistungen</h4>
<form method="GET" action="/services" class="row g-2 mb-3">
<div class="col-md-6">
<input type="text"
name="q"
class="form-control"
placeholder="🔍 Suche nach Name oder Kategorie"
value="<%= query?.q || '' %>">
</div>
<div class="col-md-3 d-flex align-items-center">
<div class="form-check">
<input class="form-check-input"
type="checkbox"
name="onlyActive"
value="1"
<%= query?.onlyActive === "1" ? "checked" : "" %>>
<label class="form-check-label">
Nur aktive Leistungen
</label>
</div>
</div>
<div class="col-md-3 d-flex gap-2">
<button class="btn btn-primary w-100">
Suchen
</button>
<a href="/services" class="btn btn-secondary w-100">
Reset
</a>
</div>
</form>
<a href="/services/create" class="btn btn-success mb-3">
Neue Leistung
</a>
<table class="table table-bordered table-sm align-middle">
<thead class="table-light">
<tr>
<th>Bezeichnung (DE)</th>
<th>Bezeichnung (ES)</th>
<th>Preis</th>
<th>Preis C70</th>
<th>Status</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
<% services.forEach(s => { %>
<tr class="<%= s.active ? '' : 'table-secondary' %>">
<td><%= s.name %></td>
<form method="POST" action="/services/<%= s.id %>/update-price">
<td>
<input name="price"
value="<%= s.price %>"
class="form-control form-control-sm">
</td>
<td>
<input name="price_c70"
value="<%= s.price_c70 %>"
class="form-control form-control-sm">
</td>
<td>
<%= s.active ? 'Aktiv' : 'Inaktiv' %>
</td>
<td class="d-flex gap-1">
<button class="btn btn-sm btn-primary">
💾 Speichern
</button>
</form>
<form method="POST" action="/services/<%= s.id %>/toggle">
<button class="btn btn-sm btn-outline-warning">
🔄 Aktiv/Inaktiv
</button>
</form>
</td>
</tr>
<% }) %>
</tbody>
</table>
</div>
</body>
</html>