mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
first impl
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<span class="chill-entity chill-entity__person">
|
||||
{%- if addLink and is_granted('CHILL_PERSON_SEE', person) -%}
|
||||
{%- set showLink = true -%}<a href="{{ chill_path_add_return_path('chill_person_view', { 'person_id': person.id }) }}">{%- endif -%}
|
||||
<span class="chill-entity__person__first-name">{{ person.firstName }}</span>
|
||||
<span class="chill-entity__person__last-name">{{ person.lastName }}</span>
|
||||
{%- if addAltNames -%}
|
||||
{%- for n in person.altNames -%}
|
||||
{%- if loop.first -%}({% else %} {%- endif -%}
|
||||
<span class="chill-entity__person__alt-name chill-entity__person__altname--{{ n.key }}">
|
||||
{{ n.label }}
|
||||
</span>
|
||||
{%- if loop.last %}) {% endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- if showLink is defined -%}</a>{%- endif -%}</span>
|
@@ -0,0 +1,3 @@
|
||||
<span class="chill-entity chill-entity__social-issue">
|
||||
|
||||
</span>
|
@@ -0,0 +1,208 @@
|
||||
<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="sc-button button-small">
|
||||
<i class="fa 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') }}" class="sc-button bt-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="sc-button bt-action">
|
||||
<i class="fa 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="sc-button">
|
||||
{{ 'See all results'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
|
||||
{% if persons|length > 0 %}
|
||||
|
||||
<div class="person-list--with-period">
|
||||
{% for person in persons %}
|
||||
<div class="person-list--with-period__item">
|
||||
<div>
|
||||
<div class="person-list--with-period__item__box-person">
|
||||
<div>
|
||||
<span>{{ person|chill_entity_render_box({'addLink': true}) }}</span>
|
||||
<span>{{ person.birthdate|format_date("medium") }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="record_actions record_actions--left">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_view', { 'person_id' : person.id }) }}" class="sc-button bt-view" />
|
||||
{{ 'Open person file'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id }) }}" class="sc-button" /><i class="fa fa-random"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="person-list--with-period__item__box-where">
|
||||
<span>{{ person.center }}</span>
|
||||
{% if person.getLastAddress is not null %}
|
||||
<span>{{ person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}</span>
|
||||
{% else %}
|
||||
<span>{{ 'No address'|trans }}</span>
|
||||
{% endif %}
|
||||
{% if person.mobilenumber is not empty %}
|
||||
<span>{{ person.mobilenumber }}</span>
|
||||
{% endif %}
|
||||
{% if person.phonenumber is not empty %}
|
||||
<span>{{ person.phonenumber }}</span>
|
||||
{% endif %}
|
||||
<span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#- 'apps' is for AccompanyingPeriodParticipationS #}
|
||||
{#- filter using acl -#}
|
||||
{%- set apps = [] %}
|
||||
{%- for app in person.openedParticipations %}
|
||||
{%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', app.accompanyingPeriod) %}
|
||||
{%- set apps = apps|merge([app]) %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
{% if apps|length > 0 %}
|
||||
<ul class="person-list--with-period__item__periods">
|
||||
{% for app in apps %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}">
|
||||
<i class="fa fa-random"></i>
|
||||
<span>{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}</span>
|
||||
{% if app.accompanyingPeriod.user is not null %}
|
||||
<span>
|
||||
{{ app.accompanyingPeriod.user|chill_entity_render_box }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% for issue in app.accompanyingPeriod.socialIssues|slice(0,2) %}
|
||||
<span>{{ issue|chill_entity_render_box }}</span>
|
||||
{% endfor %}
|
||||
{% if app.accompanyingPeriod.socialIssues|length > 2 %}
|
||||
<span>{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{#
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-red">{% trans %}Name{% endtrans %}</th>
|
||||
<th class="chill-green">{% trans %}Date of birth{% endtrans %}</th>
|
||||
<th class="chill-orange">{% trans %}Nationality{% endtrans %}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for person in persons %}
|
||||
<tr>
|
||||
<td>
|
||||
{% set is_open = person.isOpen() %}
|
||||
<a href="{{ path('chill_person_view', { person_id : person.getId }) }}" {% if chill_person.fields.accompanying_period == 'visible' %}{% if is_open %} alt="{{ 'An accompanying period is open'|trans|e('html_attr') }}"{% else %} alt="{{ 'Any accompanying periods are open'|trans|e('html_attr') }}" {% endif %}{% endif %}>
|
||||
{{ person|chill_entity_render_box }}
|
||||
{% apply spaceless %}
|
||||
{% if chill_person.fields.accompanying_period == 'visible' %}
|
||||
{% if is_open == false %}
|
||||
<i class="fa fa-lock" ></i>
|
||||
{% else %}
|
||||
<i class="fa fa-unlock" ></i>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endapply %}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if person.birthdate is not null %}
|
||||
{{ person.birthdate|format_date('long') }}
|
||||
{% else %}{{ 'Unknown date of birth'|trans }}{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if person.nationality is not null %}
|
||||
{{person.nationality.name | localize_translatable_string }}
|
||||
{% else %}
|
||||
{{ 'Without nationality'|trans }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li><a class="sc-button bt-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<li><a class="sc-button bt-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#}
|
||||
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" class="sc-button bt-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="sc-button bt-action">
|
||||
<i class="fa 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="sc-button">
|
||||
{{ 'See all results'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="sc-button bt-action">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ 'Advanced search'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user