mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
allow to hide memo
This commit is contained in:
parent
f2ed32e458
commit
4513ef35f6
@ -75,6 +75,7 @@ class Configuration implements ConfigurationInterface
|
||||
->append($this->addFieldNode('spoken_languages'))
|
||||
->append($this->addFieldNode('address'))
|
||||
->append($this->addFieldNode('accompanying_period'))
|
||||
->append($this->addFieldNode('memo'))
|
||||
->end() //children for 'person_fields', parent = array 'person_fields'
|
||||
->end() // person_fields, parent = children of root
|
||||
->end() // children of 'root', parent = root
|
||||
|
@ -68,9 +68,13 @@ class PersonType extends AbstractType
|
||||
->add('birthdate', DateType::class, array('required' => false, 'widget' => 'single_text', 'format' => 'dd-MM-yyyy'))
|
||||
->add('gender', GenderType::class, array(
|
||||
'required' => true
|
||||
))
|
||||
->add('memo', TextareaType::class, array('required' => false))
|
||||
));
|
||||
|
||||
if ($this->config['memo'] === 'visible') {
|
||||
$builder
|
||||
->add('memo', TextareaType::class, array('required' => false))
|
||||
;
|
||||
}
|
||||
|
||||
if ($this->config['place_of_birth'] === 'visible') {
|
||||
$builder->add('placeOfBirth', TextType::class, array('required' => false));
|
||||
|
@ -28,10 +28,12 @@
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
{% if form.memo is defined %}
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'Memo'|trans }}</h2></legend>
|
||||
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
|
||||
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'General information'|trans }}</h2></legend>
|
||||
|
@ -41,7 +41,7 @@ This view should receive those arguments:
|
||||
<div class="person-view">
|
||||
|
||||
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
|
||||
{% if person.memo is not empty %}
|
||||
{% if person.memo is not empty and chill_person.fields.memo == 'visible' %}
|
||||
<div class="grid-12">
|
||||
<figure class="person-details">
|
||||
<h2 class="chill-red">{{ 'Memo'|trans }}</h2>
|
||||
|
Loading…
x
Reference in New Issue
Block a user