mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-24 11:06:14 +00:00
130 lines
5.5 KiB
Twig
130 lines
5.5 KiB
Twig
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
|
|
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
|
|
|
|
{% block title %}{{ 'Calendar list' |trans }}{% endblock title %}
|
|
|
|
{% set user_id = null %}
|
|
{% set accompanying_course_id = accompanyingCourse.id %}
|
|
|
|
{% block content %}
|
|
|
|
<h1>{{ 'Calendar list' |trans }}</h1>
|
|
|
|
{% if calendarItems|length == 0 %}
|
|
<p class="chill-no-data-statement">
|
|
{{ "There is no calendar items."|trans }}
|
|
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create button-small"></a>
|
|
</p>
|
|
{% else %}
|
|
|
|
<div class="flex-table list-records context-accompanyingCourse">
|
|
|
|
{% for calendar in calendarItems %}
|
|
|
|
<div class="item-bloc">
|
|
<div class="item-row main">
|
|
<div class="item-col">
|
|
|
|
{% if calendar.startDate and calendar.endDate %}
|
|
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}
|
|
<h3>{{ "From the day"|trans }} {{ calendar.startDate|format_datetime('medium', 'short') }} </h3>
|
|
<h3>{{ "to the day"|trans }} {{ calendar.endDate|format_datetime('medium', 'short') }}</h3>
|
|
{% else %}
|
|
<h3>{{ calendar.startDate|format_date('full') }} </h3>
|
|
<h3>{{ calendar.startDate|format_datetime('none', 'short', locale='fr') }} - {{ calendar.endDate|format_datetime('none', 'short', locale='fr') }}</h3>
|
|
|
|
<div class="duration">
|
|
<p>
|
|
<i class="fa fa-fw fa-hourglass-end"></i>
|
|
{{ calendar.endDate.diff(calendar.startDate)|date("%H:%M")}}
|
|
</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
<div class="item-col">
|
|
<ul class="list-content">
|
|
{% if calendar.user %}
|
|
<li>
|
|
<b>{{ 'by'|trans }}{{ calendar.user.usernameCanonical }}</b>
|
|
</li>
|
|
{% endif %}
|
|
|
|
{% if calendar.mainUser is not empty %}
|
|
<li>
|
|
<b>{{ 'main user concerned'|trans }}: {{ calendar.mainUser.usernameCanonical }}</b>
|
|
</li>
|
|
{% endif %}
|
|
|
|
</ul>
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a href="{{ path('chill_calendar_calendar_show', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-show "></a>
|
|
</li>
|
|
{# TOOD
|
|
{% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %}
|
|
#}
|
|
<li>
|
|
<a href="{{ path('chill_calendar_calendar_edit', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-update "></a>
|
|
</li>
|
|
{# TOOD
|
|
{% endif %}
|
|
{% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %}
|
|
#}
|
|
<li>
|
|
<a href="{{ path('chill_calendar_calendar_delete', { 'id': calendar.id, 'user_id' : user_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete "></a>
|
|
</li>
|
|
{#
|
|
{% endif %}
|
|
#}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
{%
|
|
if calendar.comment.comment is not empty
|
|
or calendar.users|length > 0
|
|
or calendar.thirdParties|length > 0
|
|
or calendar.users|length > 0
|
|
%}
|
|
<div class="item-row details">
|
|
<div class="item-col">
|
|
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
|
'context': accompanyingCourse,
|
|
'with_display': 'row',
|
|
'entity': calendar
|
|
} %}
|
|
</div>
|
|
|
|
{% if calendar.comment.comment is not empty %}
|
|
<div class="item-col comment">
|
|
{{ calendar.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% if calendarItems|length < paginator.getTotalItems %}
|
|
{{ chill_pagination(paginator) }}
|
|
{% endif %}
|
|
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
<ul class="record_actions">
|
|
<li>
|
|
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
|
|
{{ 'Add a new calendar' | trans }}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
{% endblock %}
|