further itegration of the new view of the User

This commit is contained in:
2026-06-26 17:15:43 +02:00
parent fdf699363a
commit 480bd00a54
+30 -10
View File
@@ -134,20 +134,39 @@
</thead> </thead>
<tbody id="booking-table-body"> <tbody id="booking-table-body">
{% for booking in available.slots_booked %} {% for booking in available.slots_booked %}
{% if booking is not mapping %}
<tr> <tr>
<td class="fw-semibold text-primary py-3 text-nowrap"> <td class="fw-semibold text-primary py-3 text-nowrap">
{{ booking[0] }} {% if booking is mapping %}
</td> {{ booking.start }}
<td> {% else %}
<span class="fw-bold text-dark">{{ booking[1] }}</span> {{ booking[0] }}
{% endif %}
</td> </td>
{% if booking|length > 2 and booking[2] %} <td>
{% for answer in booking[2] %} <span class="fw-bold text-dark">
{% if booking is mapping %}
{{ booking.name }}
{% else %}
{{ booking[1] }}
{% endif %}
</span>
</td>
{% set answers = none %}
{% if booking is mapping %}
{# Versucht alle gängigen Bezeichnungen für das Antwort-Array zu treffen #}
{% set answers = booking.custom or booking.custom_fields or booking.custom_answers %}
{% elif booking|length > 2 %}
{% set answers = booking[2] %}
{% endif %}
{% if answers %}
{% for answer in answers %}
<td>{{ answer if answer else '<span class="text-muted small">-</span>'|safe }}</td> <td>{{ answer if answer else '<span class="text-muted small">-</span>'|safe }}</td>
{% endfor %} {% endfor %}
{% else %} {% else %}
{# Fallback: Zeige Striche, wenn keine Antworten da sind #}
{% for field in custom_fields %} {% for field in custom_fields %}
<td><span class="text-muted small">-</span></td> <td><span class="text-muted small">-</span></td>
{% endfor %} {% endfor %}
@@ -156,15 +175,16 @@
<td class="text-end"> <td class="text-end">
<form method="post" action="{{ url_for('terminplaner.client', appointment_id=appointment_id, tenant=tenant_id) }}" onsubmit="return confirm('Möchten Sie diesen Termin wirklich löschen?');" class="d-inline"> <form method="post" action="{{ url_for('terminplaner.client', appointment_id=appointment_id, tenant=tenant_id) }}" onsubmit="return confirm('Möchten Sie diesen Termin wirklich löschen?');" class="d-inline">
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<input type="hidden" name="slot_time" value="{{ booking[0] }}">
<input type="hidden" name="target_client_name" value="{{ booking[1] }}"> <input type="hidden" name="slot_time" value="{% if booking is mapping %}{{ booking.start }}{% else %}{{ booking[0] }}{% endif %}">
<input type="hidden" name="target_client_name" value="{% if booking is mapping %}{{ booking.name }}{% else %}{{ booking[1] }}{% endif %}">
<button type="submit" class="btn btn-sm btn-outline-danger px-3 rounded-3"> <button type="submit" class="btn btn-sm btn-outline-danger px-3 rounded-3">
Löschen Löschen
</button> </button>
</form> </form>
</td> </td>
</tr> </tr>
{% endif %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>