set some fields visibility as configurable

Some fields can now be hidden through configuration
This commit is contained in:
2016-02-05 23:05:53 +01:00
parent d70be5ea85
commit d419be2af1
13 changed files with 551 additions and 48 deletions

View File

@@ -43,23 +43,40 @@
<fieldset>
<legend><h2>{{ 'Birth information'|trans }}</h2></legend>
{{ form_row(form.birthdate, {'label': 'Date of birth'} ) }}
{%- if form.placeOfBirth is defined -%}
{{ form_row(form.placeOfBirth, { 'label' : 'Place of birth'} ) }}
{%- endif -%}
{%- if form.countryOfBirht is defined -%}
{{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }}
{%- endif -%}
</fieldset>
{%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%}
<fieldset>
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
{%- if form.nationality is defined -%}
{{ form_row(form.nationality, { 'label' : 'Nationality'|trans} ) }}
{%- endif -%}
{%- if form.spokenLanguages is defined -%}
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
{%- endif -%}
{%- if form.maritalStatus is defined -%}
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
{%- endif -%}
</fieldset>
{%- endif -%}
{%- if form.email is defined or form.phonenumber is defined -%}
<fieldset>
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
{%- if form.email is defined -%}
{{ form_row(form.email, {'label': 'Email'}) }}
{%- endif -%}
{%- if form.phonenumber is defined -%}
{{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }}
{%- endif -%}
</fieldset>
{%- endif -%}
{{ form_rest(form) }}

View File

@@ -86,8 +86,11 @@ This view should receive those arguments:
{%- endif -%}
</dd>
{%- if chill_person.fields.place_of_birth == 'visible' -%}
<dt>{{ 'Place of birth'|trans }}&nbsp;:</dt>
<dd>{{ person.placeOfBirth }}</dd>
{%- endif -%}
{%- if chill_person.fields.country_of_birth == 'visible' -%}
<dt>{{ 'Country of birth'|trans }}&nbsp;:</dt>
<dd>{% spaceless %}
{% if person.countryOfBirth is not null %}
@@ -96,6 +99,7 @@ This view should receive those arguments:
{{ 'Unknown country of birth'|trans }}
{% endif %}
{% endspaceless %}</dd>
{%- endif -%}
</dl>
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
@@ -106,10 +110,12 @@ This view should receive those arguments:
</div>
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
{%- if chill_person.fields.nationality == 'visible' or chill_person.fields.spoken_languages == 'visible'-%}
<div class="grid-6">
<figure class="person-details">
<h2 class="chill-orange">{{ 'Administrative information'|trans|upper }}</h2>
{%- if chill_person.fields.nationality == 'visible' -%}
<dl>
<dt>{{ 'Nationality'|trans }}&nbsp;:</dt>
<dd>
@@ -120,6 +126,8 @@ This view should receive those arguments:
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.spoken_languages == 'visible' -%}
<dl>
<dt>{{'Spoken languages'|trans}}&nbsp;:</dt>
<dd>
@@ -132,6 +140,8 @@ This view should receive those arguments:
{% endif %}
</dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.marital_status == 'visible' -%}
<dl>
<dt>{{'Marital status'|trans}}&nbsp;:</dt>
<dd>
@@ -142,24 +152,31 @@ This view should receive those arguments:
{% endif %}
</dd>
</dl>
{%- endif -%}
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
{{ include(edit_tmp_name, edit_tmp_args) }}
{% endif %}
</figure>
</div>
{%- endif -%}
{%- if chill_person.fields.email == 'visible' or chill_person.fields.phonenumber == 'visible' -%}
<div class="grid-6">
<figure class="person-details">
<h2 class="chill-blue"><i class="fa fa-envelope-o"></i>&nbsp;{{ 'Contact information'|trans|upper }}</h2>
{%- if chill_person.fields.email == 'visible' -%}
<dl>
<dt>{{ 'Email'|trans }}&nbsp;:</dt>
<dd><pre>{{ person.email}}&nbsp;</pre></dd>
</dl>
{%- endif -%}
{%- if chill_person.fields.phonenumber == 'visible' -%}
<dl>
<dt>{{ 'Phonenumber'|trans }}&nbsp;:</dt>
<dd><pre>{{ person.phonenumber}}&nbsp;</pre></dd>
</dl>
{% endif %}
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
@@ -167,6 +184,7 @@ This view should receive those arguments:
{% endif %}
</figure>
</div>
{%- endif -%}
</div>
{% if cFGroup and (cFGroup.getActiveCustomFields|length > 0) %}