From 16a02e999e952058574599193a11cb8090b3eb9b Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 20 Oct 2021 22:03:58 +0000 Subject: [PATCH] Reuse index.html template for file upload git-svn-id: file:///srv/svn/repo/marisa/trunk@51 d6811dac-2434-b64a-9ddc-f563ab233461 --- example/templates/index.html | 7 +++++-- example/templates/upload.html | 22 ---------------------- partage.go | 7 +++++-- 3 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 example/templates/upload.html diff --git a/example/templates/index.html b/example/templates/index.html index 3821d4a..07ba874 100644 --- a/example/templates/index.html +++ b/example/templates/index.html @@ -33,7 +33,10 @@

File size limited to {{.Maxsize}}.

-
- +
{{if .Links}} + + {{end}}
diff --git a/example/templates/upload.html b/example/templates/upload.html deleted file mode 100644 index f731132..0000000 --- a/example/templates/upload.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - Partage - - -
- -

partage

-
- - - diff --git a/partage.go b/partage.go index c809644..308845e 100644 --- a/partage.go +++ b/partage.go @@ -204,8 +204,11 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) { switch r.PostFormValue("output") { case "html": - data := templatedata{Links: links} - servetemplate(w, "/upload.html", data) + data := templatedata{ + Maxsize: humanize.IBytes(uint64(conf.maxsize)), + Links: links, + } + servetemplate(w, "/index.html", data) case "json": data, _ := json.Marshal(links) w.Write(data)