Skip to content

Commit

Permalink
Add possibility to use bootstrap4.
Browse files Browse the repository at this point in the history
  • Loading branch information
debdolph committed May 28, 2019
1 parent c9d8c4f commit 2bafd1f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions menu/templates/bootstrap4-navbar-submenu.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
{% for item in items %}
{% if item.visible %}
<a class="dropdown-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown-submenu{% endif %}" href="{{ item.url }}">{{ item.title }}
{% if item.children %}
{% with items=item.children template_name='bootstrap-navbar-submenu.html' %}
{% include template_name %}
{% endwith %}
{% endif %}
</a>
{% endif %}
{% endfor %}
</div>
22 changes: 22 additions & 0 deletions menu/templates/bootstrap4-navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% for item in menu %}
{% if item.visible %}
{% if item.separator %}
<li class="divider-vertical"></li>
{% endif %}

<li class="nav-item {% if item.selected %} active{% endif %}{% if item.children %} dropdown{% endif %}" id="top-menu-{{ item.slug }}">
<a href="{{ item.url }}" {% if not item.children %}class=nav-link {% endif%} {% if item.children %} class="nav-link dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"{% endif %}>
{% if item.icon %}
<i class="icon-{{ item.icon }} icon-white"></i>&nbsp;
{% endif %}
<span>{{ item.title }}</span>
{% if item.children %}
&nbsp;<b class="caret"></b>
{% endif %}
</a>
{% if item.children %}
{% include 'bootstrap4-navbar-submenu.html' with items=item.children %}
{% endif %}
</li>
{% endif %}
{% endfor %}

0 comments on commit 2bafd1f

Please sign in to comment.