Adjust display of canceled calendar items in the list

This commit is contained in:
Julie Lenaerts 2025-01-14 10:46:02 +01:00
parent 88a84ed996
commit 8f84b1e137
2 changed files with 17 additions and 4 deletions

View File

@ -12,6 +12,10 @@
<div class="wl-row"> <div class="wl-row">
<div class="wl-col title"> <div class="wl-col title">
<p class="date-label"> <p class="date-label">
{% if calendar.status == 'canceled' %}
<span class="badge bg-danger">{{ 'chill_calendar.canceled'|trans }}</span>
<del>
{% endif %}
{% if context == 'person' and calendar.context == 'accompanying_period' %} {% if context == 'person' and calendar.context == 'accompanying_period' %}
<a href="{{ chill_path_add_return_path('chill_person_accompanying_course_index', {'accompanying_period_id': calendar.accompanyingPeriod.id}) }}" style="text-decoration: none;"> <a href="{{ chill_path_add_return_path('chill_person_accompanying_course_index', {'accompanying_period_id': calendar.accompanyingPeriod.id}) }}" style="text-decoration: none;">
<span class="badge bg-primary"> <span class="badge bg-primary">
@ -26,13 +30,19 @@
{{ calendar.startDate|format_datetime('short', 'short') }} {{ calendar.startDate|format_datetime('short', 'short') }}
- {{ calendar.endDate|format_datetime('none', 'short') }} - {{ calendar.endDate|format_datetime('none', 'short') }}
{% endif %} {% endif %}
</p> {% if calendar.status == 'canceled' %}
</del>
<p>
<span>{{ 'chill_calendar.cancel_reason'|trans }}:</span>
<span>{{ calendar.cancelReason.name|localize_translatable_string }}</span>
</p>
{% endif %}
<div class="duration short-message"> <div class="duration short-message">
<i class="fa fa-fw fa-hourglass-end"></i> <i class="fa fa-fw fa-hourglass-end"></i>
{{ calendar.duration|date('%H:%I') }} {{ calendar.duration|date('%H:%I') }}
{% if false == calendar.sendSMS or null == calendar.sendSMS %} {% if false == calendar.sendSMS or null == calendar.sendSMS %}
<!-- no sms will be send --> <!-- no sms will be sent -->
{% else %} {% else %}
{% if calendar.smsStatus == 'sms_sent' %} {% if calendar.smsStatus == 'sms_sent' %}
<span title="{{ 'SMS already sent'|trans }}" class="badge bg-info"> <span title="{{ 'SMS already sent'|trans }}" class="badge bg-info">
@ -151,7 +161,7 @@
<div class="item-row separator"> <div class="item-row separator">
<ul class="record_actions"> <ul class="record_actions">
{% if is_granted('CHILL_CALENDAR_DOC_EDIT', calendar) %} {% if is_granted('CHILL_CALENDAR_DOC_EDIT', calendar) and calendar.status is not constant('STATUS_CANCELED', calendar) %}
{% if templates|length == 0 %} {% if templates|length == 0 %}
<li> <li>
<a class="btn btn-create" <a class="btn btn-create"
@ -191,6 +201,7 @@
or or
(calendar.context == 'person' and is_granted('CHILL_ACTIVITY_CREATE', calendar.person)) (calendar.context == 'person' and is_granted('CHILL_ACTIVITY_CREATE', calendar.person))
) )
and calendar.status is not constant('STATUS_CANCELED', calendar)
%} %}
<li> <li>
<a class="btn btn-create" <a class="btn btn-create"
@ -214,7 +225,7 @@
</li> </li>
{% endif %} {% endif %}
{% if is_granted('CHILL_CALENDAR_CALENDAR_EDIT', calendar) %} {% if is_granted('CHILL_CALENDAR_CALENDAR_EDIT', calendar) and calendar.status is not constant('STATUS_CANCELED', calendar) %}
<li> <li>
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { 'id': calendar.id }) }}" <a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { 'id': calendar.id }) }}"
class="btn btn-update "></a> class="btn btn-update "></a>

View File

@ -67,6 +67,8 @@ chill_calendar:
Remove a calendar document: Supprimer un document d'un rendez-vous Remove a calendar document: Supprimer un document d'un rendez-vous
Are you sure you want to remove the doc?: Êtes-vous sûr·e de vouloir supprimer le document associé ? Are you sure you want to remove the doc?: Êtes-vous sûr·e de vouloir supprimer le document associé ?
Document outdated: La date et l'heure du rendez-vous ont été modifiés après la création du document Document outdated: La date et l'heure du rendez-vous ont été modifiés après la création du document
cancel_reason: Raison d'annulation
canceled: Annulé
remote_ms_graph: remote_ms_graph:
freebusy_statuses: freebusy_statuses: