level Darstellung GSB

This commit is contained in:
Bkolb 2026-04-03 16:22:30 +02:00
parent 673d2d6653
commit 5c1f78c26d
3 changed files with 20 additions and 3 deletions

View File

@ -52,7 +52,14 @@ if not app.config.get("TESTING"):
# app.logger.addHandler(file_handler) # app.logger.addHandler(file_handler)
def format_level(level):
mapping = {
0: "0 - Admin",
1: "1 - Gold",
2: "2 - Silber",
3: "3 - Bronze",
}
return mapping.get(level, f"{level} - Unbekannt")
def ensure_base_tables(): def ensure_base_tables():
conn = get_connection() conn = get_connection()
@ -459,6 +466,8 @@ def profil():
cur.close() cur.close()
conn.close() conn.close()
profile["mandant_level_label"] = format_level(profile["mandant_level"])
return render_template( return render_template(
"profil.html", "profil.html",
page_title="Profil", page_title="Profil",
@ -507,6 +516,11 @@ def admin_mandanten():
cur.close() cur.close()
conn.close() conn.close()
for mandant in mandanten:
mandant["level_label"] = format_level(mandant["level"])
return render_template( return render_template(
"admin_mandanten.html", "admin_mandanten.html",
page_title="Admin - Mandanten", page_title="Admin - Mandanten",
@ -602,6 +616,9 @@ def useradmin_mandant():
cur.close() cur.close()
conn.close() conn.close()
for user in users:
user["mandant_level_label"] = format_level(user["mandant_level"])
return render_template( return render_template(
"useradmin_mandant.html", "useradmin_mandant.html",
page_title="Useradministration", page_title="Useradministration",

View File

@ -10,7 +10,7 @@
<tr><th>E-Mail</th><td>{{ profile.email }}</td></tr> <tr><th>E-Mail</th><td>{{ profile.email }}</td></tr>
<tr><th>Mandant</th><td>{{ profile.mandant_name }} ({{ profile.mandant_kuerzel }})</td></tr> <tr><th>Mandant</th><td>{{ profile.mandant_name }} ({{ profile.mandant_kuerzel }})</td></tr>
<tr><th>Mandant E-Mail</th><td>{{ profile.mandant_email or '-' }}</td></tr> <tr><th>Mandant E-Mail</th><td>{{ profile.mandant_email or '-' }}</td></tr>
<tr><th>Mandant Level</th><td>{{ profile.mandant_level }}</td></tr> <tr><th>Mandant Level</th><td>{{ profile.mandant_level_label }}</td></tr>
<tr> <tr>
<th>Gruppen im Mandanten</th> <th>Gruppen im Mandanten</th>

View File

@ -40,7 +40,7 @@
<td>{{ user.status }}</td> <td>{{ user.status }}</td>
<td>{{ user.last_login or "-" }}</td> <td>{{ user.last_login or "-" }}</td>
<td>{{ user.mandant_name }}</td> <td>{{ user.mandant_name }}</td>
<td>{{ user.mandant_level }}</td> <td>{{ user.mandant_level_label }}</td>
<td class="col-actions"> <td class="col-actions">
<div class="table-actions"> <div class="table-actions">
<a href="/useradmin/mandant/user/{{ user.id }}" class="btn-primary btn-small">Bearbeiten</a> <a href="/useradmin/mandant/user/{{ user.id }}" class="btn-primary btn-small">Bearbeiten</a>