forked from prebid/prebid.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleft_nav.html
More file actions
168 lines (132 loc) · 7.07 KB
/
Copy pathleft_nav.html
File metadata and controls
168 lines (132 loc) · 7.07 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<div class="list-group">
<!-- setup helper variables -->
{% assign is_active_class = 'is-active' %}
{% assign base_item_classes = "list-group-item list-group-item-action flex-column align-items-start" | split: " " %}
{% assign base_submenu_classes = "collapse sidebar-submenu" | split: " " %}
<!--get all sections-->
{% assign arrSideBarSections = site.data.sidebar | where: "isSectionHeader", "1" %}
{% for sectionHeader in arrSideBarSections %} <!-- othello -->
{% assign item_classes = base_item_classes | push: 'list-group-item--level-0' %}
{% if page.sidebarType == sectionHeader.sbSecId || page.layout == bidder %}
{% assign item_classes = item_classes | push: is_active_class %}
{% assign submenu_classes = base_submenu_classes | push: is_active_class %}
{% else %}
{% assign item_classes = item_classes %}
{% assign submenu_classes = base_submenu_classes %}
{% endif %}
<a href="#{{sectionHeader.sbCollapseId}}" data-toggle="collapse" aria-expanded="false" class="{{ item_classes | join: " " }}">
<span class="menu-collapsed pb-sidebar-section pb-section-title">{{sectionHeader.sectionTitle}}</span>
</a>
{% assign sectionIdx = forloop.index0 %}
{% assign arrSectionItems = site.data.sidebar | where: "sbSecId", sectionIdx %}
<!--get all sub section headers-->
{% assign arrSectionHeaders = arrSectionItems | where: "isHeader", "1" %}
<div id={{sectionHeader.sbCollapseId}} class="{{ submenu_classes | join: " " }}">
{% if arrSectionHeaders.size == 1 || page.layout == bidder %} <!-- hamlet -->
<!--go through each section-->
{% for sectionItem in arrSectionItems %}
<!--display subsection headers-->
{% if sectionItem.isSectionHeader == 0 and sectionItem.isHeader == 0 %}
<!-- check to see if we are on this page-->
<!--display subsection items with links-->
{% assign isPage = 0 %}
{% if sectionItem.link == page.url %}
{% assign isPage = 1 %}
{% endif %}
<a href="{{sectionItem.link}}" class="list-group-item list-group-item-action list-group-item--level-1">
{% if isPage == 1 %}
<span class="menu-collapsed pb-nav-item is-active">{{sectionItem.title}}</span>
{% else %}
<span class="menu-collapsed pb-nav-item">{{sectionItem.title}}</span>
{% endif %}
</a>
{% endif %}
{% endfor %}
{% else %} <!-- /hamlet -->
<!--go through each section-->
{% for thisSectionHeader in arrSectionHeaders %} <!-- romeo -->
{% assign arrSubItems = arrSectionItems | where: "subgroup", thisSectionHeader.subgroup | where: "isHeader", "0" %}
{% assign isOpen = 0 %}
{% for thisSubItem in arrSubItems %}
{% if thisSubItem.link == page.url %}
{% assign isOpen = 1 %}
{% elsif page.layout == "api_prebidjs" and thisSubItem.link == "/dev-docs/publisher-api-reference.html" %}
{% assign isOpen = 1 %}
{% elsif page.layout == "bidder" and thisSubItem.link == "/dev-docs/bidders.html" %}
{% assign isOpen = 1 %}
{% endif %}
{% endfor %}
{% assign item_classes = base_item_classes | push: 'list-group-item--level-1' %}
{% if isOpen == 1 %}
{%assign item_classes = item_classes | push: 'is-active' %}
{% endif %}
<a href="#{{thisSectionHeader.headerId}}" data-toggle="collapse" aria-expanded="false" class="{{ item_classes | join: " " }}">
<span class="menu-collapsed pb-sidebar-section pb-section-subtitle">{{thisSectionHeader.title}}</span>
</a>
<!--this is collapsed if not matching url of page-->
{% if isOpen == 1 %}
<div id={{thisSectionHeader.headerId}} class="collapse sidebar-submenu is-active">
{% else %}
<div id={{thisSectionHeader.headerId}} class="collapse sidebar-submenu">
{% endif %}
{% for thisSubItem in arrSubItems %} <!-- mercutio -->
{% assign subsectionIdx = forloop.index0 %}
{% assign lastIdx = arrSubItems.size | minus: 1 %}
{% assign isPage = 0 %}
{% if thisSubItem.link == page.url %}
{% assign isPage = 1 %}
{% elsif page.layout == "api_prebidjs" and thisSubItem.link == "/dev-docs/publisher-api-reference.html" %}
{% assign isPage = 1 %}
{% elsif page.layout == "bidder" and thisSubItem.link == "/dev-docs/bidders.html" %}
{% assign isPage = 1 %}
{% endif %}
{% assign item_classes = base_item_classes | push: 'list-group-item--level-2' %}
{% if isPage == 1 %}
{% assign item_classes = item_classes | push: 'is-active' %}
{% endif %}
<!--display subsection items with links-->
{% if subsectionIdx == 0 % || thisSubItem.isCatHeader == 1 %}
<!--video example categories should not link-->
{% if thisSubItem.isCatHeader == 1 %}
<span class="{{ item_classes | join: " " }}">
<span class="menu-collapsed pb-nav-item pb-first-item pb-nav-item--title">{{thisSubItem.title}}</span>
</span>
{% else %}
<a href="{{thisSubItem.link}}" class="{{ item_classes | join: " " }}">
{% if isPage == 1 %}
<span class="menu-collapsed pb-nav-item pb-first-item is-active">{{thisSubItem.title}}</span>
{% else %}
<span class="menu-collapsed pb-nav-item pb-first-item">{{thisSubItem.title}}</span>
{% endif %}
</a>
{% endif %}
{% elsif subsectionIdx == lastIdx %}
<a href="{{thisSubItem.link}}" class="{{ item_classes | join: " " }}">
{% if isPage == 1 %}
<span class="menu-collapsed pb-nav-item pb-last-item is-active">{{thisSubItem.title}}</span>
{% else %}
<span class="menu-collapsed pb-nav-item pb-last-item">{{thisSubItem.title}}</span>
{% endif %}
</a>
{% else %}
{% if thisSubItem.isCatHeader == 1 %}
<span class="{{ item_classes | join: " " }}">
<span class="menu-collapsed pb-nav-item pb-nav-item--title">{{thisSubItem.title}}</span>
</span>
{% else %}
<a href="{{thisSubItem.link}}" class="{{ item_classes | join: " " }}">
{% if isPage == 1 %}
<span class="menu-collapsed pb-nav-item is-active">{{thisSubItem.title}}</span>
{% else %}
<span class="menu-collapsed pb-nav-item">{{thisSubItem.title}}</span>
{% endif %}
</a>
{% endif %}
{% endif %}
{% endfor %} <!-- /mercutio -->
</div> {% comment %} Closes the divs that are started in conditional {% endcomment %}
{% endfor %} <!-- /romeo -->
{% endif %} <!-- /hamlet -->
</div> {% comment %} Closes the divs that are started in conditional {% endcomment %}
{% endfor %} <!-- /othello -->
</div>