Skip to content

Commit

Permalink
fix subblock enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Oct 26, 2024
1 parent 23ae6d0 commit ed15af2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ephios/plugins/complexsignup/static/complexsignup/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ <h1 class="h3">
{% translate "unnamed" %}
</span>
</span>
<span v-for="sub_block in getSubBlocks(block)" :key="sub_block.uuid"
<span v-for="sub_block in getSubBlocks(block)" :key="sub_block.compositionClientId"
class="badge text-bg-secondary me-1">
<span v-if="sub_block.sub_label">
[[ sub_block.sub_label ]]
Expand Down
1 change: 1 addition & 0 deletions ephios/plugins/files/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions ephios/plugins/simpleresource/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ed15af2

Please sign in to comment.