Skip to content

Commit d6c2c4b

Browse files
authored
Merge pull request #65860 from shipsing/builds-version-selector
builds-version-selector: add version selector for Builds
2 parents 60a2f3d + d02cee7 commit d6c2c4b

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

_templates/_page_openshift.html.erb

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
unsupported_versions_gitops = [];
5454

55+
unsupported_versions_builds = [];
56+
5557
unsupported_versions_origin = ["3.0", "3.1", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.9", "3.10", "3.11", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "4.10", "4.11", "4.12"];
5658

5759
%>
@@ -115,6 +117,16 @@
115117

116118
<% end %>
117119

120+
<% if ((unsupported_versions_builds.include? version) && (distro_key == "openshift-builds")) %>
121+
122+
<span>
123+
<div class="alert alert-danger" role="alert" id="support-alert">
124+
<strong>You are viewing documentation for a release that is no longer maintained.</strong> To view the documentation for the most recent version, see the <a href="https://docs.openshift.com/builds/latest/about/overview-openshift-builds.html" style="color: #545454 !important" class="link-primary">latest Builds docs</a>.
125+
</div>
126+
</span>
127+
128+
<% end %>
129+
118130

119131
<% if ((unsupported_versions_gitops.include? version) && (distro_key == "openshift-gitops")) %>
120132

@@ -215,6 +227,13 @@
215227
<option value="1.11">1.11</option>
216228
<option value="1.10">1.10</option>
217229
</select>
230+
<% elsif (distro_key == "openshift-builds") %>
231+
<a href="https://docs.openshift.com/builds/<%= version %>/about/overview-openshift-builds.html">
232+
<%= distro %>
233+
</a>
234+
<select id="version-selector" onchange="versionSelector(this);">
235+
<option value="1.0">1.0</option>
236+
</select>
218237
<% elsif (distro_key == "openshift-gitops") %>
219238
<a href="https://docs.openshift.com/gitops/<%= version %>/release_notes/gitops-release-notes.html">
220239
<%= distro %>
@@ -264,7 +283,7 @@
264283
<li class="hidden-xs active">
265284
<%= breadcrumb_topic %>
266285
</li>
267-
<% if (distro_key != "openshift-origin" && distro_key != "openshift-aro" && distro_key != "openshift-acs" && distro_key != "openshift-serverless" && distro_key != "openshift-gitops" && distro_key != "openshift-pipelines") %>
286+
<% if (distro_key != "openshift-origin" && distro_key != "openshift-aro" && distro_key != "openshift-acs" && distro_key != "openshift-serverless" && distro_key != "openshift-gitops" && distro_key != "openshift-pipelines" && distro_key != "openshift-builds") %>
268287
<span text-align="right" style="float: right !important">
269288
<a href="https://github.com/openshift/openshift-docs/commits/<%=
270289
((distro_key == "openshift-enterprise") ? "enterprise-#{version}"
@@ -345,6 +364,22 @@
345364
</a>
346365
<% end %>
347366
</span>
367+
<% elsif (distro_key == "openshift-builds") %>
368+
<span text-align="right" style="float: right !important">
369+
<a href="https://github.com/openshift/build-docs/commits/<%= (distro_key == "openshift-builds") ? "build-docs-#{version}" : "build-docs" %>/<%= repo_path %>">
370+
<span class="material-icons-outlined" title="Page history">history
371+
</span>
372+
</a>
373+
<% unless (unsupported_versions_builds.include? version) %>
374+
<a href="https://issues.redhat.com/secure/CreateIssueDetails!init.jspa?pid=12317820&issuetype=1&components=12332358&priority=4&summary=<%= "[build-docs-#{version}]+Issue+in+file+#{repo_path}"%>">
375+
<span class="material-icons-outlined" title="Open an issue">bug_report
376+
</span>
377+
</a>
378+
<a href="javascript: void(0);" onclick="window.print()">
379+
<span class="material-icons-outlined" title="Print page (Save as PDF)">picture_as_pdf</span>
380+
</a>
381+
<% end %>
382+
</span>
348383
<% elsif (distro_key == "openshift-gitops") %>
349384
<span text-align="right" style="float: right !important">
350385
<a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-gitops") ? "gitops-docs-#{version}" : "gitops-docs" %>/<%= repo_path %>">
@@ -444,6 +479,7 @@
444479
'openshift-acs' : ['docs_acs', version],
445480
'openshift-serverless' : ['docs_serverless', version],
446481
'openshift-pipelines' : ['docs_pipelines', version],
482+
'openshift-builds' : ['docs_builds', version],
447483
'openshift-gitops' : ['docs_gitops', version]
448484
};
449485

0 commit comments

Comments
 (0)