Merge branch '232_resources_comment' into 'master'

232 resources comment

See merge request Chill-Projet/chill-bundles!276
This commit is contained in:
2022-01-13 11:05:15 +00:00
31 changed files with 502 additions and 71 deletions

View File

@@ -4,11 +4,12 @@
{{ 'Resume Accompanying Course'|trans }}
{% endblock %}
{% macro insert_onthefly(type, entity) %}
{% macro insert_onthefly(type, entity, parent = null) %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id },
buttonText: entity|chill_entity_render_string
buttonText: entity|chill_entity_render_string,
parent: parent
} %}
{% endmacro %}
@@ -55,6 +56,7 @@
</div>
{% endif %}
{% if accompanyingCourse.locationStatus != 'none' %}
<div class="mbloc col col-sm-6 col-lg-4">
<div class="location">
{% if accompanyingCourse.locationStatus == 'person' %}
@@ -63,12 +65,10 @@
{% elseif accompanyingCourse.locationStatus == 'address' %}
<h4>{{ 'This course has a temporarily location'|trans }}</h4>
{% endif %}
{% if accompanyingCourse.locationStatus != 'none' %}
{{ accompanyingCourse.location|chill_entity_render_box }}
{% endif %}
{{ accompanyingCourse.location|chill_entity_render_box }}
</div>
</div>
{% endif %}
{% if accompanyingCourse.pinnedComment is not empty %}
<div class="mbloc col col-sm-6 col-lg-8">
@@ -107,11 +107,21 @@
<div class="mbloc col col-sm-6 col-lg-4">
<div class="resources">
<h4 class="item-key">{{ 'Resources'|trans }}</h4>
{% for r in accompanyingCourse.resources %}
{% set parent = {
'type': 'accompanying_period_resource',
'id': r.id,
'comment': r.comment,
'parent': {
'type': 'accompanying_period',
'id': accompanyingCourse.id
}
} %}
{% if r.person is not null %}
{{ _self.insert_onthefly('person', r.person) }}
{{ _self.insert_onthefly('person', r.person, parent) }}
{% elseif r.thirdParty is not null %}
{{ _self.insert_onthefly('thirdparty', r.thirdParty) }}
{{ _self.insert_onthefly('thirdparty', r.thirdParty, parent) }}
{% endif %}
{% endfor %}
</div>