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:
authorVasilii Iakliushin <viakliushin@gitlab.com>2021-01-12 18:52:03 +0300
committerVasilii Iakliushin <viakliushin@gitlab.com>2021-01-12 18:52:03 +0300
commitfd7ff36b13975408591f24c3e85ceab2969582e3 (patch)
tree30382d14c621589b3b9ef08bed351f4cd2bdb8f6 /layouts/partials
parenta75621454ed1df6425afa7ff7a08d44b350e92a6 (diff)
Remove previous versions from dropdown for omnibus packages
We discovered that dropdown displays previous versions when deployed in Omnibus. Changes: * Extract common functionality into a partial or a helper * Add `display_previous_versions?` method to hide previous versions
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/versions_list.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/layouts/partials/versions_list.html b/layouts/partials/versions_list.html
new file mode 100644
index 00000000..549f1d13
--- /dev/null
+++ b/layouts/partials/versions_list.html
@@ -0,0 +1,20 @@
+<!--
+ 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 %>