-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
21 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
42 changes: 21 additions & 21 deletions
42
content_manager/templates/content_manager/blocks/accordions.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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
{% load dsfr_tags wagtailcore_tags %} | ||
<div class="fr-container fr-py-3w"> | ||
<div class="fr-grid-row fr-grid-row--gutters"> | ||
<div class="fr-col-12 fr-col-offset-md-2 fr-col-md-8"> | ||
{% for subblock in block.value %} | ||
{% if subblock.block_type == 'title' %} | ||
<div class="fr-col-12"> | ||
<h2>{{ subblock.value }}</h2> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
<div class="fr-accordions-group"> | ||
{% for subblock in block.value %} | ||
{% if subblock.block_type == 'accordion' %} | ||
{% with forloop.counter0|lower as str_counter %} | ||
{% with "accordion-"|add:accordions_id|add:"-"|add:str_counter as accordion_id %} | ||
{% dsfr_accordion id=accordion_id title=subblock.value.title content=subblock.value.content|richtext %} | ||
{% endwith %} | ||
{% endwith %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<div class="fr-grid-row fr-grid-row--gutters"> | ||
<div class="fr-col-12 fr-col-offset-md-2 fr-col-md-8"> | ||
{% for subblock in block.value %} | ||
{% if subblock.block_type == 'title' %} | ||
<div class="fr-col-12"> | ||
<h2>{{ subblock.value }}</h2> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
<div class="fr-accordions-group"> | ||
{% for subblock in block.value %} | ||
{% if subblock.block_type == 'accordion' %} | ||
{% with forloop.counter0|lower as str_counter %} | ||
{% with "accordion-"|add:accordions_id|add:"-"|add:str_counter as accordion_id %} | ||
{% dsfr_accordion id=accordion_id title=subblock.value.title content=subblock.value.content|richtext %} | ||
{% endwith %} | ||
{% endwith %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
content_manager/templates/content_manager/blocks/tabs.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 i18n wagtailcore_tags %} | ||
<div class="fr-tabs"> | ||
<ul class="fr-tabs__list" | ||
role="tablist" | ||
aria-label="{% translate 'Tabs group' %}"> | ||
{% for subblock in block.value %} | ||
<li role="presentation"> | ||
<button id="tabpanel-{{ block.id }}-{{ forloop.counter }}" | ||
class="fr-tabs__tab fr-icon-checkbox-line fr-tabs__tab--icon-left" | ||
tabindex="{% if forloop.first %}0{% else %}-1{% endif %}" | ||
role="tab" | ||
aria-selected="{% if forloop.first %}true{% else %}false{% endif %}" | ||
aria-controls="tabpanel-{{ block.id }}-{{ forloop.counter }}-panel">{{ subblock.value.title }}</button> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% for subblock in block.value %} | ||
<div id="tabpanel-{{ block.id }}-{{ forloop.counter }}-panel" | ||
class="fr-tabs__panel{% if forloop.first %} fr-tabs__panel--selected{% endif %}" | ||
role="tabpanel" | ||
aria-labelledby="tabpanel-{{ block.id }}-{{ forloop.counter }}" | ||
tabindex="0">{{ subblock.value.content }}</div> | ||
{% endfor %} | ||
</div> |