Updated links to be optionall visible for registered users only

This commit is contained in:
rainbow napkin 2026-11-07 09:18:05 -05:00
parent f90fdf2588
commit 286c08d231
3 changed files with 31 additions and 10 deletions

View file

@ -47,9 +47,18 @@
]
},
"links":{
"About": "/about",
"Code": "https://git.ourfore.st/rainbownapkin/canopy",
"HRT": "/hrt"
"About": {
"link": "/about",
"registeredOnly": false
},
"Code": {
"link": "https://git.ourfore.st/rainbownapkin/canopy",
"registeredOnly": false
},
"HRT": {
"link": "/hrt",
"registeredOnly": true
}
},
"aboutText":"<a href=\"https://ourfore.st/\">ourfore.st</a> is the one and only original canopy instance. Setup, ran, and administered by rainbownapkin herself. This site exists to provide a featureful, preformant, and comfy replacement for the TTN community."
}

View file

@ -83,9 +83,18 @@
},
//Provides customizable links for navbar
"links":{
"About": "/about",
"Code": "https://git.ourfore.st/rainbownapkin/canopy",
"HRT": "/hrt"
"About": {
"link": "/about",
"registeredOnly": false
},
"Code": {
"link": "https://git.ourfore.st/rainbownapkin/canopy",
"registeredOnly": false
},
"HRT": {
"link": "/hrt",
"registeredOnly": true //Hides from un-registered users
}
},
//Fills the 'about ${instanceName}' section on the /about page, lets users know about your specific instance
"aboutText":"<a href=\"https://ourfore.st/\">ourfore.st</a> is the one and only original canopy instance. Setup, ran, and administered by rainbownapkin herself. This site exists to provide a featureful, preformant, and comfy replacement for the TTN community."

View file

@ -20,10 +20,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<p class="navbar-item" id="left-controls">
<span class="navbar-item-seperator first"> - </span>
<a class="navbar-item first" href="javascript:">Channel Guide</a>
<% for(link of Object.keys(links)){ %>
<% for(link of Object.keys(links)){
const linkObj = links[link];
if(!linkObj.registeredOnly || user != null){ %>
-
<a target="_blank" class="navbar-item" href="<%- links[link] %>"><%= link %></a>
<% } %>
<% }
} %>
</p>
</span>
<span class="navbar-item" id="right-navbar-cluster">