quite a lot of things
This commit is contained in:
3521
cmd/web/assets/js/htmx.min.js
vendored
3521
cmd/web/assets/js/htmx.min.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,19 +0,0 @@
|
||||
package web
|
||||
|
||||
templ Base() {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="h-screen">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
||||
<title>Go Blueprint Hello</title>
|
||||
<link href="assets/css/output.css" rel="stylesheet"/>
|
||||
<script src="assets/js/htmx.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<main class="max-w-sm mx-auto p-4">
|
||||
{ children... }
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package web
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed "assets"
|
||||
var Files embed.FS
|
||||
@@ -1,21 +0,0 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func HelloWebHandler(w http.ResponseWriter, r *http.Request) {
|
||||
err := r.ParseForm()
|
||||
if err != nil {
|
||||
http.Error(w, "Bad Request", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
name := r.FormValue("name")
|
||||
component := HelloPost(name)
|
||||
err = component.Render(r.Context(), w)
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
log.Fatalf("Error rendering in HelloWebHandler: %e", err)
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package web
|
||||
|
||||
templ HelloForm() {
|
||||
@Base() {
|
||||
<form hx-post="/hello" method="POST" hx-target="#hello-container">
|
||||
<input class="bg-gray-200 text-black p-2 border border-gray-400 rounded-lg"id="name" name="name" type="text"/>
|
||||
<button type="submit" class="bg-orange-500 hover:bg-orange-700 text-white py-2 px-4 rounded">Submit</button>
|
||||
</form>
|
||||
<div id="hello-container"></div>
|
||||
}
|
||||
}
|
||||
|
||||
templ HelloPost(name string) {
|
||||
<div class="bg-green-100 p-4 shadow-md rounded-lg mt-6">
|
||||
<p>Hello, { name }</p>
|
||||
</div>
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
@import "tailwindcss"
|
||||
Reference in New Issue
Block a user