aboutsummaryrefslogtreecommitdiffstats
path: root/web/command/html/upload.go
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-08 23:26:05 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-08 23:26:05 +0100
commitcdb75d3fcbc9339b897f8c6ff4d69a577f017393 (patch)
tree5e757cd236540c2cea9874c1bc09f19548db05d5 /web/command/html/upload.go
parentb56101f1a11552067f594679a497ebd4cf7427d4 (diff)
Rewrite in Go
Diffstat (limited to 'web/command/html/upload.go')
-rw-r--r--web/command/html/upload.go53
1 files changed, 53 insertions, 0 deletions
diff --git a/web/command/html/upload.go b/web/command/html/upload.go
new file mode 100644
index 0000000..1225d0f
--- /dev/null
+++ b/web/command/html/upload.go
@@ -0,0 +1,53 @@
+package html
+
+import (
+ "fmt"
+
+ . "maragu.dev/gomponents"
+ . "maragu.dev/gomponents/html"
+)
+
+func UploadPage(success, err string, siteName string) Node {
+ return page("Upload new version to "+siteName,
+ H1(Text("Upload new version to "+siteName)),
+
+ If(success != "", Group{
+ alertSuccess(success),
+ Div(
+ Class("control-group group-right"),
+ navButton("OK", fmt.Sprintf("/site/%s/", siteName)),
+ ),
+ }),
+
+ If(success == "", Group{
+ If(err != "", alertError(err)),
+
+ Form(
+ Method("post"),
+ EncType("multipart/form-data"),
+
+ FieldSet(
+ Legend(Text("Upload")),
+ Input(
+ ID("upload"),
+ Name("upload"),
+ Type("file"),
+ ),
+ Span(
+ Class("form-help"),
+ Text("A zip file with the contents of the site."),
+ ),
+ ),
+
+ Div(
+ Class("control-group group-right"),
+ navButton("Go back", fmt.Sprintf("/site/%s/", siteName)),
+ Input(
+ Type("submit"),
+ Value("Submit"),
+ ),
+ ),
+ ),
+ }),
+ )
+}