mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
add accompanying period where the person is requestor + badge in results
This commit is contained in:
@@ -59,47 +59,51 @@
|
||||
'customButtons': { 'after': _self.button_person(person) }
|
||||
}) }}
|
||||
|
||||
{#- 'apps' is for AccompanyingPeriodParticipationS #}
|
||||
{%- set apps = [] %}
|
||||
{%- for app in person.openedParticipations %}
|
||||
{%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', app.accompanyingPeriod) %}
|
||||
{%- set apps = apps|merge([app]) %}
|
||||
{#- 'acps' is for AcCompanyingPeriodS #}
|
||||
{%- set acps = [] %}
|
||||
{%- for acp in person.accompanyingPeriodInvolved %}
|
||||
{%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %}
|
||||
{%- set acps = acps|merge([acp]) %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{% if apps|length > 0 %}
|
||||
{# add as requestor #}
|
||||
|
||||
{% if acps|length > 0 %}
|
||||
<div class="item-row">
|
||||
<div class="wrap-list periods-list">
|
||||
{% for app in apps %}
|
||||
{% for acp in acps %}
|
||||
{% set app = person.findParticipationForPeriod(acp) %}
|
||||
<div class="wl-row separator">
|
||||
<div class="wl-col title">
|
||||
|
||||
<div class="date">
|
||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||
{% if acp.requestorPerson == person %}
|
||||
<span class="as-requestor badge bg-info" title="{{ 'Requestor'|trans|e('html_attr') }}">
|
||||
{{ 'Requestor'|trans({'gender': person.gender}) }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if app != null %}
|
||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if app.accompanyingPeriod.user is not null %}
|
||||
{% if acp.user is not null %}
|
||||
<div class="user">
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
{{ app.accompanyingPeriod.user|chill_entity_render_box }}
|
||||
{{ acp.user|chill_entity_render_box }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
|
||||
{% for issue in app.accompanyingPeriod.socialIssues %}
|
||||
{% for issue in acp.socialIssues %}
|
||||
{{ issue|chill_entity_render_box }}
|
||||
{% endfor %}
|
||||
{# ^^ display all socialIssues, or slice vv
|
||||
|slice(0,2)
|
||||
{% if app.accompanyingPeriod.socialIssues|length > 2 %}
|
||||
<span class="more">{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
|
||||
{% endif %}
|
||||
#}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}"
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
||||
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user