Commit 4513ef35 authored by Julien Fastré's avatar Julien Fastré

allow to hide memo

parent f2ed32e4
Pipeline #70872 failed with stages
in 42 seconds
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment