-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from commonknowledge/STW-27/add-an-accordion-f…
…eature-to-page-elements Add bootstrap accordion block
- Loading branch information
Showing
3 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
stopwatch/templates/stopwatch/components/accordion_block.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% load static wagtailcore_tags %} | ||
|
||
{% for block in self %} | ||
{% with block.id|stringformat:"s" as block_id %} | ||
<div id="accordion-{{ block_id }}" role="tablist" aria-multiselectable="false" class="accordion"> | ||
{% for block in self %} | ||
<div class="accordion-block"> | ||
<div class="accordion-header" role="tab" id="heading-{{ block_id }}"> | ||
<a class="accordion-block-title heading-large mb-3 collapsed" type="button" | ||
data-bs-toggle="collapse" data-bs-target="#collapse-{{ forloop.parentloop.counter }}-{{ block_id }}" | ||
aria-expanded="false" aria-controls="collapse-{{ forloop.parentloop.counter }}-{{ block_id }}"> | ||
{% include_block block.value.title %} | ||
<i class="bi bi-chevron-down"></i> | ||
<i class="bi bi-chevron-up"></i> | ||
</a> | ||
</div> | ||
<div id="collapse-{{ forloop.parentloop.counter }}-{{ block_id }}" class="accordion-collapse collapse" role="tabpanel" aria-labelledby="heading-{{ block_id }}"> | ||
<div class="accordion-block-body">{% include_block block.value.content %}</div> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endwith %} | ||
{% endfor %} |