44 lines
2.2 KiB
Plaintext
44 lines
2.2 KiB
Plaintext
<!doctype html>
|
|
<html lang="id">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><%= typeof title !== 'undefined' ? title + ' · ' : '' %>Logharian</title>
|
|
<link rel="icon" href="/favicon.ico" sizes="any">
|
|
<link rel="icon" href="/favicon.png" type="image/png">
|
|
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap">
|
|
<link rel="stylesheet" href="/css/style.css?v=<%= assetVersion %>">
|
|
</head>
|
|
<body>
|
|
<% if (currentUser) { %>
|
|
<header class="topbar">
|
|
<div class="wrap topbar-inner">
|
|
<a class="brand" href="/"><img class="brand-logo" src="/img/logo.png" alt="" width="38" height="38">Logharian</a>
|
|
<nav class="nav" aria-label="Menu utama">
|
|
<a href="/" class="<%= path === '/' ? 'active' : '' %>">Dashboard</a>
|
|
<% if (currentUser.role === 'admin') { %>
|
|
<a href="/admin/kegiatan" class="<%= path.startsWith('/admin/kegiatan') || path.startsWith('/kegiatan') ? 'active' : '' %>">Kegiatan</a>
|
|
<a href="/admin/users" class="<%= path.startsWith('/admin/users') ? 'active' : '' %>">Pengguna</a>
|
|
<% } %>
|
|
<a href="/akun" class="<%= path === '/akun' ? 'active' : '' %>">Akun</a>
|
|
</nav>
|
|
<div class="who">
|
|
<span class="avatar" aria-hidden="true"><%= currentUser.nama.split(/\s+/).filter(function (w) { return /^[A-Za-z]/.test(w); }).slice(0, 2).map(function (w) { return w[0]; }).join('').toUpperCase() %></span>
|
|
<span class="who-name"><%= currentUser.nama %></span>
|
|
<span class="badge role-<%= currentUser.role %>"><%= roleLabel(currentUser.role) %></span>
|
|
<form method="post" action="/logout">
|
|
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
|
<button type="submit" class="btn btn-ghost btn-sm">Keluar</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<% } %>
|
|
<main class="wrap main">
|
|
<% flashes.forEach(function (f) { %>
|
|
<div class="alert alert-<%= f.type %>" role="status"><%= f.msg %></div>
|
|
<% }) %>
|