This commit is contained in:
2026-01-24 15:59:05 +02:00
parent cbb3fb3421
commit b59d27d13d
12 changed files with 165 additions and 4 deletions

View File

@@ -0,0 +1,10 @@
package templates
templ Home() {
<div>
<h1>Welcome to Futur Web App</h1>
<p>This is server-rendered with Templ and HTMX.</p>
<a href="/login">Login</a>
<a href="/dashboard">Dashboard</a>
</div>
}

View File

@@ -0,0 +1,19 @@
package templates
templ Layout(title string) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{title}</title>
<script src="/static/htmx.2.0.8.min.js"></script>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 20px; }
</style>
</head>
<body>
{ children... }
</body>
</html>
}

View File

@@ -0,0 +1,20 @@
package templates
templ Login() {
<div>
<h2>Login</h2>
<form hx-post="/api/user/login" hx-target="#result" hx-swap="innerHTML">
<div>
<label>Email:</label>
<input type="email" name="email" placeholder="Email" required>
</div>
<div>
<label>Password:</label>
<input type="password" name="password" placeholder="Password" required>
</div>
<button type="submit">Login</button>
</form>
<div id="result"></div>
<a href="/">Home</a>
</div>
}