Link alla gestione utenti nella sidebar del Biohacking
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,6 +17,8 @@ interface Props {
|
||||
currentLesson?: string;
|
||||
}
|
||||
const { title, nav, currentArea, currentLesson } = Astro.props;
|
||||
// Solo l'admin gestisce gli utenti: dalla sezione ci arriva senza passare dal pannello.
|
||||
const isAdmin = Astro.locals.user?.role === 'admin';
|
||||
---
|
||||
<!doctype html>
|
||||
<html lang="it">
|
||||
@@ -64,7 +66,10 @@ const { title, nav, currentArea, currentLesson } = Astro.props;
|
||||
))}
|
||||
</nav>
|
||||
|
||||
<a class="cp-logout" href="/admin/logout">Esci</a>
|
||||
<div class="cp-foot">
|
||||
{isAdmin && <a href="/admin/users">Gestione utenti</a>}
|
||||
<a href="/admin/logout">Esci</a>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="cp-main"><slot /></main>
|
||||
@@ -103,9 +108,11 @@ const { title, nav, currentArea, currentLesson } = Astro.props;
|
||||
.cp-chapters ul li.on a { color: #fff; background: rgba(184,169,140,.22); }
|
||||
.cp-label { font-family: var(--font-heading); font-size: .68rem; letter-spacing: .06em; color: var(--c-accent); }
|
||||
|
||||
.cp-logout { display: inline-block; margin-top: 30px; font-size: .78rem; letter-spacing: .1em;
|
||||
text-transform: uppercase; color: #8d8379; text-decoration: none; }
|
||||
.cp-logout:hover { color: #fff; }
|
||||
.cp-foot { display: flex; flex-direction: column; gap: 10px; margin-top: 30px;
|
||||
padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
|
||||
.cp-foot a { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
|
||||
color: #8d8379; text-decoration: none; }
|
||||
.cp-foot a:hover { color: #fff; }
|
||||
|
||||
/* --- contenuto --- */
|
||||
.cp-main { flex: 1; min-width: 0; max-width: 920px; margin: 0 auto; padding: 56px 44px 100px; }
|
||||
|
||||
Reference in New Issue
Block a user