mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
on-the-fly: add a 'parent' option to pass parent context. So we could now display resource.comment below the renderbox.
This commit is contained in:
@@ -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 %}
|
||||
|
||||
@@ -106,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>
|
||||
|
Reference in New Issue
Block a user