Skip to content

Commit d02cee7

Browse files
committed
builds-version-selector: add version selector for Builds
1 parent f39867b commit d02cee7

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

@@ -214,6 +226,13 @@
214226
<option value="1.11">1.11</option>
215227
<option value="1.10">1.10</option>
216228
</select>
229+
<% elsif (distro_key == "openshift-builds") %>
230+
<a href="https://docs.openshift.com/builds/<%= version %>/about/overview-openshift-builds.html">
231+
<%= distro %>
232+
</a>
233+
<select id="version-selector" onchange="versionSelector(this);">
234+
<option value="1.0">1.0</option>
235+
</select>
217236
<% elsif (distro_key == "openshift-gitops") %>
218237
<a href="https://docs.openshift.com/gitops/<%= version %>/release_notes/gitops-release-notes.html">
219238
<%= distro %>
@@ -262,7 +281,7 @@
262281
<li class="hidden-xs active">
263282
<%= breadcrumb_topic %>
264283
</li>
265-
<% 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") %>
284+
<% 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") %>
266285
<span text-align="right" style="float: right !important">
267286
<a href="https://github.com/openshift/openshift-docs/commits/<%=
268287
((distro_key == "openshift-enterprise") ? "enterprise-#{version}"
@@ -343,6 +362,22 @@
343362
</a>
344363
<% end %>
345364
</span>
365+
<% elsif (distro_key == "openshift-builds") %>
366+
<span text-align="right" style="float: right !important">
367+
<a href="https://github.com/openshift/build-docs/commits/<%= (distro_key == "openshift-builds") ? "build-docs-#{version}" : "build-docs" %>/<%= repo_path %>">
368+
<span class="material-icons-outlined" title="Page history">history
369+
</span>
370+
</a>
371+
<% unless (unsupported_versions_builds.include? version) %>
372+
<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}"%>">
373+
<span class="material-icons-outlined" title="Open an issue">bug_report
374+
</span>
375+
</a>
376+
<a href="javascript: void(0);" onclick="window.print()">
377+
<span class="material-icons-outlined" title="Print page (Save as PDF)">picture_as_pdf</span>
378+
</a>
379+
<% end %>
380+
</span>
346381
<% elsif (distro_key == "openshift-gitops") %>
347382
<span text-align="right" style="float: right !important">
348383
<a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-gitops") ? "gitops-docs-#{version}" : "gitops-docs" %>/<%= repo_path %>">
@@ -442,6 +477,7 @@
442477
'openshift-acs' : ['docs_acs', version],
443478
'openshift-serverless' : ['docs_serverless', version],
444479
'openshift-pipelines' : ['docs_pipelines', version],
480+
'openshift-builds' : ['docs_builds', version],
445481
'openshift-gitops' : ['docs_gitops', version]
446482
};
447483

0 commit comments

Comments
 (0)