{% extends 'base.html.twig' %} {% block title %} Rendez-vous patients {% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
{% set now = "now"|date("U") %}

Passés

{% set has_past_appointments = false %} {% set current_date = null %} {% for appointment in appointments %} {% set appointment_datetime = appointment.date|date('U') + appointment.time|date('U') %} {% if appointment_datetime < now %} {% set has_past_appointments = true %} {% set appointment_date = appointment.date|date('d/m/Y') %} {% if appointment_date != current_date %} {% if current_date is not null %}
{% endif %} {% set current_date = appointment_date %}
{% endif %}
{{ current_date }}
{{ appointment.time|date('H:i') }}
{{ appointment.translatedStatus }}
{% endif %} {% endfor %} {% if not has_past_appointments %}

Aucun rendez-vous passé à afficher.

{% endif %}

Mes rendez-vous à venir

{% set has_upcoming_appointments = false %} {% set current_date = null %} {% for appointment in appointments %} {% set appointment_datetime = appointment.date|date('U') + appointment.time|date('U') %} {% if appointment_datetime >= now %} {% set has_upcoming_appointments = true %} {% set appointment_date = appointment.date|date('d/m/Y') %} {% if appointment_date != current_date %} {% if current_date is not null %}
{% endif %} {% set current_date = appointment_date %}
{% endif %}
{{ current_date }}
{{ appointment.time|date('H:i') }}
{{ appointment.translatedStatus }}
{% if not appointment.comment %}

Aucun commentaire renseigné

{% else %}

Commentaire

{{ appointment.comment }}

{% endif %}
{% if not appointment.reason %}

Aucun motif renseigné

{% else %}

Motif

{{ appointment.reason.name }}

{% endif %}
{% set currentStatus = appointment.status.value|lower %}
{{include('appointment/_delete_form.html.twig')}}
{% endif %} {% endfor %} {% if not has_upcoming_appointments %}

Aucun rendez-vous à venir à afficher.

{% endif %}
{% endblock %}