This commit is contained in:
2026-07-28 02:04:36 +03:30
commit a5aed05b98
31 changed files with 3500 additions and 0 deletions
+84
View File
@@ -0,0 +1,84 @@
{{define "head"}}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light">
<title>{{.Title}} · Hamkar</title>
<script src="/static/theme.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css">
<link rel="stylesheet" href="/static/style.css">
<script src="/static/jalali-picker.js" defer></script>
<script src="https://unpkg.com/htmx.org@2.0.4" defer></script>
</head>
<body>
{{end}}
{{define "theme-toggle"}}
<button type="button" class="theme-toggle" data-theme-toggle aria-label="Switch to dark mode" title="Change color mode">
<span class="theme-sun" aria-hidden="true"></span>
<span class="theme-moon" aria-hidden="true"></span>
</button>
{{end}}
{{define "sidebar"}}
<aside class="sidebar">
<a class="brand" href="/">
<span class="brand-mark">ه</span>
<span>Hamkar<small>Team presence</small></span>
</a>
<nav>
<a href="/" class="{{if eq .SelectedSection "dashboard"}}active{{end}}">
<span class="nav-icon"></span> Overview
</a>
<a href="/day" class="{{if eq .SelectedSection "day"}}active{{end}}">
<span class="nav-icon"></span> Team day
</a>
<a href="/requests" class="{{if eq .SelectedSection "requests"}}active{{end}}">
<span class="nav-icon"></span> My requests
</a>
{{if eq .User.Role "admin"}}
<p class="nav-label">ADMIN</p>
<a href="/admin/requests" class="{{if eq .SelectedSection "admin"}}active{{end}}">
<span class="nav-icon"></span> Approvals
{{if .PendingCount}}<span class="nav-count">{{.PendingCount}}</span>{{end}}
</a>
<a href="/admin/users" class="{{if eq .SelectedSection "users"}}active{{end}}">
<span class="nav-icon"></span> Teammates
</a>
<a href="/reports" class="{{if eq .SelectedSection "reports"}}active{{end}}">
<span class="nav-icon"></span> Reports
</a>
{{end}}
</nav>
<div class="sidebar-theme">{{template "theme-toggle" .}}<span>Appearance</span></div>
<div class="sidebar-user">
<span class="avatar">{{initial .User.DisplayName}}</span>
<span><strong>{{.User.DisplayName}}</strong><small>{{.User.Role}}</small></span>
<form method="post" action="/logout">
<input type="hidden" name="csrf" value="{{.CSRF}}">
<button class="icon-button" title="Sign out" aria-label="Sign out"></button>
</form>
</div>
</aside>
{{end}}
{{define "shell-start"}}
{{template "head" .}}
<div class="app-shell">
{{template "sidebar" .}}
<main class="main">
{{end}}
{{define "shell-end"}}
</main>
</div>
</body>
</html>
{{end}}
{{define "notice"}}
{{if .Flash}}<div class="notice success">{{.Flash}}</div>{{end}}
{{if .Error}}<div class="notice error">{{.Error}}</div>{{end}}
{{end}}