nquest/views/layout.gotmpl

67 lines
No EOL
2 KiB
Go Template

{{define "header"}}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>nQuest</title>
<link href="/static/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/static/styles.css">
</head>
<body data-bs-theme="dark">
<nav class="navbar navbar-expand-lg bg-primary" data-bs-theme="dark">
<div class="container">
<a class="navbar-brand" href="https://nquest.ru/">nQuest</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/">Игры</a>
</li>
{{ if .User }}
<li class="nav-item">
<a class="nav-link" href="/teams">Команды</a>
</li>
{{ end }}
</ul>
<div class="d-flex">
{{ if .User }}
<span class="navbar-text me-2">
{{ .User.Username }}
{{ if .User.Team }}
(<a href="/team">{{.User.Team.Team.Name}}</a>)
{{ else }}
(без команды)
{{ end }}
</span>
<form method="POST" action="/user/logout">
<input type="submit" class="btn btn-defult" value="Выход" /></a>
</form>
{{ else }}
<div class="btn-group">
<a class="btn btn-success" href="/user/login">Вход</a>
<a class="btn btn-outline-success" href="/user/register">Регистрация</a>
</div>
{{ end }}
</form>
</div>
</div>
</nav>
<div class="container my-5">
{{end}}
{{define "footer"}}
</div>
</body>
</html>
{{end}}