forked from saleor/saleor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.html
49 lines (47 loc) · 1.78 KB
/
menu.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% url 'home' as home_url %}
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% load get_menu_item_name from shop %}
<ul class="menu {% if horizontal %}nav mb-4 mb-md-0{% endif %}{% if request.get_full_path == home_url %} no-border{% endif %}">
{% for item in menu_items %}
{% with children=item.child_items %}
<li class="{% if horizontal %}nav-item{% endif %} {% if children %}nav-item__dropdown{% endif %} menu__item">
<a class="{% if horizontal %}nav-link{% endif %}" href="{{ item.url }}">
{% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=item %}
</a>
{% if children %}
<div class="{% if horizontal %}nav-item__dropdown-content{% else %}nav-item__submenu{% endif %}">
<div class="container">
<ul>
{% for child in children %}
<li>
<a href="{{ child.url }}">
{% if horizontal %}
<strong>{% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=child %}</strong>
{% else %}
{% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=child %}
{% endif %}
</a>
{% with grandchildren=child.child_items %}
{% if grandchildren %}
<ul>
{% for grandchild in grandchildren %}
<li>
<a href="{{ grandchild.url }}">
{% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=grandchild %}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</li>
{% endwith %}
{% endfor %}
</ul>