Add /spr/ route for soleprint index, fix sidebar system labels

This commit is contained in:
buenosairesam
2026-01-27 07:07:41 -03:00
parent 5603979d5c
commit ed1c8f6c96
8 changed files with 300 additions and 96 deletions

View File

@@ -92,18 +92,19 @@
function renderSystemSection(systemKey, title) {
const veins = config.veins || [];
// System icon - ALWAYS shown as non-clickable separator
// System link with icon and label (same as soleprint)
let html = `
<div class="spr-sidebar-icon" title="${title}">
<a href="${SPR_BASE}/${systemKey}" class="spr-sidebar-item" title="${title}">
${icons[systemKey]}
</div>
<span class="label">${title}</span>
<span class="tooltip">${title}</span>
</a>
`;
// Nested elements below icon - auth-gated
// Nested elements below - auth-gated
if (user) {
// Logged in
// Logged in - show vein links under artery
if (systemKey === "artery") {
// Show vein links under artery
for (const vein of veins) {
html += `
<a href="${SPR_BASE}/artery/${vein}" class="spr-sidebar-item spr-vein-item" title="${vein}">
@@ -112,14 +113,6 @@
</a>
`;
}
} else {
// Atlas/Station: clickable link to main page
html += `
<a href="${SPR_BASE}/${systemKey}" class="spr-sidebar-item spr-system-link" title="${title}">
<span class="label">${title}</span>
<span class="tooltip">${title}</span>
</a>
`;
}
} else if (config.auth_enabled) {
// Not logged in: show "login to access" below each system icon
@@ -159,7 +152,7 @@
<div class="spr-sidebar-divider"></div>
<a href="${SPR_BASE}/" class="spr-sidebar-item active" title="Soleprint">
<a href="/spr/" class="spr-sidebar-item active" title="Soleprint">
${icons.soleprint}
<span class="label">Soleprint</span>
<span class="tooltip">Soleprint</span>
@@ -204,9 +197,9 @@
</div>
`;
} else {
// Include current page as redirect target after login
const redirectUrl = encodeURIComponent(window.location.href);
const loginUrl = `${config.auth.login_url}?redirect=${redirectUrl}`;
// Include current path as redirect target after login (relative, not full URL)
const redirectPath = window.location.pathname + window.location.search;
const loginUrl = `${config.auth.login_url}?redirect=${encodeURIComponent(redirectPath)}`;
return `
<div class="spr-sidebar-user">
<a href="${loginUrl}" class="spr-sidebar-item" title="Login with Google">