layout content position for fullwidth pages

This commit is contained in:
Mathieu Jaumotte 2021-07-23 11:38:53 +02:00
parent d8d66aeeb6
commit e0dbe9cf9d
3 changed files with 214 additions and 215 deletions

View File

@ -1,4 +1,4 @@
<div class="{% block crud_content_main_div_class %}col-10 centered{% endblock %}">
<div class="{% block crud_content_main_div_class %}{% endblock %}">
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_edit')|trans }}</h1>
{% endblock crud_content_header %}

View File

@ -4,10 +4,10 @@
{% block title 'household.Edit household members'|trans %}
{% block content %}
<div class="household-members">
<div class="col-md-10 col-xxl household-members">
<h1>{{ block('title') }}</h1>
<div id="household_members_editor"></div>
<h1>{{ block('title') }}</h1>
<div id="household_members_editor"></div>
</div>
{% endblock %}

View File

@ -38,221 +38,220 @@ This view should receive those arguments:
{% block personcontent %}
<div class="person-view">
<div class="row">
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}
<div class="col-12">
<figure class="person-details">
<h2 class="chill-red">{{ 'Memo'|trans }}</h2>
<div class="row">
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}
<div class="col-12">
<figure class="person-details">
<h2 class="chill-red">{{ 'Memo'|trans }}</h2>
<div class="chill-user-quote">
{{ person.memo|chill_markdown_to_html }}
</div>
</figure>
</div>
{% endif %}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-red">{{ 'General information'|trans }}</h2>
<dl>
<dt>{{ 'First name'|trans }}&nbsp;:</dt>
<dd>{{ person.firstName }}</dd>
<dt>{{ 'Last name'|trans }}&nbsp;:</dt>
<dd>{{ person.lastName }}</dd>
{% for el in person.altNames %}
{% if el.key in alt_names|keys %}
<dt>{{ alt_names[el.key]|localize_translatable_string }}&nbsp;:</dt>
<dd>{{ el.label }}</dd>
{% endif %}
{% endfor %}
<dt>{{ 'Gender'|trans }}&nbsp;:</dt>
<dd>{{ ( person.gender|default('Not given'))|trans }}</dd>
</dl>
</figure>
<div class="chill-user-quote">
{{ person.memo|chill_markdown_to_html }}
</div>
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-green"><i class="fa fa-birthday-cake"></i>&nbsp;{{ 'Birth information'|trans }}</h2>
<dl>
<dt>{{ 'Date of birth'|trans }}&nbsp;:</dt>
<dd>
{%- if person.birthdate is not null -%}
{{ person.birthdate|format_date('long') }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'Unknown date of birth'|trans }}</span>
{%- endif -%}
</dd>
{%- if chill_person.fields.place_of_birth == 'visible' -%}
<dt>{{ 'Place of birth'|trans }}&nbsp;:</dt>
{% if person.placeOfBirth is not empty %}
<dd>{{ person.placeOfBirth }}</dd>
{% else %}
<dd><span class="chill-no-data-statement">{{ 'Not given'|trans }}</span></dd>
{% endif %}
{%- endif -%}
{%- if chill_person.fields.country_of_birth == 'visible' -%}
<dt>{{ 'Country of birth'|trans }}&nbsp;:</dt>
<dd>{% apply spaceless %}
{% if person.countryOfBirth is not null %}
{{ person.countryOfBirth.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'Unknown country of birth'|trans }}</span>
{% endif %}
{% endapply %}</dd>
{%- endif -%}
</dl>
</figure>
</div>
</div>
<div class="row">
{%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-orange">{{ 'Administrative information'|trans }}</h2>
{%- if chill_person.fields.nationality == 'visible' -%}
<dl>
<dt>{{ 'Nationality'|trans }}&nbsp;:</dt>
<dd>
{% if person.nationality is not null %}
{{ person.nationality.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'Without nationality'|trans }}</span>
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.spoken_languages == 'visible' -%}
<dl>
<dt>{{'Spoken languages'|trans}}&nbsp;:</dt>
<dd>
{% if person.spokenLanguages|length == 0 %}
<span class="chill-no-data-statement">{{ 'Unknown spoken languages'|trans }}</span>
{% else %}
{% for lang in person.spokenLanguages %}
{{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.marital_status == 'visible' -%}
<dl>
<dt>{{'Marital status'|trans}}&nbsp;:</dt>
<dd>
{% if person.maritalStatus is not null %}
{{ person.maritalStatus.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</dd>
</dl>
{%- endif -%}
</figure>
</div>
{%- endif -%}
{%- if chill_person.fields.email == 'visible'
or chill_person.fields.phonenumber == 'visible'
or chill_person.fields.mobilenumber == 'visible'
or chill_person.fields.contact_info == 'visible' -%}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i>&nbsp;{{ 'Contact information'|trans }}</h2>
{%- if chill_person.fields.address == 'visible' -%}
<dl>
<dt>{{ 'Address'|trans }}</dt>
<dd>
{%- if person.lastAddress is not empty -%}
{{ address._render(person.lastAddress, {'has_no_address': true}) }}
<ul class="list-inline text-right mt-2">
<li class="list-inline-item">
<a class="btn btn-warning btn-sm" title="{{ 'Edit'|trans }}"
href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : person.lastAddress.id } ) }}">
<i class="fa fa-pencil fa-fw"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}"
href="{{ path('chill_person_address_list', { 'person_id': person.id } ) }}">
<i class="fa fa-list fa-fw"></i>
</a>
</li>
</ul>
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="">
{{ 'Add an address'|trans }}
</a>
{%- endif -%}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.email == 'visible' -%}
<dl>
<dt>{{ 'Email'|trans }}&nbsp;:</dt>
<dd>{% if person.email is not empty %}<blockquote class="chill-user-quote">{{ person.email|nl2br }}</blockquote>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.phonenumber == 'visible' -%}
<dl>
<dt>{{ 'Phonenumber'|trans }}&nbsp;:</dt>
<dd>{% if person.phonenumber is not empty %}<a href="tel:{{ person.phonenumber }}"><pre>{{ person.phonenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
</dl>
{% endif %}
{%- if chill_person.fields.mobilenumber == 'visible' -%}
<dl>
<dt>{{ 'Mobilenumber'|trans }}&nbsp;:</dt>
<dd>{% if person.mobilenumber is not empty %}<a href="tel:{{ person.mobilenumber }}"><pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
</dl>
{% endif %}
{%- if chill_person.fields.contact_info == 'visible' -%}
<dl>
<dt>{{ 'Notes on contact information'|trans }}&nbsp;:</dt>
<dd>{% if person.contactInfo is not empty %}{{ person.contactInfo|nl2br }}{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
</dl>
{%- endif -%}
</figure>
</div>
{%- endif -%}
</div>
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}
<div class="row">
<div class="col-12 custom-fields">
<figure class="person-details">
{{ chill_custom_fields_group_widget(person.cFData, cFGroup) }}
</figure>
</div>
</div>
<div class="row">
<figure class="person-details"></figure>
</div>
{% endif %}
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
<ul class="sticky-form-buttons record_actions">
<li>
<a class="btn btn-update" href="{{ path('chill_person_general_edit', { 'person_id': person.id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
{% endif %}
</figure>
</div>
{% endif %}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-red">{{ 'General information'|trans }}</h2>
<dl>
<dt>{{ 'First name'|trans }}&nbsp;:</dt>
<dd>{{ person.firstName }}</dd>
<dt>{{ 'Last name'|trans }}&nbsp;:</dt>
<dd>{{ person.lastName }}</dd>
{% for el in person.altNames %}
{% if el.key in alt_names|keys %}
<dt>{{ alt_names[el.key]|localize_translatable_string }}&nbsp;:</dt>
<dd>{{ el.label }}</dd>
{% endif %}
{% endfor %}
<dt>{{ 'Gender'|trans }}&nbsp;:</dt>
<dd>{{ ( person.gender|default('Not given'))|trans }}</dd>
</dl>
</figure>
</div>
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-green"><i class="fa fa-birthday-cake"></i>&nbsp;{{ 'Birth information'|trans }}</h2>
<dl>
<dt>{{ 'Date of birth'|trans }}&nbsp;:</dt>
<dd>
{%- if person.birthdate is not null -%}
{{ person.birthdate|format_date('long') }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'Unknown date of birth'|trans }}</span>
{%- endif -%}
</dd>
{%- if chill_person.fields.place_of_birth == 'visible' -%}
<dt>{{ 'Place of birth'|trans }}&nbsp;:</dt>
{% if person.placeOfBirth is not empty %}
<dd>{{ person.placeOfBirth }}</dd>
{% else %}
<dd><span class="chill-no-data-statement">{{ 'Not given'|trans }}</span></dd>
{% endif %}
{%- endif -%}
{%- if chill_person.fields.country_of_birth == 'visible' -%}
<dt>{{ 'Country of birth'|trans }}&nbsp;:</dt>
<dd>{% apply spaceless %}
{% if person.countryOfBirth is not null %}
{{ person.countryOfBirth.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'Unknown country of birth'|trans }}</span>
{% endif %}
{% endapply %}</dd>
{%- endif -%}
</dl>
</figure>
</div>
</div>
<div class="row">
{%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-orange">{{ 'Administrative information'|trans }}</h2>
{%- if chill_person.fields.nationality == 'visible' -%}
<dl>
<dt>{{ 'Nationality'|trans }}&nbsp;:</dt>
<dd>
{% if person.nationality is not null %}
{{ person.nationality.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'Without nationality'|trans }}</span>
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.spoken_languages == 'visible' -%}
<dl>
<dt>{{'Spoken languages'|trans}}&nbsp;:</dt>
<dd>
{% if person.spokenLanguages|length == 0 %}
<span class="chill-no-data-statement">{{ 'Unknown spoken languages'|trans }}</span>
{% else %}
{% for lang in person.spokenLanguages %}
{{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.marital_status == 'visible' -%}
<dl>
<dt>{{'Marital status'|trans}}&nbsp;:</dt>
<dd>
{% if person.maritalStatus is not null %}
{{ person.maritalStatus.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</dd>
</dl>
{%- endif -%}
</figure>
</div>
{%- endif -%}
{%- if chill_person.fields.email == 'visible'
or chill_person.fields.phonenumber == 'visible'
or chill_person.fields.mobilenumber == 'visible'
or chill_person.fields.contact_info == 'visible' -%}
<div class="col-sm-6 my-3">
<figure class="person-details">
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i>&nbsp;{{ 'Contact information'|trans }}</h2>
{%- if chill_person.fields.address == 'visible' -%}
<dl>
<dt>{{ 'Address'|trans }}</dt>
<dd>
{%- if person.lastAddress is not empty -%}
{{ address._render(person.lastAddress, {'has_no_address': true}) }}
<ul class="list-inline text-right mt-2">
<li class="list-inline-item">
<a class="btn btn-warning btn-sm" title="{{ 'Edit'|trans }}"
href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : person.lastAddress.id } ) }}">
<i class="fa fa-pencil fa-fw"></i>
</a>
</li>
<li class="list-inline-item">
<a class="btn btn-secondary btn-sm" title="{{ "Addresses history"|trans }}"
href="{{ path('chill_person_address_list', { 'person_id': person.id } ) }}">
<i class="fa fa-list fa-fw"></i>
</a>
</li>
</ul>
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="">
{{ 'Add an address'|trans }}
</a>
{%- endif -%}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.email == 'visible' -%}
<dl>
<dt>{{ 'Email'|trans }}&nbsp;:</dt>
<dd>{% if person.email is not empty %}<blockquote class="chill-user-quote">{{ person.email|nl2br }}</blockquote>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.phonenumber == 'visible' -%}
<dl>
<dt>{{ 'Phonenumber'|trans }}&nbsp;:</dt>
<dd>{% if person.phonenumber is not empty %}<a href="tel:{{ person.phonenumber }}"><pre>{{ person.phonenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
</dl>
{% endif %}
{%- if chill_person.fields.mobilenumber == 'visible' -%}
<dl>
<dt>{{ 'Mobilenumber'|trans }}&nbsp;:</dt>
<dd>{% if person.mobilenumber is not empty %}<a href="tel:{{ person.mobilenumber }}"><pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
</dl>
{% endif %}
{%- if chill_person.fields.contact_info == 'visible' -%}
<dl>
<dt>{{ 'Notes on contact information'|trans }}&nbsp;:</dt>
<dd>{% if person.contactInfo is not empty %}{{ person.contactInfo|nl2br }}{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
</dl>
{%- endif -%}
</figure>
</div>
{%- endif -%}
</div>
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}
<div class="row">
<div class="col-12 custom-fields">
<figure class="person-details">
{{ chill_custom_fields_group_widget(person.cFData, cFGroup) }}
</figure>
</div>
</div>
<div class="row">
<figure class="person-details"></figure>
</div>
{% endif %}
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
<ul class="sticky-form-buttons record_actions">
<li>
<a class="btn btn-update" href="{{ path('chill_person_general_edit', { 'person_id': person.id }) }}">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
{% endif %}
</div>
{% endblock %}