mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-10 05:14:05 -05:00
It's not valid HTML for <ol> or <ul> tags to have <ol> or <ul>'s as direct children. See: https://www.w3.org/TR/html52/grouping-content.html#the-ol-element https://www.w3.org/TR/html52/grouping-content.html#the-ul-element
41 lines
1.2 KiB
HTML
41 lines
1.2 KiB
HTML
{% macro sub_navigation_item(item) %}
|
|
<li class="sub-navigation__item {% if item['link'] == request.endpoint %} sub-navigation__item--active {% endif %}"
|
|
itemprop="itemListElement"
|
|
itemscope
|
|
itemtype="http://schema.org/ListItem"
|
|
>
|
|
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for(item['link']) }}" itemprop="item">
|
|
<span itemprop="name">{{item['name']}}</span>
|
|
</a>
|
|
{% if caller %}
|
|
{{ caller() }}
|
|
{% endif %}
|
|
</li>
|
|
{% endmacro %}
|
|
|
|
{% macro sub_navigation_item_sub_navigation(item) %}
|
|
<ol itemscope itemtype="http://schema.org/ItemList">
|
|
{% for sub_item in item.sub_navigation_items %}
|
|
{{ sub_navigation_item(sub_item) }}
|
|
{% endfor %}
|
|
</ol>
|
|
{% endmacro %}
|
|
|
|
{% macro sub_navigation(
|
|
item_set
|
|
) %}
|
|
<nav class="sub-navigation">
|
|
<ol itemscope itemtype="http://schema.org/ItemList">
|
|
{% for item in item_set %}
|
|
{% if item.sub_navigation_items %}
|
|
{% call sub_navigation_item(item) %}
|
|
{{ sub_navigation_item_sub_navigation(item) }}
|
|
{% endcall %}
|
|
{% else %}
|
|
{{ sub_navigation_item(item) }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</ol>
|
|
</nav>
|
|
{% endmacro %}
|