Welcome to mirror list, hosted at ThFree Co, Russian Federation.

global_nav.html « layouts - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6e94d93e9890d2787ab925dd86e6f90299fda3c4 (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
<% navigation = Gitlab::Navigation.new(@items, @item) %>
<nav class="global-nav-content">
  <!-- nav sections -->
  <% navigation.children.each do |sec| %>
    <% sec_uuid = SecureRandom.uuid %>
    <div class="global-nav-section">
      <span class="global-nav-block-top nav-link">
        <a class="global-nav-link level-0 <%= sec.has_children? ? 'has-collapse' : '' %> <%= navigation.show_element?(sec) ? 'active' : '' %>" href="<%= navigation.element_href(sec) %>">
          <%= sec.title %>
          <%= navigation.optional_ee_badge(sec) %>
        </a>
        <div class="section-title <%= sec.has_children? ? 'collapse-toggle': '' %> <%= navigation.show_element?(sec) ? 'active' : 'collapsed' %>" data-toggle="collapse" aria-expanded="false" data-target="#sec_<%= sec_uuid %>"></div>
      </span>

      <!-- nav categories -->
      <% if sec.has_children? && sec.enabled  %>
      <div class="collapse <%= navigation.show_element?(sec) ? 'show' : '' %>" id="sec_<%= sec_uuid %>">
        <% sec.children.each do |cat| %>
          <% cat_uuid = SecureRandom.uuid %>
        <span class="global-nav-cat nav-link">
          <% if cat.external_url %>
          <a class="global-nav-link level-1 <%= cat.has_children? ? 'has-collapse' : '' %>" href="<%= cat.url %>" target="_blank">
            <%= cat.title %>
          </a>
          <% else %>
          <a class="global-nav-link level-1 <%= cat.has_children? ? 'has-collapse' : '' %> <%= navigation.show_element?(cat) ? 'active' : '' %>" href="<%= navigation.element_href(cat) %>">
                <%= cat.title %>
                <%= navigation.optional_ee_badge(cat) %>
              </a>
            <% end %><!-- end of if cat[:external_url] -->
            <div class="<%= cat.has_children? ? 'collapse-toggle' : '' %> <%= navigation.show_element?(cat) ? 'active' : 'collapsed' %>" data-toggle="collapse" aria-expanded="false" data-target="#cat_<%= cat_uuid %>"></div>
          </span>

          <!-- nav docs -->
          <% if cat.has_children? %>
            <div class="collapse <%= navigation.show_element?(cat) ? 'show' : '' %>" id="cat_<%= cat_uuid %>">
            <% cat.children.each do |doc| %>
              <span class="nav-link">
                <% if doc.external_url %>
                  <a class="global-nav-link level-2" href="<%= doc.url %>" target="_blank">
                    <%= doc.title %>
                  </a>
                <% else%>
                  <a class="global-nav-link level-2 <%= navigation.show_element?(doc) ? 'active' : '' %>" href="<%= navigation.element_href(doc) %>">
                    <%= doc.title %>
                    <%= navigation.optional_ee_badge(doc) %>
                  </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>