From ed15af2edd0061a9b5f239bebf2744cadbe0f5b2 Mon Sep 17 00:00:00 2001 From: Felix Rindt Date: Sat, 26 Oct 2024 14:37:22 +0200 Subject: [PATCH] fix subblock enumeration --- ephios/plugins/complexsignup/static/complexsignup/editor.js | 4 +++- .../complexsignup/templates/complexsignup/vue_editor.html | 2 +- ephios/plugins/files/signals.py | 1 + ephios/plugins/simpleresource/signals.py | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ephios/plugins/complexsignup/static/complexsignup/editor.js b/ephios/plugins/complexsignup/static/complexsignup/editor.js index 193d45d23..1c6b91298 100644 --- a/ephios/plugins/complexsignup/static/complexsignup/editor.js +++ b/ephios/plugins/complexsignup/static/complexsignup/editor.js @@ -169,11 +169,13 @@ document.addEventListener('DOMContentLoaded', (event) => { function getSubBlocks(block) { const subBlocks = []; block.sub_compositions.forEach(composition => { - const sub_block = getBlockById(composition.sub_block); + // clone because for rendering because we're adding information per composition + const sub_block = Object.assign({}, getBlockById(composition.sub_block)); if (!sub_block) { return; } sub_block.sub_label = composition.label; // provide the label as an additional attribute + sub_block.compositionClientId = composition.clientId; // provide id for vue loop subBlocks.push(sub_block); }); return subBlocks; diff --git a/ephios/plugins/complexsignup/templates/complexsignup/vue_editor.html b/ephios/plugins/complexsignup/templates/complexsignup/vue_editor.html index a20f8d6ab..e84423481 100644 --- a/ephios/plugins/complexsignup/templates/complexsignup/vue_editor.html +++ b/ephios/plugins/complexsignup/templates/complexsignup/vue_editor.html @@ -363,7 +363,7 @@

{% translate "unnamed" %} - [[ sub_block.sub_label ]] diff --git a/ephios/plugins/files/signals.py b/ephios/plugins/files/signals.py index e591da667..03e95c861 100644 --- a/ephios/plugins/files/signals.py +++ b/ephios/plugins/files/signals.py @@ -38,6 +38,7 @@ def display_event_files(event, request, **kwargs): return render_to_string( "files/document_attachement.html", {"documents": event.documents.all()}, request ) + return "" @receiver( diff --git a/ephios/plugins/simpleresource/signals.py b/ephios/plugins/simpleresource/signals.py index 6b426971d..809b2ff10 100644 --- a/ephios/plugins/simpleresource/signals.py +++ b/ephios/plugins/simpleresource/signals.py @@ -18,6 +18,7 @@ def display_shift_resources(shift, request, **kwargs): ) except ResourceAllocation.DoesNotExist: pass + return "" @receiver(nav_link, dispatch_uid="ephios.plugins.simpleresource.signals.nav_link")