mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
ajust list_with_period search with person render_box (and add new options to it)
This commit is contained in:
parent
4be4cd7279
commit
48873d15c9
@ -87,6 +87,7 @@ div.flex-table {
|
||||
div.item-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 0.5em;
|
||||
border-top: 1px dotted $gray-900;
|
||||
@ -100,13 +101,13 @@ div.flex-table {
|
||||
}
|
||||
&:last-child {
|
||||
flex-grow: 1; flex-shrink: 1; flex-basis: auto;
|
||||
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
ul.record_actions {
|
||||
margin: 0;
|
||||
align-self: flex-start;
|
||||
flex-grow: 1; flex-shrink: 0; flex-basis: auto;
|
||||
align-self: flex-start;
|
||||
margin: 0;
|
||||
li {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
/// complete and overwrite flex-table in chillmain.scss
|
||||
/// overwrite flex-table
|
||||
div.list-with-period {
|
||||
div.flex-table div.item-row div.item-col:first-child { flex-basis: 33%; }
|
||||
}
|
||||
|
||||
///
|
||||
div.list-with-period,
|
||||
div.list-household-members {
|
||||
|
||||
div.comment {
|
||||
// for the comment for household-members
|
||||
}
|
||||
div.periods {
|
||||
div.header,
|
||||
div.list-content {
|
||||
@ -13,7 +15,7 @@ div.list-household-members {
|
||||
}
|
||||
div.header {
|
||||
position: relative;
|
||||
a.sc-button {
|
||||
a.btn {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
|
@ -22,8 +22,8 @@
|
||||
class="item-bloc"
|
||||
v-bind:key="conc.person.id"
|
||||
>
|
||||
<div class="item-row person">
|
||||
<div class="item-col box-person">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
<person :person="conc.person"></person>
|
||||
</div>
|
||||
@ -33,7 +33,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-col box-where">
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="item-bloc">
|
||||
<div class="item-row person">
|
||||
<div class="item-col box-person">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
<person :person="conc.person"></person>
|
||||
<span v-if="isHolder" class="badge bg-primary holder">
|
||||
@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<div v-if="conc.person.birthdate !== null">{{ $t('person.born', {'gender': conc.person.gender} ) }}</div>
|
||||
</div>
|
||||
<div class="item-col box-where">
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
|
@ -50,33 +50,41 @@
|
||||
</div>
|
||||
<div class="item-row">
|
||||
|
||||
<h3>{{ 'Participants'|trans }}</h3>
|
||||
{% if accompanying_period.participations.count > 0 %}
|
||||
{% for p in accompanying_period.participations %}
|
||||
<p>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
|
||||
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
|
||||
</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
<div class="item-col"><h3>{{ 'Participants'|trans }}</h3></div>
|
||||
<div class="item-col">
|
||||
{% if accompanying_period.participations.count > 0 %}
|
||||
{% for p in accompanying_period.participations %}
|
||||
<p>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
|
||||
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
|
||||
</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-row">
|
||||
|
||||
<h3>{{ 'Requestor'|trans }}</h3>
|
||||
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
|
||||
{% if accompanying_period.requestorPerson is not null %}
|
||||
<p>{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}</p>
|
||||
<div class="item-col"><h3>{{ 'Requestor'|trans }}</h3></div>
|
||||
<div class="item-col">
|
||||
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
|
||||
{% if accompanying_period.requestorPerson is not null %}
|
||||
<p>
|
||||
{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if accompanying_period.requestorThirdParty is not null %}
|
||||
<p>
|
||||
{{ accompanying_period.requestorThirdParty.name }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
{% if accompanying_period.requestorThirdParty is not null %}
|
||||
<p>{{ accompanying_period.requestorThirdParty.name }}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-row">
|
||||
|
@ -8,7 +8,9 @@
|
||||
* addId bool
|
||||
* addInfo bool
|
||||
* addAge bool
|
||||
* addCenter bool
|
||||
* hLevel integer
|
||||
* address_multiline bool
|
||||
* customButtons [
|
||||
'before' Twig\Markup, (injected with macro)
|
||||
'replace' Twig\Markup,
|
||||
@ -89,10 +91,11 @@
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
{% set multiline = (options['address_multiline']) ? true : false %}
|
||||
{{ person.getLastAddress|chill_entity_render_box({
|
||||
'render': 'list',
|
||||
'with_picto': true,
|
||||
'multiline': false,
|
||||
'multiline': multiline,
|
||||
'with_valid_from': false
|
||||
}) }}
|
||||
<li>
|
||||
@ -111,6 +114,12 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% if options['addCenter'] %}
|
||||
<li>
|
||||
<i class="fa fa-li fa-long-arrow-right"></i>
|
||||
{{ person.center }}
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<ul class="record_actions">
|
||||
{% if options['customButtons']['before'] is defined %}
|
||||
|
@ -85,8 +85,8 @@
|
||||
<div class="flex-table list-household-members">
|
||||
{% for m in members %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row person">
|
||||
<div class="item-col box-person">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
{{ m.person|chill_entity_render_box({'addLink': true}) }}
|
||||
{% if m.holder %}
|
||||
@ -97,7 +97,7 @@
|
||||
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-col box-where">
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
{% if m.startDate is not empty %}
|
||||
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li>
|
||||
@ -155,8 +155,8 @@
|
||||
<div class="flex-table list-household-members">
|
||||
{% for m in members %}
|
||||
<div class="item-bloc">
|
||||
<div class="item-row person">
|
||||
<div class="item-col box-person">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
{{ m.person|chill_entity_render_box({'addLink': true}) }}
|
||||
{% if m.holder %}
|
||||
@ -167,7 +167,7 @@
|
||||
{{ 'Born the date'|trans({ 'gender': m.person.gender, 'birthdate': m.person.birthdate|format_date('long') }) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-col box-where">
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
{% if m.startDate is not empty %}
|
||||
<li>{{ 'Since %date%'|trans({'%date%': m.startDate|format_date('long') }) }}</li>
|
||||
|
@ -14,105 +14,107 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||
<div class="list-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-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
<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-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||
|
||||
{% if persons|length > 0 %}
|
||||
{% if persons|length > 0 %}
|
||||
|
||||
<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 %}
|
||||
<table class="table table-bordered border-dark align-middle">
|
||||
<thead>
|
||||
<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="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||
<th class="chill-orange">{% trans %}Name{% endtrans %}</th>
|
||||
<th class="chill-orange">{% 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 %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" class="btn btn-create">
|
||||
{{ 'Add a person'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% 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-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>
|
||||
{% else %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-action">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ 'Advanced search'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" class="btn btn-create">
|
||||
{{ 'Add a person'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% 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-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>
|
||||
{% else %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_main_advanced_search', { "name": search_name, "q": pattern } ) }}" class="btn btn-action">
|
||||
<i class="fa fa-search" aria-hidden="true"></i> {{ 'Advanced search'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -14,94 +14,96 @@
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#}
|
||||
<h2>{{ title|default('Person search results by phonenumber')|trans }}</h2>
|
||||
<div class="list-by-phonenumber">
|
||||
<h2>{{ title|default('Person search results by phonenumber')|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-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
<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-search" aria-hidden="true"></i> {{ pattern }}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||
|
||||
{% if persons|length > 0 %}
|
||||
{% if persons|length > 0 %}
|
||||
|
||||
<table class="person-list__--by-phonenumber">
|
||||
<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 %}Phonenumber{% endtrans %}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for person in persons %}
|
||||
<table class="table table-bordered border-dark align-middle">
|
||||
<thead>
|
||||
<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.firstName}} {{person.lastName}}
|
||||
{% 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 %}
|
||||
<th class="chill-orange">{% trans %}Name{% endtrans %}</th>
|
||||
<th class="chill-orange">{% trans %}Date of birth{% endtrans %}</th>
|
||||
<th class="chill-orange">{% trans %}Phonenumber{% 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.firstName}} {{person.lastName}}
|
||||
{% 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 class="person-list__--by-phonenumber__phones">
|
||||
<ul>
|
||||
{% if person.phonenumber is not empty %}
|
||||
<li>
|
||||
<a href="tel:{{ person.phonenumber }}"><img src="{{ asset('build/images/mobile-alt-solid.svg') }}"> <pre>{{ person.phonenumber|chill_format_phonenumber }}</pre></a>
|
||||
</li>
|
||||
{% 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 class="person-list__--by-phonenumber__phones">
|
||||
<ul>
|
||||
{% if person.phonenumber is not empty %}
|
||||
<li>
|
||||
<a href="tel:{{ person.phonenumber }}"><img src="{{ asset('build/images/mobile-alt-solid.svg') }}"> <pre>{{ person.phonenumber|chill_format_phonenumber }}</pre></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if person.mobilenumber is not empty%}
|
||||
<li>
|
||||
<a href="tel:{{ person.mobilenumber }}"><img src="{{ asset('build/images/phone-alt-solid.svg') }}"> <pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<li><a class="btn btn-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="btn btn-create">
|
||||
{{ 'Add a person'|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>
|
||||
{% endif %}
|
||||
{% if person.mobilenumber is not empty%}
|
||||
<li>
|
||||
<a href="tel:{{ person.mobilenumber }}"><img src="{{ asset('build/images/phone-alt-solid.svg') }}"> <pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li><a class="btn btn-show" href="{{ path('chill_person_view', { person_id : person.getId }) }}"></a></li>
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<li><a class="btn btn-update" href="{{ path('chill_person_general_edit', { person_id : person.getId }) }}"></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" class="btn btn-create">
|
||||
{{ 'Add a person'|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>
|
||||
{% endif %}
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -1,181 +1,145 @@
|
||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||
{% macro button_person(person) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id }) }}"
|
||||
class="btn btn-primary" title="{{ 'See accompanying periods'|trans }}"><i class="fa fa-random"></i></a>
|
||||
</li>
|
||||
{% endmacro %}
|
||||
|
||||
<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>
|
||||
<div class="list-with-period">
|
||||
|
||||
<p>{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}</p>
|
||||
<h2>{{ title|default('Person search results')|trans }}</h2>
|
||||
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" 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>
|
||||
<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>
|
||||
|
||||
|
||||
{% if persons|length > 0 %}
|
||||
|
||||
<div class="flex-table list-with-period">
|
||||
{% for person in persons %}
|
||||
|
||||
<div class="item-bloc">
|
||||
<div class="item-row person">
|
||||
|
||||
<div class="item-col box-person">
|
||||
<div>
|
||||
{{ person|chill_entity_render_box({
|
||||
'render': 'label', 'addLink': true, 'addInfo': true
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-col box-where">
|
||||
<ul class="list-content fa-ul">
|
||||
<li><i class="fa fa-li fa-long-arrow-right"></i>
|
||||
{{ person.center }}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{% if person.mobilenumber is not empty %}
|
||||
<i class="fa fa-li fa-mobile"></i> <a href="{{ 'tel:' ~ person.mobilenumber }}">{{ person.mobilenumber|chill_format_phonenumber }}</a>
|
||||
{% else %}
|
||||
<i class="fa fa-li fa-phone"></i>
|
||||
{% if person.phonenumber is not empty %}
|
||||
<a href="{{ 'tel:' ~ person.phonenumber }}">{{ person.phonenumber|chill_format_phonenumber }}</a>
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
{% if person.getLastAddress is not null %}
|
||||
{{ person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No address'|trans }}</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_view', { 'person_id' : person.id }) }}" class="btn btn-show"
|
||||
title="{{ 'Open person file'|trans }}"></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id }) }}"
|
||||
class="btn btn-primary" title="{{ 'See accompanying periods'|trans }}">
|
||||
<i class="fa fa-random"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</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 %}
|
||||
{% for app in apps %}
|
||||
<div class="item-row periods">
|
||||
|
||||
<div class="header">
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}"
|
||||
class="btn btn-chill-green" title="{{ 'See accompanying period'|trans }}">
|
||||
<i class="fa fa-random"></i>
|
||||
</a>
|
||||
<span>{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}</span>
|
||||
{% if app.accompanyingPeriod.user is not null %}
|
||||
<span class="user">
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
{{ app.accompanyingPeriod.user|chill_entity_render_box }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="list-content">
|
||||
{% for issue in app.accompanyingPeriod.socialIssues|slice(0,2) %}
|
||||
<span>{{ issue|chill_entity_render_box }}</span>
|
||||
{% endfor %}
|
||||
|
||||
{% if app.accompanyingPeriod.socialIssues|length > 2 %}
|
||||
<span class="more">{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
<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="btn btn-create">
|
||||
{{ 'Add a person'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" 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>
|
||||
<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>
|
||||
{% 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>
|
||||
|
||||
{% else %}
|
||||
<ul class="record_actions">
|
||||
<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>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if persons|length > 0 %}
|
||||
<div class="flex-table">
|
||||
{% for person in persons %}
|
||||
<div class="item-bloc">
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
{{ person|chill_entity_render_box({
|
||||
'render': 'bloc',
|
||||
'addLink': true,
|
||||
'addInfo': true,
|
||||
'addAltNames': false,
|
||||
'addCenter': true,
|
||||
'address_multiline': true,
|
||||
'customButtons': { 'after': _self.button_person(person) }
|
||||
}) }}
|
||||
|
||||
{#- '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 %}
|
||||
<div class="item-row periods">
|
||||
{% for app in apps %}
|
||||
|
||||
<div class="header">
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}"
|
||||
class="btn btn-chill-green" title="{{ 'See accompanying period'|trans }}">
|
||||
<i class="fa fa-random"></i>
|
||||
</a>
|
||||
<span>
|
||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||
</span>
|
||||
{% if app.accompanyingPeriod.user is not null %}
|
||||
<span class="user">
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
{{ app.accompanyingPeriod.user|chill_entity_render_box }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="list-content">
|
||||
{% for issue in app.accompanyingPeriod.socialIssues|slice(0,2) %}
|
||||
<span>{{ issue|chill_entity_render_box }}</span>
|
||||
{% endfor %}
|
||||
{% if app.accompanyingPeriod.socialIssues|length > 2 %}
|
||||
<span class="more">{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_PERSON_CREATE') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_new') }}" 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>
|
||||
{% else %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<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>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if preview == false %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
@ -58,6 +58,8 @@ class PersonRender extends AbstractChillEntityRender
|
||||
'addId' => $options['addId'] ?? false,
|
||||
'addInfo' => $options['addInfo'] ?? false,
|
||||
'addAge' => $options['addAge'] ?? false,
|
||||
'addCenter' => $options['addCenter'] ?? false,
|
||||
'address_multiline' => $options['address_multiline'] ?? false,
|
||||
'hLevel' => $options['hLevel'] ?? 3,
|
||||
'customButtons' => $options['customButtons'] ?? [],
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user