Skip to content

Commit f5863ee

Browse files
Merge pull request #50048 from gaurav-nelson/template-update-for-rhacs
Add version handling and banner for RHACS
2 parents dbc23bd + 937ea03 commit f5863ee

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

_templates/_page_openshift.html.erb

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<body onload="selectVersion('<%= version %>');">
5959
<%= render("_templates/_topnav.html.erb", :distro_key => distro_key) %>
6060
<%
61-
unsupported_versions = ["3.0", "3.1", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.9", "3.10", "4.1", "4.2", "4.3", "4.4", "4.5"];
61+
unsupported_versions = ["3.0", "3.1", "3.2", "3.3", "3.4", "3.5", "3.6", "3.7", "3.9", "3.10", "4.1", "4.2", "4.3", "4.4", "4.5", "3.65", "3.66", "3.67", "3.68"];
6262
%>
6363
<div class="container">
6464
<button id="hc-open-btn" class="open-btn-sm" onclick="openNav()" aria-label="Open"><span class="fa fa-bars" /></button>
@@ -81,6 +81,16 @@
8181

8282
<% end %>
8383

84+
<% if ((unsupported_versions.include? version) && (distro_key == "openshift-acs")) %>
85+
86+
<span>
87+
<div class="alert alert-danger" role="alert" id="support-alert">
88+
<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/acs/welcome/index.html" style="color: #545454 !important" class="link-primary">latest RHACS docs</a>.
89+
</div>
90+
</span>
91+
92+
<% end %>
93+
8494
<li class="sitename">
8595
<a href="/">
8696
<%= site_name %></a>
@@ -121,7 +131,22 @@
121131
<option value="3.0">3.0</option>
122132
</select>
123133
<% else %>
124-
<%= breadcrumb_root %>
134+
<% if (distro_key == "openshift-acs") %>
135+
<a href="https://docs.openshift.com/acs/<%= version %>/welcome/index.html">
136+
<%= distro %>
137+
</a>
138+
<select id="version-selector" onchange="versionSelector(this);">
139+
<option value="3.71">3.71</option>
140+
<option value="3.70">3.70</option>
141+
<option value="3.69">3.69</option>
142+
<option value="3.68">3.68</option>
143+
<option value="3.67">3.67</option>
144+
<option value="3.66">3.66</option>
145+
<option value="3.65">3.65</option>
146+
</select>
147+
<% else %>
148+
<%= breadcrumb_root %>
149+
<% end %>
125150
<% end %>
126151
</li>
127152
<li class="hidden-xs active">
@@ -131,7 +156,7 @@
131156
<li class="hidden-xs active">
132157
<%= breadcrumb_topic %>
133158
</li>
134-
<% if (distro_key != "openshift-origin" && distro_key != "openshift-aro") %>
159+
<% if (distro_key != "openshift-origin" && distro_key != "openshift-aro" && distro_key != "openshift-acs") %>
135160
<span text-align="right" style="float: right !important">
136161
<a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-enterprise") ? "enterprise-#{version}" : "dedicated-4" %>/<%= repo_path %>"><span class="material-icons-outlined" title="Page history">history</span></a>
137162
<%
@@ -151,6 +176,25 @@
151176
<% end %>
152177
<% end %>
153178
</span>
179+
<% else %>
180+
<% if (distro_key == "openshift-acs") %>
181+
<span text-align="right" style="float: right !important">
182+
<a href="https://github.com/openshift/openshift-docs/commits/<%= (distro_key == "openshift-acs") ? "rhacs-docs-#{version}" : "rhacs-docs" %>/<%= repo_path %>">
183+
<span class="material-icons-outlined" title="Page history">history
184+
</span>
185+
</a>
186+
<% unless (unsupported_versions.include? version) %>
187+
<a href="https://github.com/openshift/openshift-docs/issues/new?title=<%= "[rhacs-docs-#{version}] Issue in file #{repo_path}" %>">
188+
<span class="material-icons-outlined" title="Open an issue">bug_report
189+
</span>
190+
</a>
191+
<a href="javascript: void(0);" onclick="getPDF();">
192+
<span class="material-icons-outlined" title="Download PDF (may take a while for large pages)">picture_as_pdf
193+
</span>
194+
</a>
195+
<% end %>
196+
</span>
197+
<% end %>
154198
<% end %>
155199
</ol>
156200
<div class="row row-offcanvas row-offcanvas-left">

0 commit comments

Comments
 (0)