render_box: adding option addId + styles more generic, less specific

This commit is contained in:
2021-07-30 10:46:16 +02:00
parent 6dac130844
commit 4cac5f9a4a
10 changed files with 71 additions and 72 deletions

View File

@@ -1,22 +1,8 @@
section.chill-entity.entity-person {
div.entity-label {
div.denomination {
&.h3 {
font-size: 1.3em;
font-weight: 700;
}
a {
text-decoration: none;
}
span.firstname, span.lastname, span.altname {}
span.badge {
margin-left: 0.3em;
}
}
p.moreinfo {}
section.chill-entity {
&.entity-person {
span.firstname,
span.lastname,
span.altname {}
}
div.entity-row {}
div.entity-bloc {}
}

View File

@@ -5,6 +5,7 @@
* addAltNames bool
* addLink bool
* addEntity bool
* addId bool
* addInfo bool
* hLevel integer
* customButtons [
@@ -42,6 +43,11 @@
{%- if options['addEntity'] -%}
<span class="badge rounded-pill bg-secondary">{{ 'Person'|trans }}</span>
{%- endif -%}
{%- if options['addId'] -%}
<span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ person.id }}">
{{ person.id|upper }}
</span>
{%- endif -%}
</div>
{%- if options['addInfo'] -%}
{% set gender = (person.gender == 'woman') ? 'fa-venus' :

View File

@@ -2,26 +2,17 @@
<div id="header-person-name" class="header-name">
<div class="container-xxl">
<div class="row">
<div class="col-md-6">
<h1>
{% set gender =
(person.gender == "woman") ? 'female' :
(person.gender == "both") ? 'neuter' : 'male'
%}
<i class="fa fa-fw fa-{{ gender }}" title="{{ gender|capitalize|trans }}"></i>
{{ person|chill_entity_render_string }}
<span class="id-number" title="{{ 'Person'|trans ~ ' ' ~ person.id }}">
{{ person.id|upper }}
</span>
</h1>
{{ person|chill_entity_render_box({
'render': 'label', 'addInfo': true, 'addId': true, 'hLevel': 1
}) }}
</div>
<div class="col-md-auto ps-4 ps-md-2">
<ul class="list-content fa-ul my-2">
{% if person.email %}
{% if person.email %}
<li>
<i class="fa fa-li fa-envelope-o"></i>
<a href="{{ 'mailto:' ~ person.email }}" class="email" title="{{ 'Email'|trans }}">
@@ -44,7 +35,7 @@
{% endif %}
</ul>
</div>
<div class="col-md ps-4 ps-md-2">
<ul class="list-content fa-ul">
{%- if person.currentHouseholdAddress is not empty -%}
@@ -60,14 +51,14 @@
{%- endif -%}
</ul>
</div>
</div>
</div>
</div>
<div id="header-person-details" class="header-details">
<div class="container-xxl">
<div class="row justify-content-between">
<div class="col-md-6 ps-4">
<span class="open_sansbold">
{{ 'Birthdate'|trans|upper }} &nbsp; :
@@ -81,7 +72,7 @@
{{ person.age ~ ((person.age > 1) ? ' ans' : ' an') }}
</span>
</div>
{%- if chill_person.fields.nationality == 'visible' -%}
<div class="col-md-auto ps-4 ps-md-2">
<span class="open_sansbold">
@@ -94,16 +85,16 @@
{% endif %}
</div>
{%- endif -%}
{%- if chill_person.fields.spoken_languages == 'visible' -%}
<div class="col-md ps-4 ps-md-2 text-md-end text-start pe-4">
<span class="open_sansbold">
{{ 'Center'|trans|upper}} &nbsp; :
</span>
</span>
{{ person.center.name|upper }}
</div>
{%- endif -%}
</div>
</div>
</div>

View File

@@ -55,6 +55,7 @@ class PersonRender extends AbstractChillEntityRender
'addAltNames' => $this->configAltNamesHelper->hasAltNames(),
'addLink' => $options['addLink'] ?? false,
'addEntity' => $options['addEntity'] ?? false,
'addId' => $options['addId'] ?? false,
'addInfo' => $options['addInfo'] ?? false,
'hLevel' => $options['hLevel'] ?? 3,
'customButtons' => $options['customButtons'] ?? [],