fix: render shortened names as initial and surname

This commit is contained in:
fromme committed 2026-09-25 16:24:43 +02:00
1 parent bbb0a8aaa2
commit 09415c4722
2 files changed
+10 -8

No files matched your search

+3 -2
View File
@@ -45,9 +45,10 @@
{% if booking.user.id == app.user.id %}
{% set who = 'du' %}
{% else %}
{# "Anna Berger" -> "Anna B." : keeps a card on one line per booking at phone width. #}
{# "Anna Berger" -> "A. Berger" : keeps a card on one line per booking at phone width,
and the surname tells two Annas apart where the initial would not. #}
{% set parts = booking.user.name|split(' ')|filter(part => part is not empty) %}
{% set who = parts|length > 1 ? parts|first ~ ' ' ~ parts|last|slice(0, 1) ~ '.' : booking.user.name %}
{% set who = parts|length > 1 ? parts|first|slice(0, 1) ~ '. ' ~ parts|last : booking.user.name %}
{% endif %}
{% set lines = lines|merge([who ~ (booking.timeRange.allDay ? '' : ' ' ~ booking.timeRange)]) %}
{% endfor %}