From cdb75d3fcbc9339b897f8c6ff4d69a577f017393 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Tue, 8 Jul 2025 23:26:05 +0100 Subject: Rewrite in Go --- web/command/html/upload.go | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 web/command/html/upload.go (limited to 'web/command/html/upload.go') 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"), + ), + ), + ), + }), + ) +} -- cgit v1.2.3-70-g09d2