-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathmenu.html.twig
More file actions
99 lines (91 loc) · 3.63 KB
/
menu.html.twig
File metadata and controls
99 lines (91 loc) · 3.63 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{% if depth == 0 %}
{% if entry.children.count > 0 %}
{% for child in entry.children %}
{% include 'components/menu-entry.html.twig' with {
title: entry.name|shortFQSEN ~ ' ' ~ child.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ loop.index,
expanded: true,
entry: child,
} %}
{% endfor %}
{% endif %}
{% else %}
{% set index = 0 %}
{% if entry.children.count > 0 %}
{% if depth > 1 %}
<label class="md-nav__list-title md-nav__list-title--namespaces">
Namespaces
</label>
{% endif %}
<ul class="md-nav__list">
{% for child in entry.children %}
{% include 'components/menu-entry.html.twig' with {
title: child.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ index,
entry: child,
expanded: false,
icon: 'folder.svg',
type: 'namespace',
} %}
{% set index = index + 1 %}
{% endfor %}
</ul>
{% endif %}
{% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
{% if depth > 1 %}
<label class="md-nav__list-title">
Interfaces, classes, traits, and enums
</label>
{% endif %}
<ul class="md-nav__list">
{% if entry.interfaces[0] is defined %}
{% for element in entry.interfaces|sort_asc %}
{% include 'components/menu-entry.html.twig' with {
title: element.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ index,
entry: element,
expanded: false,
icon: 'file.svg',
} %}
{% set index = index + 1 %}
{% endfor %}
{% endif %}
{% if entry.classes[0] is defined %}
{% for element in entry.classes|sort_asc %}
{% include 'components/menu-entry.html.twig' with {
title: element.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ index,
entry: element,
expanded: false,
icon: 'file.svg',
} %}
{% set index = index + 1 %}
{% endfor %}
{% endif %}
{% if entry.traits[0] is defined %}
{% for element in entry.traits|sort_asc %}
{% include 'components/menu-entry.html.twig' with {
title: element.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ index,
entry: element,
expanded: false,
icon: 'file.svg',
} %}
{% set index = index + 1 %}
{% endfor %}
{% endif %}
{% if entry.enums[0] is defined %}
{% for element in entry.enums|sort_asc %}
{% include 'components/menu-entry.html.twig' with {
title: element.name|shortFQSEN,
nav_id: nav_id ~ '-' ~ index,
entry: element,
expanded: false,
icon: 'file.svg',
} %}
{% set index = index + 1 %}
{% endfor %}
{% endif %}
</ul>
{% endif %}
{% endif %}