init
This commit is contained in:
commit
ef105e1cac
22 changed files with 3001 additions and 0 deletions
78
web/templates/layouts/base.gohtml
Normal file
78
web/templates/layouts/base.gohtml
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{{ define "layouts/base" }}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ .Title }}</title>
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<div class="shell header-row">
|
||||
<a class="brand" href="/">Superbanka</a>
|
||||
<nav class="nav">
|
||||
{{ if .Admin }}
|
||||
<a href="/admin">Dashboard</a>
|
||||
<a href="/leaderboard">Leaderboard</a>
|
||||
<a href="/admin/users">Users</a>
|
||||
<a href="/admin/audit-logs">Audit logs</a>
|
||||
<form method="post" action="/admin/logout" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
|
||||
<button class="nav-button" type="submit">Admin logout</button>
|
||||
</form>
|
||||
{{ else if .User }}
|
||||
<a href="/app">Dashboard</a>
|
||||
<a href="/leaderboard">Leaderboard</a>
|
||||
<a href="/app/transfer">Transfer</a>
|
||||
<a href="/app/transactions">Transactions</a>
|
||||
<form method="post" action="/logout" class="inline-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
|
||||
<button class="nav-button" type="submit">Logout</button>
|
||||
</form>
|
||||
{{ else }}
|
||||
<a href="/leaderboard">Leaderboard</a>
|
||||
<a href="/register">Register</a>
|
||||
<a href="/login">Login</a>
|
||||
<a href="/admin/login">Admin</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="shell main-content">
|
||||
{{ if .Flash }}
|
||||
<div class="flash success">{{ .Flash }}</div>
|
||||
{{ end }}
|
||||
{{ if .Error }}
|
||||
<div class="flash error">{{ .Error }}</div>
|
||||
{{ end }}
|
||||
{{ if eq .Page "home" }}
|
||||
{{ template "home" . }}
|
||||
{{ else if eq .Page "register" }}
|
||||
{{ template "register" . }}
|
||||
{{ else if eq .Page "login" }}
|
||||
{{ template "login" . }}
|
||||
{{ else if eq .Page "admin_login" }}
|
||||
{{ template "admin_login" . }}
|
||||
{{ else if eq .Page "dashboard" }}
|
||||
{{ template "dashboard" . }}
|
||||
{{ else if eq .Page "leaderboard" }}
|
||||
{{ template "leaderboard" . }}
|
||||
{{ else if eq .Page "transfer" }}
|
||||
{{ template "transfer" . }}
|
||||
{{ else if eq .Page "transactions" }}
|
||||
{{ template "transactions" . }}
|
||||
{{ else if eq .Page "admin_dashboard" }}
|
||||
{{ template "admin_dashboard" . }}
|
||||
{{ else if eq .Page "admin_users" }}
|
||||
{{ template "admin_users" . }}
|
||||
{{ else if eq .Page "admin_user_detail" }}
|
||||
{{ template "admin_user_detail" . }}
|
||||
{{ else if eq .Page "admin_audit_logs" }}
|
||||
{{ template "admin_audit_logs" . }}
|
||||
{{ end }}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue