39 lines
802 B
Text
39 lines
802 B
Text
|
package main
|
||
|
|
||
|
|
||
|
templ tLoginForm(err string) {
|
||
|
<form action="/login" method="POST">
|
||
|
<h2>Login</h2>
|
||
|
Username: <input name="username"><br>
|
||
|
Password: <input name="password" type="password"><br>
|
||
|
|
||
|
if err != "" {
|
||
|
<div style="color:red">{err}</div>
|
||
|
}
|
||
|
<input type="submit">
|
||
|
</form>
|
||
|
}
|
||
|
|
||
|
templ tHello(session *UserSession) {
|
||
|
<div>Hello {session.Username}</div>
|
||
|
}
|
||
|
|
||
|
templ tError(err string) {
|
||
|
<div style="color:red;">err</div>
|
||
|
}
|
||
|
|
||
|
templ tPage(contents templ.Component) {
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>The Game</title>
|
||
|
<link rel="stylesheet" href="style.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<h1>THE GAME</h1>
|
||
|
@contents
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|
||
|
}
|