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: 1d01ed1c1d23271f320cb1ec1ed963f0e1a72e97 (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
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
<% 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 %>
        </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 %>
                  </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| %>
                    <% doc_uuid = SecureRandom.uuid %>
                      <span class="nav-link">
                        <% if doc.external_url %>
                          <a class="global-nav-link level-2 <%= doc.has_children? ? 'has-collapse' : '' %>" href="<%= doc.url %>" target="_blank">
                            <%= doc.title %>
                          </a>
                        <% else%>
                          <a class="global-nav-link level-2 <%= doc.has_children? ? 'has-collapse' : '' %> <%= navigation.show_element?(doc) ? 'active' : '' %>" href="<%= navigation.element_href(doc) %>">
                            <%= doc.title %>
                          </a>
                        <% end %><!-- end of if doc[:external_url] -->
                        <div class="<%= doc.has_children? ? 'collapse-toggle' : '' %> <%= navigation.show_element?(doc) ? 'active' : 'collapsed' %>" data-toggle="collapse" aria-expanded="false" data-target="#doc_<%= doc_uuid %>"></div>
                      </span>

                      <!-- nav sub docs -->
                      <% if doc.has_children? %>
                        <div class="collapse <%= navigation.show_element?(doc) ? 'show' : '' %>" id="doc_<%= doc_uuid %>">
                          <% doc.children.each do |doc| %>
                            <% doc_uuid = SecureRandom.uuid %>
                          <span class="nav-link">
                            <% if doc.external_url %>
                              <a class="global-nav-link level-3 <%= doc.has_children? ? 'has-collapse' : '' %>" href="<%= doc.url %>" target="_blank">
                                <%= doc.title %>
                              </a>
                            <% else%>
                              <a class="global-nav-link level-3 <%= doc.has_children? ? 'has-collapse' : '' %> <%= navigation.show_element?(doc) ? 'active' : '' %>" href="<%= navigation.element_href(doc) %>">
                                <%= doc.title %>
                              </a>
                            <% end %><!-- end of if doc[:external_url] -->
                            <div class="<%= doc.has_children? ? 'collapse-toggle' : '' %> <%= navigation.show_element?(doc) ? 'active' : 'collapsed' %>" data-toggle="collapse" aria-expanded="false" data-target="#doc_<%= doc_uuid %>"></div>
                          </span>

                          <!-- nav sub sub docs -->
                          <% if doc.has_children? %>
                            <div class="collapse <%= navigation.show_element?(doc) ? 'show' : '' %>" id="doc_<%= doc_uuid %>">
                              <% doc.children.each do |doc| %>
                              <span class="nav-link">
                                <% if doc.external_url %>
                                  <a class="global-nav-link level-4" href="<%= doc.url %>" target="_blank">
                                    <%= doc.title %>
                                  </a>
                                <% else%>
                                  <a class="global-nav-link level-4 <%= navigation.show_element?(doc) ? 'active' : '' %>" href="<%= navigation.element_href(doc) %>">
                                    <%= doc.title %>
                                  </a>
                                <% end %><!-- end of if doc[:external_url] -->
                              </span>
                              <% end %><!-- end of docs[:doc] -->
                            </div>
                          <% end %><!-- end of if doc[:docs] -->
                          <% end %><!-- end of docs[:doc] -->
                        </div>
                      <% end %><!-- end of if doc[:docs] -->
                  <% end %><!-- end of cat[:docs] -->
                </div>
              <% end %><!-- end of if cat[:docs].nil? -->
          <% end %><!-- end of sec[:section_categories] -->
        </div>
      <% end %><!-- end of if sec[:section_categories].nil? -->
    </div>
  <% end %><!-- end of nav_items[:sections] -->
</nav>