blob: 334f4d8536d710332202d31dd849a563bdcd3272 (
plain)
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
|
<%
dir = @item.identifier.to_s[%r{(?<=/)[^/]+}]
nav_items_dir = "/_data/#{dir}-nav.yaml"
nav_items_exists = !@items[nav_items_dir].nil?
is_ee_prefixed = !nav_items_exists && dir != 'ce'
nav_items = nav_items_exists ? @items[nav_items_dir] : @items["/_data/default-nav.yaml"]
%>
<nav class="global-nav-content">
<!-- nav sections -->
<% nav_items[:sections].each do |sec| %>
<div class="global-nav-section">
<span class="global-nav-block-top nav-link">
<% section_href = is_ee_prefixed ? "/ee/#{sec[:section_url]}" : "/#{dir}/#{sec[:section_url]}" %>
<a class="global-nav-link level-0 <% if sec[:section_categories] %>has-collapse<% end %> <% if @item.path == "/#{dir}/#{sec[:section_url]}" %>active<% end %>" href="<%= section_href %>">
<%= sec[:section_title] %>
<% if sec[:ee_only] %>
<span class="badges-drop global-nav-badges" data-toggle="tooltip" data-placement="top" title="Available in <%= sec[:ee_tier] %>"><i class="fa fa-info-circle" aria-hidden="true"></i></span>
<% end %><!-- end of if sec[:ee_only] -->
</a>
<div class="section-title <% if sec[:section_categories] %>collapse-toggle<% end %> <% if @item.path == "/#{dir}/#{sec[:section_url]}" %>active<% else %>collapsed<% end %>" data-toggle="collapse" aria-expanded="false" data-target="#<%= sec[:section_title].gsub(/[\s\/\(\)]/, '') %>"></div>
</span>
<!-- nav categories -->
<% if sec[:section_categories] %>
<div class="collapse <% if @item.path == "/#{dir}/#{sec[:section_url]}" %>show<% end %>" id="<%= sec[:section_title].gsub(/[\s\/\(\)]/, '') %>">
<% sec[:section_categories].each do |cat| %>
<span class="global-nav-cat nav-link">
<% if cat[:external_url] %>
<a class="global-nav-link level-1 <% if cat[:docs] %>has-collapse<% end %>" href="<%= cat[:category_url] %>" target="_blank">
<%= cat[:category_title] %>
</a>
<% else %>
<% category_href = is_ee_prefixed ? "/ee/#{cat[:category_url]}" : "/#{dir}/#{cat[:category_url]}" %>
<a class="global-nav-link level-1 <% if cat[:docs] %>has-collapse<% end %> <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>active<% end %>" href="<%= category_href %>">
<%= cat[:category_title] %>
<% if cat[:ee_only] %>
<span class="badges-drop global-nav-badges" data-toggle="tooltip" data-placement="top" title="Available in <%= cat[:ee_tier] %>"><i class="fa fa-info-circle" aria-hidden="true"></i></span>
<% end %><!-- end of if cat[:ee_only] -->
</a>
<% end %><!-- end of if cat[:external_url] -->
<div class="<% if cat[:docs] %>collapse-toggle<% end %> <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>active<% else %>collapsed<% end %>" data-toggle="collapse" aria-expanded="false" data-target="#<%= cat[:category_title].gsub(/[\s\/\(\)]/, '') %>"></div>
</span>
<!-- nav docs -->
<% if cat[:docs] %>
<div class="collapse <% if @item.path == "/#{dir}/#{cat[:category_url]}" %>show<% end %>" id="<%= cat[:category_title].gsub(/[\s\/\(\)]/, '') %>">
<% cat[:docs].each do |doc| %>
<span class="nav-link">
<% if doc[:external_url] %>
<a class="global-nav-link level-2" href="<%= doc[:doc_url] %>" target="_blank">
<%= doc[:doc_title] %>
</a>
<% else%>
<% docs_href = is_ee_prefixed ? "/ee/#{doc[:doc_url]}" : "/#{dir}/#{doc[:doc_url]}" %>
<a class="global-nav-link level-2 <% if @item.path == "/#{dir}/#{doc[:doc_url]}" %>active<% end %>" href="<%= docs_href %>">
<%= doc[:doc_title] %>
<% if doc[:ee_only] %>
<span class="badges-drop global-nav-badges" data-toggle="tooltip" data-placement="top" title="Available in <%= doc[:ee_tier] %>"><i class="fa fa-info-circle" aria-hidden="true"></i></span>
<% end %><!-- end if doc[:ee_only] -->
</a>
<% end %><!-- end of if doc[:external_url] -->
</span>
<% end %><!-- end of cat[:docs] -->
</div>
<% end %><!-- end of if cat[:docs].nil? -->
<% end %><!-- end of sec[:section_categories] -->
</div><!-- end of div class="collapse" -->
<% end %><!-- end of if sec[:section_categories].nil? -->
</div><!-- end of div class="global-nav-section" -->
<% end %><!-- end of nav_items[:sections] -->
</nav>
|