rdv: add show calendar

This commit is contained in:
nobohan
2021-07-19 13:59:50 +02:00
parent 227be0b482
commit 3c37802821
5 changed files with 266 additions and 171 deletions

View File

@@ -36,10 +36,6 @@
.. location
{%- if form.status is defined -%}
{{ form_row(form.status) }}
{% endif %}
{%- if form.cancelReason is defined -%}
{{ form_row(form.cancelReason) }}
{% endif %}

View File

@@ -0,0 +1,75 @@
<h1>{{ "Calendar"|trans }}</h1>
<dl class="chill_view_data">
</dl>
<h2 class="chill-red">{{ 'Calendar data'|trans }}</h2>
<dt class="inline">{{ 'start date'|trans }}</dt>
<dd>{{ entity.startDate|format_date('long') }}</dd>
<dt class="inline">{{ 'end date'|trans }}</dt>
<dd>{{ entity.endDate|format_date('long') }}</dd>
<dt class="inline">{{ 'cancel reason'|trans }}</dt>
<dd>
{% if entity.cancelReason is not null %}
{{ entity.cancelReason }}
{% else %}
<span class="chill-no-data-statement">{{ 'Unknown'|trans }}</span>
{% endif %}
</dd>
<dt class="inline">{{ 'status'|trans }}</dt>
<dd>{{ entity.status }}</dd>
{% if not entity.comment.isEmpty %}
<dt class="inline">{{ 'calendar comment'|trans }}</dt>
<dd>{{ entity.comment|chill_entity_render_box }}</dd>
{% endif %}
<dt class="inline">{{ 'sendSMS'|trans }}</dt>
<dd>
{% if entity.sendSMS is not null %}
{% if entity.sendSMS %}Oui{% else %}Non{% endif %}
{% else %}
<span class="chill-no-data-statement">{{ 'Unknown'|trans }}</span>
{% endif %}
</dd>
</dl>
{% set accompanying_course_id = null %}
{% if accompanyingCourse %}
{% set accompanying_course_id = accompanyingCourse.id %}
{% endif %}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{{ path('chill_calendar_calendar', { 'accompanying_period_id': accompanying_course_id } ) }}">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a class="btn btn-update" href="{{ path('chill_calendar_calendar_edit', { 'id': entity.id, 'accompanying_period_id': accompanying_course_id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
{# TODO
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
#}
<li>
<a href="{{ path('chill_calendar_calendar_delete', { 'id': entity.id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete">
{{ 'Delete'|trans }}
</a>
</li>
{#
{% endif %}
#}
</ul>

View File

@@ -0,0 +1,15 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
{% block title 'Calendar'|trans %}
{% block content -%}
<div class="calendar-show">
<div class="row justify-content-center">
<div class="col-md-10 col-xxl">
{% include 'ChillCalendarBundle:Calendar:show.html.twig' with {'context': 'accompanyingCourse'} %}
</div>
</div>
</div>
{% endblock content %}