87 lines
2.3 KiB
Plaintext
87 lines
2.3 KiB
Plaintext
|
package templates
|
||
|
|
||
|
templ head(title string) {
|
||
|
<head>
|
||
|
<meta charset="UTF-8"/>
|
||
|
<link rel="stylesheet" href="/static/bulma.min.css"/>
|
||
|
<link rel="stylesheet" href="/static/materialsymbols.css"/>
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
|
<title>{ title }</title>
|
||
|
</head>
|
||
|
}
|
||
|
|
||
|
templ footer(timestamp string) {
|
||
|
<footer class="footer is-fixed-bottom">
|
||
|
<div class="content has-text-centered">
|
||
|
<p>
|
||
|
<strong>Webframework</strong> by <a href="https://www.jmbit.de">Johannes Bülow</a> © { timestamp } .
|
||
|
The source code is licensed <a href="https://opensource.org/license/gpl-2-0/">GPLv2</a>.
|
||
|
Using <a href="https://bulma.io/">Bulma</a>, <a href="https://htmx.org/">HTMX</a>, <a href="https://templ.guide/">Templ</a>, <a href="https://gin-gonic.com/">Gin</a> and <a href="https://gorm.io/">GORM</a>.
|
||
|
</p>
|
||
|
</div>
|
||
|
<script src="/static/htmx.min.js"></script>
|
||
|
<script src="/static/bulmaScripts.js"></script>
|
||
|
</footer>
|
||
|
}
|
||
|
|
||
|
templ navbar(loggedIn bool) {
|
||
|
<nav id="navbarTop" class="navbar is-transparent is-fixed-top" role="navigation" aria-label="main navigation">
|
||
|
<div class="navbar-brand">
|
||
|
<a class="navbar-item material-icons" href="/">
|
||
|
web build
|
||
|
</a>
|
||
|
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarTop">
|
||
|
<span aria-hidden="true"></span>
|
||
|
<span aria-hidden="true"></span>
|
||
|
<span aria-hidden="true"></span>
|
||
|
</a>
|
||
|
</div>
|
||
|
<div id="navbar" class="navbar-menu">
|
||
|
<div class="navbar-start">
|
||
|
<a class="navbar-item" href="/index.html">
|
||
|
Home
|
||
|
</a>
|
||
|
<a class="navbar-item">
|
||
|
Page
|
||
|
</a>
|
||
|
</div>
|
||
|
<div class="navbar-end">
|
||
|
<div class="navbar-item">
|
||
|
@loginButton(loggedIn)
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</nav>
|
||
|
}
|
||
|
|
||
|
templ loginButton(loggedIn bool) {
|
||
|
if loggedIn {
|
||
|
<a class="navbar-link" href="/profile.html">
|
||
|
Profile
|
||
|
</a>
|
||
|
<div class="buttons">
|
||
|
<a class="button is-light" href="/login.html">
|
||
|
Log out
|
||
|
</a>
|
||
|
</div>
|
||
|
} else {
|
||
|
<div class="buttons">
|
||
|
<a class="button is-light" href="/login.html">
|
||
|
Log in
|
||
|
</a>
|
||
|
</div>
|
||
|
}
|
||
|
}
|
||
|
|
||
|
templ errorMessage(title string, content string) {
|
||
|
<article class="message container">
|
||
|
<div class="message-header">
|
||
|
<p>{ title }</p>
|
||
|
<button class="delete" aria-label="delete"></button>
|
||
|
</div>
|
||
|
<div class="message-body">
|
||
|
{ content }
|
||
|
</div>
|
||
|
</article>
|
||
|
}
|