Skip to content

Commit

Permalink
add bootstrap5 templates
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrDlouhy committed Aug 5, 2021
1 parent a2d77e9 commit 325000a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions sitetree/templates/sitetree/menu_bootstrap5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% load sitetree %}
<ul class="navbar-nav mr-auto {{ extra_class }}">
{% for item in sitetree_items %}
<li class="nav-item {% if item.has_children %}dropdown{% endif %}">
<a href="{% if item.has_children %}#{% else %}{% sitetree_url for item %}{% endif %}" class="nav-link {% if item.is_current or item.in_current_branch %}active{% endif %} {% if item.has_children %}dropdown-toggle" aria-haspopup="true" id="navitem-{{ item.id }}" data-bs-toggle="dropdown{% endif %}">
{{ item.title_resolved }}
</a>
{% if item.has_children %}
{% sitetree_children of item for menu template "sitetree/menu_bootstrap5_dropdown.html" %}
{% endif %}
</li>
{% endfor %}
</ul>
6 changes: 6 additions & 0 deletions sitetree/templates/sitetree/menu_bootstrap5_dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% load sitetree %}
<div class="dropdown-menu" aria-labelledby="navitem-{{ item.id }}">
{% for item in sitetree_items %}
<a class="dropdown-item {% if item.is_current or item.in_current_branch %}active{% endif %}" href="{% sitetree_url for item %}" {% if item.hint %}title="{{ item.hint }}"{% endif %}>{{ item.title_resolved }}</a>
{% endfor %}
</div>

0 comments on commit 325000a

Please sign in to comment.