Skip to content

Commit

Permalink
Update docs-nav.html (#3082)
Browse files Browse the repository at this point in the history
(cherry picked from commit 43a61a2)

Co-authored-by: DjP-iX <[email protected]>
  • Loading branch information
bugclerk and DjP-iX authored Sep 25, 2024
1 parent c787ad4 commit 9a62c7f
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions layouts/partials/docs-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<div class="truenas-navmenudropdown" id="productDropdown">
<div class="truenas-dropdown-item" onclick="selectProduct('TrueNAS CORE')" data-id="core">TrueNAS CORE</div>
<div class="truenas-dropdown-item" onclick="selectProduct('TrueNAS SCALE')" data-id="scale">TrueNAS SCALE</div>
<div class="truenas-dropdown-item" onclick="selectProduct('TrueNAS Apps')" data-id="apps">TrueNAS Apps</div>
<div class="truenas-dropdown-item" onclick="selectProduct('TrueCommand')" data-id="truecommand">TrueCommand</div>
<div class="truenas-dropdown-item" onclick="selectProduct('TrueNAS Systems')" data-id="hardware">TrueNAS Systems</div>
</div>
Expand Down Expand Up @@ -141,14 +142,16 @@
versionUpdated = true;
} else if (path.includes('/scale/')) {
productButton.innerHTML = 'TrueNAS SCALE <i class="fa fa-angle-down"></i>';
if (path.includes('/24.04/')) {
if (path.includes('/24.10/')) {
versionButton.textContent = '24.10';
} else if (path.includes('/24.04/')) {
versionButton.textContent = '24.04';
} else if (path.includes('/23.10/')) {
versionButton.textContent = '23.10';
} else if (path.includes('/22.12/')) {
versionButton.textContent = 'Archive';
} else {
versionButton.textContent = '24.10';
versionButton.textContent = '25.04';
}
versionUpdated = true;
} else if (path.includes('/truecommand/')) {
Expand All @@ -167,6 +170,12 @@
versionButton.textContent = '---';
versionUpdated = true;
}
} else if (path.includes('/truenasapps/')) {
productButton.innerHTML = 'TrueNAS Apps <i class="fa fa-angle-down"></i>';
if (!versionUpdated) {
versionButton.textContent = '---';
versionUpdated = true;
}
} else {
productButton.innerHTML = 'Product <i class="fa fa-angle-down"></i>';
}
Expand Down Expand Up @@ -197,6 +206,9 @@
if (product === 'TrueNAS Systems') {
window.location.href = 'https://www.truenas.com/docs/hardware';
return;
} else if (product === 'TrueNAS Apps') {
window.location.href = 'https://www.truenas.com/docs/truenasapps';
return;
}

versionButton.disabled = false;
Expand All @@ -212,7 +224,8 @@
`;
} else if (product === 'TrueNAS SCALE') {
versionDropdown.innerHTML = `
<div class="truenas-dropdown-item" onclick="selectVersion('scale-nightly')" id="scale-nightly">24.10</div>
<div class="truenas-dropdown-item" onclick="selectVersion('scale-nightly')" id="scale-nightly">25.04</div>
<div class="truenas-dropdown-item" onclick="selectVersion('24.10')" id="2410">24.10</div>
<div class="truenas-dropdown-item" onclick="selectVersion('24.04')" id="2404">24.04</div>
<div class="truenas-dropdown-item" onclick="selectVersion('23.10')" id="2310">23.10</div>
<div class="truenas-dropdown-item" onclick="selectVersion('Archive')" id="Archive">Archive</div>
Expand Down Expand Up @@ -369,6 +382,8 @@
relative_url = 'scale/23.10/';
} else if (version === '24.04') {
relative_url = 'scale/24.04/';
} else if (version === '24.10') {
relative_url = 'scale/24.10/';
} else if (version === 'scale-nightly') {
relative_url = 'scale/';
} else if (version === 'tc-nightly') {
Expand Down Expand Up @@ -396,6 +411,8 @@
var versionsElement = document.getElementById('versions');
if (product) {
versionDropdown.style.display = product.toLowerCase() === 'truenas systems' ? 'none' : 'block';
} else if (product) {
versionDropdown.style.display = product.toLowerCase() === 'truenas apps' ? 'none' : 'block';
} else {
versionDropdown.style.display = 'none';
}
Expand Down Expand Up @@ -424,6 +441,8 @@

if (product) {
versionDropdown.style.display = product.toLowerCase() === 'truenas systems' ? 'none' : 'block';
} else if (product) {
versionDropdown.style.display = product.toLowerCase() === 'truenas apps' ? 'none' : 'block';
} else {
versionDropdown.style.display = 'none';
}
Expand All @@ -444,7 +463,7 @@
versionDropdown.style.display = 'none';
} else if (productButton.textContent === 'TrueNAS SCALE ') {
selectProduct('TrueNAS SCALE');
versionButton.innerHTML = currentPath.includes('/24.04/') ? '24.04 <i class="fa fa-angle-down"></i>' : currentPath.includes('/23.10/') ? '23.10 <i class="fa fa-angle-down"></i>' : currentPath.includes('/22.12/') ? '22.12 <i class="fa fa-angle-down"></i>' : '24.10 <i class="fa fa-angle-down"></i>';
versionButton.innerHTML = currentPath.includes('/24.10/') ? '24.10 <i class="fa fa-angle-down"></i>' : currentPath.includes('/24.04/') ? '24.04 <i class="fa fa-angle-down"></i>' : currentPath.includes('/23.10/') ? '23.10 <i class="fa fa-angle-down"></i>' : currentPath.includes('/22.12/') ? '22.12 <i class="fa fa-angle-down"></i>' : '25.04 <i class="fa fa-angle-down"></i>';
versionDropdown.style.display = 'none';
} else if (productButton.textContent === 'TrueCommand ') {
selectProduct('TrueCommand');
Expand Down

0 comments on commit 9a62c7f

Please sign in to comment.