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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2018-10-23 17:53:28 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-10-24 11:17:40 +0300
commit9e2c92296c3aaef571647a3c1f7db0c85bd92963 (patch)
treedd4d86e6847cc0fb813c423efcaf1ea8fb0141fd
parent16fefe6be9f78e3f93185613fa0dea5fec3f686c (diff)
MVC implementation of sticky versions in versions dropdown
We check the CI_COMMIT_REF_NAME when the site is built and apply it to the versions dropdown. Example: For 10.4, the entire site will have 10.4 always displayed in the dropdown, except for the archives page which should always point to the most recent archives and thus its name is just 'Versions' (we don't care about the version).
-rw-r--r--layouts/versions_dropdown.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/versions_dropdown.html b/layouts/versions_dropdown.html
index 0088f50b..739b1eec 100644
--- a/layouts/versions_dropdown.html
+++ b/layouts/versions_dropdown.html
@@ -1,7 +1,15 @@
<!-- versions dropdown-->
<div class="dropdown">
<a role="button" class="btn btn-versions dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="versions">
+ <!--
+ Name the label dropdown after the release version so that you know
+ which version you're browsing. For `/archives` show 'Versions'.
+ -->
+ <% if @item.identifier.to_s.split('/')[1] == 'archives.html' %>
Versions
+ <% else %>
+ <%= ENV['CI_COMMIT_REF_NAME'] %>
+ <% end %>
<span class="caret"></span>
</a>
<ul class="dropdown-menu versions-menu" aria-labelledby="versions">