js files put in place + select menus added for selecting person/thirdparty/... show-hide not working yet

This commit is contained in:
2022-01-19 09:48:39 +01:00
parent 4a5a1440ff
commit 94c9505c05
8 changed files with 116 additions and 16 deletions

View File

@@ -0,0 +1,33 @@
import {ShowHide} from 'ChillMainAssets/lib/show_hide/show_hide.js';
window.addEventListener('DOMContentLoaded', function() {
let
linkedEntityContainer = document.querySelector('#linked-entity'),
personContainer = document.querySelector('#person-entity'),
thirdpartyContainer = document.querySelector('#thirdparty-entity'),
freetextContainer = document.querySelector('#freetext-entity')
;
if (null === linkedEntityContainer) {
return;
}
new ShowHide({
debug: true,
load_event: null,
froms: [linkedEntityContainer],
container: [personContainer, thirdpartyContainer, freetextContainer],
test: function(containers, arg2, arg3) {
for (let container of containers) {
for (let input of container.querySelectorAll('input')) {
if (!input.checked) {
return true;
} else {
return false;
}
}
}
},
})
});

View File

@@ -6,7 +6,19 @@
{{ form_row(form.kind) }}
{{ form_row(form.linkedEntity) }}
<div id="linked-entity">
{{ form_row(form.linkedEntity) }}
</div>
<div id="person-entity">
{{ form_row(form.person) }}
</div>
<div id="thirdparty-entity">
{{ form_row(form.thirdparty) }}
</div>
<div id="freetext-entity">
{{ form_row(form.freetext) }}
</div>
{{ form_row(form.comment) }}

View File

@@ -20,7 +20,7 @@
<div class="item-bloc">
<div class="item-row">
<div class="item-col">comment zone</div>
<div class="item-col">doing</div>
<div class="item-col">....</div>
</div>
<div class="item-row">
{# <div class="item-col">today</div> #}
@@ -31,4 +31,8 @@
{% include "@ChillPerson/PersonResource/create.html.twig" %}
{% endblock %}
{% block js %}
{# {{ encore_entry_script_tags('page_person_resource') }} #}
{% endblock %}