updates
This commit is contained in:
10
server/internal/templates/home.templ
Normal file
10
server/internal/templates/home.templ
Normal 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>
|
||||
}
|
||||
19
server/internal/templates/layout.templ
Normal file
19
server/internal/templates/layout.templ
Normal 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>
|
||||
}
|
||||
20
server/internal/templates/login.templ
Normal file
20
server/internal/templates/login.templ
Normal 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>
|
||||
}
|
||||
Reference in New Issue
Block a user