WIP: #112 Restructure CompensationAction

This commit is contained in:
mpeltriaux 2022-02-11 16:21:44 +01:00
parent 23790bca8d
commit 3df605376c
2 changed files with 6 additions and 22 deletions

View File

@ -22,7 +22,7 @@ from intervention.inputs import TreeSelectMultiple
from konova.contexts import BaseContext from konova.contexts import BaseContext
from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm from konova.forms import BaseModalForm, NewDocumentModalForm, RemoveModalForm
from konova.models import DeadlineType from konova.models import DeadlineType
from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \ from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, \
ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED ADDED_COMPENSATION_ACTION, PAYMENT_EDITED, COMPENSATION_STATE_EDITED, COMPENSATION_ACTION_EDITED, DEADLINE_EDITED

View File

@ -1,18 +1,14 @@
<div id="jstree"> <div id="jstree"></div>
</div> <input id="jstree-input" name="{{ widget.name }}" hidden="hidden"/>
<input id="jstree-input" name="{{ widget.name }}[]" hidden="hidden"/>
<script> <script>
$(function () { $(function () {
$('#jstree').jstree({ $('#jstree').jstree({
'plugins': [ 'plugins': [
'checkbox', 'checkbox',
'wholerow',
], ],
'checkbox': {
'whole_node': false,
},
'core' : { 'core' : {
'data' : { 'data' : {
'url' : '{{ widget.attrs.url }}', 'url' : '{{ widget.attrs.url }}',
@ -24,22 +20,10 @@
}); });
$('#jstree') $('#jstree')
.on('deselect_node.jstree', function (e, data) { .on('deselect_node.jstree', function (e, data) {
$(data.selected).each(function (val){ $('#jstree-input').val(data.selected);
console.log(val)
console.log(this)
$(this).after(
"<input name='{{widget.name}}[]' value="+val+"/>"
)
});
//$('#jstree-input').val(data.selected);
}) })
.on('select_node.jstree', function (e, data) { .on('select_node.jstree', function (e, data) {
$(data.selected).each(function (val){ $('#jstree-input').val(data.selected);
$(this).after(
"<input name='{{widget.name}}[]' value="+val+"/>"
)
});
//$('#jstree-input').val(data.selected);
}) })
}); });
</script> </script>