mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
macro added + closed parcours displayed in accordeon
This commit is contained in:
parent
83dd8f810c
commit
d757e07dfc
@ -288,3 +288,15 @@ div#dashboards {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// accordeon person search result - closed parcours
|
||||||
|
|
||||||
|
.accordion-item {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
button[aria-expanded="true"] > span.folded,
|
||||||
|
button[aria-expanded="false"] > span.unfolded { display: none; }
|
||||||
|
button[aria-expanded="false"] > span.folded,
|
||||||
|
button[aria-expanded="true"] > span.unfolded { display: inline; }
|
||||||
|
@ -10,71 +10,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
<div class="list-with-period">
|
{% macro accompanying_period(acp, person) %}
|
||||||
|
|
||||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
{{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }}
|
|
||||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
|
|
||||||
<i class="fa fa-fw fa-search" aria-hidden="true"></i> {{ pattern }}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
|
||||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_person_new', { "_fragment": pattern }) }}" class="btn btn-create">
|
|
||||||
{{ 'Add a person'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if search_name != "person_similarity" %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-action">
|
|
||||||
<i class="fa fa-fw fa-search" aria-hidden="true"></i>
|
|
||||||
{{ 'Advanced search'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if preview == true and persons | length < total %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_main_search', { "name": search_name|default('abcd'), "q" : pattern }) }}" class="btn btn-misc">
|
|
||||||
{{ 'See all results'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{% if persons|length > 0 %}
|
|
||||||
<div class="flex-table">
|
|
||||||
{% for person in persons %}
|
|
||||||
<div class="item-bloc">
|
|
||||||
|
|
||||||
{{ person|chill_entity_render_box({
|
|
||||||
'render': 'bloc',
|
|
||||||
'addLink': true,
|
|
||||||
'addInfo': true,
|
|
||||||
'addAge': true,
|
|
||||||
'addAltNames': true,
|
|
||||||
'addCenter': true,
|
|
||||||
'address_multiline': false,
|
|
||||||
'customButtons': { 'after': _self.button_person_after(person) }
|
|
||||||
}) }}
|
|
||||||
|
|
||||||
{#- '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 %}
|
|
||||||
{# add as requestor #}
|
|
||||||
|
|
||||||
{% if acps|length > 0 %}
|
|
||||||
{% for acp in acps %}
|
|
||||||
{% set app = person.findParticipationForPeriod(acp) %}
|
{% set app = person.findParticipationForPeriod(acp) %}
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<div class="wrap-list periods-list">
|
<div class="wrap-list periods-list">
|
||||||
@ -224,6 +160,101 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
<div class="list-with-period">
|
||||||
|
|
||||||
|
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }}
|
||||||
|
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-sm">
|
||||||
|
<i class="fa fa-fw fa-search" aria-hidden="true"></i> {{ pattern }}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_person_new', { "_fragment": pattern }) }}" class="btn btn-create">
|
||||||
|
{{ 'Add a person'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if search_name != "person_similarity" %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-action">
|
||||||
|
<i class="fa fa-fw fa-search" aria-hidden="true"></i>
|
||||||
|
{{ 'Advanced search'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if preview == true and persons | length < total %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_main_search', { "name": search_name|default('abcd'), "q" : pattern }) }}" class="btn btn-misc">
|
||||||
|
{{ 'See all results'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{% if persons|length > 0 %}
|
||||||
|
<div class="flex-table">
|
||||||
|
{% for person in persons %}
|
||||||
|
<div class="item-bloc">
|
||||||
|
|
||||||
|
{{ person|chill_entity_render_box({
|
||||||
|
'render': 'bloc',
|
||||||
|
'addLink': true,
|
||||||
|
'addInfo': true,
|
||||||
|
'addAge': true,
|
||||||
|
'addAltNames': true,
|
||||||
|
'addCenter': true,
|
||||||
|
'address_multiline': false,
|
||||||
|
'customButtons': { 'after': _self.button_person_after(person) }
|
||||||
|
}) }}
|
||||||
|
|
||||||
|
{#- '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 %}
|
||||||
|
{# add as requestor #}
|
||||||
|
|
||||||
|
{% if acps|length > 0 %}
|
||||||
|
{% for acp in acps %}
|
||||||
|
{% if acp.step == 'CLOSED' %}
|
||||||
|
<div class="accordion" id="member_{{ acp.id }}">
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2 class="accordion-header" id="heading_{{ acp.id }}">
|
||||||
|
<button
|
||||||
|
class="accordion-button collapsed"
|
||||||
|
type="button"
|
||||||
|
data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#collapse_{{ acp.id }}"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="collapse_{{ acp.id }}">
|
||||||
|
<span class="folded">{{ 'Show closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }} ({{ 'budget.number of elements'|trans({ 'nb_items': 1 }) }})</span>
|
||||||
|
<span class="unfolded text-secondary">{{ 'Hide closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }}</span>
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div id="collapse_{{ acp.id }}"
|
||||||
|
class="accordion-collapse collapse"
|
||||||
|
aria-labelledby="heading_{{ acp.id }}"
|
||||||
|
data-bs-parent="#nonCurrent">
|
||||||
|
|
||||||
|
{{ _self.accompanying_period(acp, person) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{{ _self.accompanying_period(acp, person) }}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user