mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Feature: [calendar] show documents in layout of list (and move sms info)
This commit is contained in:
parent
6ae03806b4
commit
55095ee6ac
@ -0,0 +1,45 @@
|
|||||||
|
{% if calendar.documents|length > 0 %}
|
||||||
|
|
||||||
|
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
|
||||||
|
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
|
||||||
|
|
||||||
|
<style lang="css">
|
||||||
|
|
||||||
|
--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="accompanying_course_work-list">
|
||||||
|
<table class="obj-res-eval my-3">
|
||||||
|
<thead>
|
||||||
|
<th class="eval">
|
||||||
|
<h4 class="title_label">{{ 'chill_calendar.Documents'|trans }}</h4>
|
||||||
|
</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for d in calendar.documents %}
|
||||||
|
<tr>
|
||||||
|
<td class="eval">
|
||||||
|
<ul class="eval_title">
|
||||||
|
<li>
|
||||||
|
{{ mm.mimeIcon(d.storedObject.type) }}
|
||||||
|
{{ d.storedObject.title }}
|
||||||
|
|
||||||
|
<ul class="record_actions small inline">
|
||||||
|
{% if chill_document_is_editable(d.storedObject) %}
|
||||||
|
<li>
|
||||||
|
{{ d.storedObject|chill_document_edit_button }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
<li>
|
||||||
|
{{ m.download_button(d.storedObject, d.storedObject.title) }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
@ -1,4 +1,4 @@
|
|||||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
|
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
|
||||||
|
|
||||||
@ -10,193 +10,207 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_answer') }}
|
{{ encore_entry_script_tags('mod_answer') }}
|
||||||
|
{{ encore_entry_script_tags('mod_async_upload') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_answer') }}
|
{{ encore_entry_link_tags('mod_answer') }}
|
||||||
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h1>{{ 'Calendar list' |trans }}</h1>
|
<h1>{{ 'Calendar list' |trans }}</h1>
|
||||||
{{ filterOrder|chill_render_filter_order_helper }}
|
{{ filterOrder|chill_render_filter_order_helper }}
|
||||||
|
|
||||||
{% if calendarItems|length == 0 %}
|
{% if calendarItems|length == 0 %}
|
||||||
<p class="chill-no-data-statement">
|
<p class="chill-no-data-statement">
|
||||||
{{ "There is no calendar items."|trans }}
|
{{ "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>
|
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id}) }}"
|
||||||
</p>
|
class="btn btn-create button-small"></a>
|
||||||
{% else %}
|
</p>
|
||||||
|
{% else %}
|
||||||
|
|
||||||
<div class="flex-table list-records context-accompanyingCourse">
|
<div class="flex-table list-records context-accompanyingCourse">
|
||||||
|
|
||||||
{% for calendar in calendarItems %}
|
{% for calendar in calendarItems %}
|
||||||
|
|
||||||
<div class="item-bloc">
|
<div class="item-bloc">
|
||||||
<div class="item-row main">
|
<div class="item-row main">
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
<div class="wrap-header">
|
<div class="wrap-header">
|
||||||
<div class="wl-row">
|
<div class="wl-row">
|
||||||
<div class="wl-col title">
|
<div class="wl-col title">
|
||||||
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}
|
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}
|
||||||
<p class="date-label">{{ calendar.startDate|format_datetime('short', 'short') }} - {{ calendar.endDate|format_datetime('short', 'short') }}</p>
|
<p class="date-label">{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||||
{% else %}
|
- {{ calendar.endDate|format_datetime('short', 'short') }}</p>
|
||||||
<p class="date-label">{{ calendar.startDate|format_datetime('short', 'short') }} - {{ calendar.endDate|format_datetime('none', 'short') }}</p>
|
{% else %}
|
||||||
{% endif %}
|
<p class="date-label">{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||||
|
- {{ calendar.endDate|format_datetime('none', 'short') }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="duration short-message">
|
<div class="duration short-message">
|
||||||
<p>
|
|
||||||
<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') }}
|
||||||
</p>
|
{% if false == calendar.sendSMS or null == calendar.sendSMS %}
|
||||||
</div>
|
<!-- no sms will be send -->
|
||||||
|
{% else %}
|
||||||
|
{% if calendar.smsStatus == 'sms_sent' %}
|
||||||
|
<span title="{{ 'SMS already sent'|trans }}" class="badge bg-info">
|
||||||
|
<i class="fa fa-check "></i>
|
||||||
|
<i class="fa fa-envelope "></i>
|
||||||
|
</span>
|
||||||
|
{% else %}
|
||||||
|
<span title="{{ 'Will send SMS'|trans }}" class="badge bg-info">
|
||||||
|
<i class="fa fa-envelope "></i>
|
||||||
|
<i class="fa fa-hourglass-end "></i>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item-col">
|
<div class="item-col">
|
||||||
<ul class="list-content">
|
<ul class="list-content">
|
||||||
{% if calendar.mainUser is not empty %}
|
{% if calendar.mainUser is not empty %}
|
||||||
<span class="badge-user">{{ calendar.mainUser|chill_entity_render_box }}</span>
|
<span class="badge-user">{{ calendar.mainUser|chill_entity_render_box }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</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 separator">
|
|
||||||
<div class="item-col">
|
|
||||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
|
||||||
'context': 'calendar_accompanyingCourse',
|
|
||||||
'render': 'wrap-list',
|
|
||||||
'entity': calendar
|
|
||||||
} %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if calendar.comment.comment is not empty %}
|
|
||||||
<div class="item-row details separator">
|
|
||||||
<div class="item-col comment">
|
|
||||||
{{ calendar.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if calendar.location is not empty %}
|
{% if calendar.comment.comment is not empty
|
||||||
<div class="item-row separator">
|
or calendar.users|length > 0
|
||||||
|
or calendar.thirdParties|length > 0
|
||||||
|
or calendar.users|length > 0 %}
|
||||||
|
<div class="item-row details separator">
|
||||||
|
<div class="item-col">
|
||||||
|
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||||
|
'context': 'calendar_accompanyingCourse',
|
||||||
|
'render': 'wrap-list',
|
||||||
|
'entity': calendar
|
||||||
|
} %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if calendar.comment.comment is not empty %}
|
||||||
|
<div class="item-row details separator">
|
||||||
|
<div class="item-col comment">
|
||||||
|
{{ calendar.comment|chill_entity_render_box( { 'limit_lines': 3, 'metadata': false } ) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if calendar.location is not empty %}
|
||||||
|
<div class="item-row separator">
|
||||||
|
<div>
|
||||||
|
{% if calendar.location.address is not same as(null) and calendar.location.name is not empty %}
|
||||||
|
<i class="fa fa-map-marker"></i>{% endif %}
|
||||||
|
{% if calendar.location.name is not empty %}{{ calendar.location.name }}{% endif %}
|
||||||
|
{% if calendar.location.address is not same as(null) %}{{ calendar.location.address|chill_entity_render_box({'multiline': false, 'with_picto': (calendar.location.name is empty)}) }}{% else %}
|
||||||
|
<i class="fa fa-map-marker"></i>{% endif %}
|
||||||
|
{% if calendar.location.phonenumber1 is not empty %}<i
|
||||||
|
class="fa fa-phone"></i> {{ calendar.location.phonenumber1|chill_format_phonenumber }}{% endif %}
|
||||||
|
{% if calendar.location.phonenumber2 is not empty %}<i
|
||||||
|
class="fa fa-phone"></i> {{ calendar.location.phonenumber2|chill_format_phonenumber }}{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="item-row separator column">
|
||||||
<div>
|
<div>
|
||||||
{% if calendar.location.address is not same as(null) and calendar.location.name is not empty %}<i class="fa fa-map-marker"></i>{% endif %}
|
|
||||||
{% if calendar.location.name is not empty %}{{ calendar.location.name }}{% endif %}
|
{{ include('@ChillCalendar/Calendar/_documents.twig.html') }}
|
||||||
{% if calendar.location.address is not same as(null) %}{{ calendar.location.address|chill_entity_render_box({'multiline': false, 'with_picto': (calendar.location.name is empty)}) }}{% else %}<i class="fa fa-map-marker"></i>{% endif %}
|
|
||||||
{% if calendar.location.phonenumber1 is not empty %}<i class="fa fa-phone"></i> {{ calendar.location.phonenumber1|chill_format_phonenumber }}{% endif %}
|
|
||||||
{% if calendar.location.phonenumber2 is not empty %}<i class="fa fa-phone"></i> {{ calendar.location.phonenumber2|chill_format_phonenumber }}{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="item-row separator">
|
<div class="item-row">
|
||||||
<div>
|
<ul class="record_actions">
|
||||||
{% if false == calendar.sendSMS or null == calendar.sendSMS %}
|
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', calendar) and hasDocs %}
|
||||||
<span title="{{ 'Will not send SMS'|trans }}" class="fa-stack">
|
<li>
|
||||||
<i class="fa fa-envelope fa-stack-1x"></i>
|
<a class="btn btn-create"
|
||||||
<i class="fa fa-ban text-danger fa-stack-2x"></i>
|
href="{{ chill_path_add_return_path('chill_calendar_calendardoc_pick_template', {'id': calendar.id }) }}">
|
||||||
</span>
|
{{ 'chill_calendar.Add a document'|trans }}
|
||||||
{% else %}
|
</a>
|
||||||
{% if calendar.smsStatus == 'sms_sent' %}
|
</li>
|
||||||
<span title="{{ 'SMS already sent'|trans }}">
|
|
||||||
<i class="fa fa-envelope"></i>
|
|
||||||
<i class="fa fa-check"></i>
|
|
||||||
</span>
|
|
||||||
{% else %}
|
|
||||||
<span title="{{ 'Will send SMS'|trans }}">
|
|
||||||
<i class="fa fa-bell"></i>
|
|
||||||
<i class="fa fa-envelope"></i>
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% if is_granted('CHILL_ACTIVITY_CREATE', accompanyingCourse) and calendar.activity is null %}
|
||||||
</div>
|
<li>
|
||||||
|
<a class="btn btn-create"
|
||||||
<ul class="record_actions">
|
href="{{ chill_path_add_return_path('chill_calendar_calendar_to_activity', { 'id': calendar.id }) }}">
|
||||||
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', calendar) and hasDocs %}
|
{{ 'Transform to activity'|trans }}
|
||||||
<li>
|
</a>
|
||||||
<a class="btn btn-create" href="{{ chill_path_add_return_path('chill_calendar_calendardoc_pick_template', {'id': calendar.id }) }}">
|
</li>
|
||||||
{{ 'chill_calendar.Add a document'|trans }}
|
{% endif %}
|
||||||
</a>
|
{% if (calendar.isInvited(app.user)) %}
|
||||||
</li>
|
{% set invite = calendar.inviteForUser(app.user) %}
|
||||||
{% endif %}
|
<li>
|
||||||
{% if is_granted('CHILL_ACTIVITY_CREATE', accompanyingCourse) and calendar.activity is null %}
|
<div invite-answer data-status="{{ invite.status|e('html_attr') }}"
|
||||||
<li>
|
data-calendar-id="{{ calendar.id|e('html_attr') }}"></div>
|
||||||
<a class="btn btn-create" href="{{ chill_path_add_return_path('chill_calendar_calendar_to_activity', { 'id': calendar.id }) }}">
|
</li>
|
||||||
{{ 'Transform to activity'|trans }}
|
{% endif %}
|
||||||
</a>
|
{% if false %}
|
||||||
</li>
|
<li>
|
||||||
{% endif %}
|
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_show', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||||
{% if (calendar.isInvited(app.user)) %}
|
class="btn btn-show "></a>
|
||||||
{% set invite = calendar.inviteForUser(app.user) %}
|
</li>
|
||||||
<li>
|
{% endif %}
|
||||||
<div invite-answer data-status="{{ invite.status|e('html_attr') }}" data-calendar-id="{{ calendar.id|e('html_attr') }}"></div>
|
{# TOOD
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if false %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_show', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-show "></a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{# TOOD
|
|
||||||
{% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %}
|
{% if is_granted('CHILL_ACTIVITY_UPDATE', calendar) %}
|
||||||
#}
|
#}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}" class="btn btn-update "></a>
|
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { 'id': calendar.id, 'user_id': user_id, 'accompanying_period_id': accompanying_course_id }) }}"
|
||||||
</li>
|
class="btn btn-update "></a>
|
||||||
{# TOOD
|
</li>
|
||||||
|
{# TOOD
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %}
|
{% if is_granted('CHILL_ACTIVITY_DELETE', calendar) %}
|
||||||
#}
|
#}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_delete', { 'id': calendar.id, 'user_id' : user_id, 'accompanying_period_id': accompanying_course_id } ) }}" class="btn btn-delete "></a>
|
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_delete', { 'id': calendar.id, 'user_id' : user_id, 'accompanying_period_id': accompanying_course_id } ) }}"
|
||||||
</li>
|
class="btn btn-delete "></a>
|
||||||
{#
|
</li>
|
||||||
{% endif %}
|
{#
|
||||||
#}
|
{% endif %}
|
||||||
</ul>
|
#}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
{% if calendarItems|length < paginator.getTotalItems %}
|
||||||
{% endfor %}
|
{{ chill_pagination(paginator) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if calendarItems|length < paginator.getTotalItems %}
|
</div>
|
||||||
{{ chill_pagination(paginator) }}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
{% if accompanyingCourse.user is not same as(null) %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id, 'mainUser': accompanyingCourse.user.id }) }}"
|
||||||
|
class="btn btn-create">
|
||||||
|
{{ 'chill_calendar.Create for referrer'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
|
||||||
{% if accompanyingCourse.user is not same as(null) %}
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id, 'mainUser': accompanyingCourse.user.id }) }}" class="btn btn-create">
|
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id}) }}"
|
||||||
{{ 'chill_calendar.Create for referrer'|trans }}
|
class="btn btn-create">
|
||||||
|
{{ 'Create'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
</ul>
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_calendar_calendar_new', {'user_id': user_id, 'accompanying_period_id': accompanying_course_id}) }}" class="btn btn-create">
|
|
||||||
{{ 'Create'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -51,6 +51,7 @@ chill_calendar:
|
|||||||
To: Au
|
To: Au
|
||||||
Next calendars: Prochains rendez-vous
|
Next calendars: Prochains rendez-vous
|
||||||
Add a document: Ajouter un document
|
Add a document: Ajouter un document
|
||||||
|
Documents: Documents
|
||||||
|
|
||||||
|
|
||||||
remote_ms_graph:
|
remote_ms_graph:
|
||||||
@ -125,3 +126,4 @@ docgen:
|
|||||||
Third party label: Label pour choisir le tiers
|
Third party label: Label pour choisir le tiers
|
||||||
Destinee: Destinataire
|
Destinee: Destinataire
|
||||||
None: Aucun choix
|
None: Aucun choix
|
||||||
|
title of the generated document: Titre du document généré
|
||||||
|
@ -5,6 +5,10 @@ ul.record_actions {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: 0.5em 0;
|
padding: 0.5em 0;
|
||||||
|
|
||||||
|
&.inline {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
&.column {
|
&.column {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
@ -18,6 +22,13 @@ ul.record_actions {
|
|||||||
padding-right: 1em;
|
padding-right: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
.btn {
|
||||||
|
padding: .25rem .5rem;
|
||||||
|
font-size: .75rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user