mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
person: add show/hide on marital status date
This commit is contained in:
parent
504b2efacf
commit
c23ada3533
@ -1,10 +1,29 @@
|
|||||||
import { ShowHide } from 'ShowHide/show_hide.js';
|
import { ShowHide } from 'ShowHide/show_hide.js';
|
||||||
|
|
||||||
|
const maritalStatus = document.getElementById("maritalStatus");
|
||||||
|
const maritalStatusDate = document.getElementById("maritalStatusDate");
|
||||||
const personEmail = document.getElementById("personEmail");
|
const personEmail = document.getElementById("personEmail");
|
||||||
const personAcceptEmail = document.getElementById("personAcceptEmail");
|
const personAcceptEmail = document.getElementById("personAcceptEmail");
|
||||||
const personPhoneNumber = document.getElementById("personPhoneNumber");
|
const personPhoneNumber = document.getElementById("personPhoneNumber");
|
||||||
const personAcceptSMS = document.getElementById("personAcceptSMS");
|
const personAcceptSMS = document.getElementById("personAcceptSMS");
|
||||||
|
|
||||||
|
|
||||||
|
new ShowHide({
|
||||||
|
froms: [maritalStatus],
|
||||||
|
container: [maritalStatusDate],
|
||||||
|
test: function(froms) {
|
||||||
|
for (let f of froms.values()) {
|
||||||
|
for (let input of f.querySelectorAll('select').values()) {
|
||||||
|
if (input.value) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
event_name: 'change'
|
||||||
|
});
|
||||||
|
|
||||||
new ShowHide({
|
new ShowHide({
|
||||||
froms: [personEmail],
|
froms: [personEmail],
|
||||||
container: [personAcceptEmail],
|
container: [personAcceptEmail],
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
{%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%}
|
{%- if form.nationality is defined or form.spokenLanguages is defined -%}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
|
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
|
||||||
{%- if form.nationality is defined -%}
|
{%- if form.nationality is defined -%}
|
||||||
@ -69,11 +69,21 @@
|
|||||||
{%- if form.spokenLanguages is defined -%}
|
{%- if form.spokenLanguages is defined -%}
|
||||||
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
|
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
</fieldset>
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- if form.numberOfChildren is defined or form.maritalStatus is defined -%}
|
||||||
|
<fieldset>
|
||||||
|
<legend><h2>{{ 'Marital status'|trans }}</h2></legend>
|
||||||
{{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }}
|
{{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }}
|
||||||
{%- if form.maritalStatus is defined -%}
|
{%- if form.maritalStatus is defined -%}
|
||||||
|
<div id="maritalStatus">
|
||||||
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
|
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
|
||||||
|
</div>
|
||||||
|
<div id="maritalStatusDate">
|
||||||
{{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }}
|
{{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }}
|
||||||
{{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }}
|
{{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }}
|
||||||
|
</div>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
@ -185,12 +185,16 @@ This view should receive those arguments:
|
|||||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
<dt>{{'Date of last marital status change'|trans}} :</dt>
|
<dt>{{'Date of last marital status change'|trans}} :</dt>
|
||||||
{% if person.maritalStatusDate is not null %}
|
{% if person.maritalStatusDate is not null %}
|
||||||
<dd>
|
<dd>
|
||||||
{{ person.maritalStatusDate|format_date('long') }}
|
{{ person.maritalStatusDate|format_date('long') }}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
{% if not person.maritalStatusComment.isEmpty %}
|
{% if not person.maritalStatusComment.isEmpty %}
|
||||||
<dt>{{'Comment on the marital status'|trans}} :</dt>
|
<dt>{{'Comment on the marital status'|trans}} :</dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user