Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix subblock enumeration #1408

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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