50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
|
package main
|
||
|
|
||
|
import "strconv"
|
||
|
|
||
|
templ counts(global, user int) {
|
||
|
<div>Global: { strconv.Itoa(global) }</div>
|
||
|
<div>User: { strconv.Itoa(user) }</div>
|
||
|
}
|
||
|
|
||
|
templ form() {
|
||
|
<form action="/" method="POST">
|
||
|
<div><button type="submit" name="global" value="global">Global</button></div>
|
||
|
<div><button type="submit" name="user" value="user">User</button></div>
|
||
|
</form>
|
||
|
}
|
||
|
|
||
|
templ page(global, user int) {
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="UTF-8"/>
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||
|
<title>Counts</title>
|
||
|
<link rel="stylesheet" href="/assets/bulma.min.css"/>
|
||
|
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-touch-icon.png"/>
|
||
|
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png"/>
|
||
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png"/>
|
||
|
<link rel="manifest" href="/assets/favicon/site.webmanifest"/>
|
||
|
</head>
|
||
|
<body class="bg-gray-100">
|
||
|
<header class="hero is-primary">
|
||
|
<div class="hero-body">
|
||
|
<div class="container">
|
||
|
<h1 class="title">Counts</h1>
|
||
|
</div>
|
||
|
</div>
|
||
|
</header>
|
||
|
<section class="section">
|
||
|
<div class="container">
|
||
|
<div class="columns is-centered">
|
||
|
<div class="column is-half">
|
||
|
@counts(global, user)
|
||
|
@form()
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</section>
|
||
|
</body>
|
||
|
</html>
|
||
|
}
|