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

versions_dropdown.html « layouts - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3d86bd12399fafbd07c9cc6e4ae26bb20d5b3af2 (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
98
99
<%
latest_stable = @items['/_data/versions.yaml'][:online].first
next_major = latest_stable.split('.').first
next_minor = "#{latest_stable.split('.').last.to_i + 1}"
next_version = "#{next_major}.#{next_minor}"
dotcom = "GitLab.com (#{next_version}-pre)"
%>
<!-- versions dropdown-->
<div class="choose-version">
Version
</div>
<div class="dropdown">
  <a role="button" class="btn btn-versions dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="versions" href="#">
    <!--
      Name the label dropdown after the release version so that you know
      which version you're browsing. For `/archives` show 'Archives' since
      they're supposed to be versionless.
      If we build on the default and stable branches (versions), show the following
      name in the drodown menu:
        - GitLab.com if the default branch.
        - The branch name otherwise.
      For local development and review apps, show "Versions".
    -->
    <% if archives? %>
    Archives
    <% else %>
      <% if is_production? %>
        <% if ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] %>
          <%= dotcom %>
        <% else %>
          <%= ENV['CI_COMMIT_REF_NAME'] %>
        <% end %>
      <% else %>
        Versions
      <% end %>
    <% end %>
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu versions-menu" aria-labelledby="versions">
    <li>
      <a<%= active_dropdown(ENV['CI_DEFAULT_BRANCH']) %> href='<%= @item.identifier.without_ext + '.html' %>' class="versions-tooltip"><%= dotcom %>
        <i class="fa fa-question-circle-o" aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="Latest pre-release version of GitLab, with features available or about to become available on GitLab.com. For self-managed GitLab installations, select your version number as listed at your GitLab instance's /help URL."></i>
      </a>
    </li>
    <!-- Start of online versions -->
    <li class="dropdown-divider"></li>
    <% @items['/_data/versions.yaml'][:online].each do |version| %>
      <!--
        If we are on the archives page, the link here is hardcoded to always
        point to `/archives/`. If you visit https://docs.gitlab.com/archives/
        and select a version from the dropdown, that version's archives page
        will be shown. We want to always show the latest archives page as it
        contains all current versions and offline archives.
      -->
      <% if archives? %>
        <li>
          <a href='/archives/'>
            <%= version %>
          </a>
        </li>
      <% else %>
        <li>
          <a<%= active_dropdown(version) %> href='/<%= version %><%= @item.identifier.without_ext + '.html' %>'>
            <%= version %>
          </a>
        </li>
      <% end %>
    <% end %>
    <!-- End of online versions -->
    <!-- Start of last major versions -->
    <li class="dropdown-divider"></li>
    <% @items['/_data/versions.yaml'][:previous_majors].each do |version| %>
      <!--
        If we are on the archives page, the link here is hardcoded to always
        point to `/archives/`. If you visit https://docs.gitlab.com/archives/
        and select a version from the dropdown, that version's archives page
        will be shown. We want to always show the latest archives page as it
        contains all current versions and offline archives.
      -->
      <% if archives? %>
        <li>
          <a href='/archives/'>
            <%= version %>
          </a>
        </li>
      <% else %>
        <li>
          <a<%= active_dropdown(version) %> href='/<%= version %><%= @item.identifier.without_ext + '.html' %>'>
            <%= version %>
          </a>
        </li>
      <% end %>
    <% end %>
    <!-- End of last major versions -->
    <li class="dropdown-divider"></li>
    <li><a<%= active_dropdown('archives') %> href='/archives/'>Archives</a></li>
  </ul>
</div>
<!-- versions dropdown-->