From c79e605b60040c4c0e5c792fa447487c2b8ae246 Mon Sep 17 00:00:00 2001 From: horus_arch Date: Mon, 15 Jun 2015 13:38:47 +0200 Subject: Use flex to extract html. Icono-font used for icons. --- view.go | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 view.go (limited to 'view.go') diff --git a/view.go b/view.go new file mode 100644 index 0000000..3530bf0 --- /dev/null +++ b/view.go @@ -0,0 +1,112 @@ +package main + +func getTemplate() string { + return ` + + + + {{.URL}} + + + + {{.Favicon}} + + +
+
+
+ {{.URL}} +

{{.URL}}

+ {{if .AllowUpload}}

To upload please click here.

{{end}} +
+ {{if ne .URL "/"}} + .. (up a dir)

+ {{end}} + {{range .Links}} + {{else}}file" title="File: {{.Text}}">{{end}} {{.Text}}
+ {{end}} +
+
+
+
+ +` +} + +func get404() string { + return ` + + + + Not Found - {{.URL}} + + + {{.Favicon}} + + +
+
+

Not Found - {{.URL}}

+

+ Please check for typos in your url.

+

+ Go back to root +

+
+
+ +` +} + +func getUpload() string { + return ` + + + + Upload Form + + + {{.Favicon}} + + +
+
+

Upload Form

+
+

You are going to upload a file. Here you can search to add it.

+ +
+ +
+
+
+ + +` +} + +func getUploaded() string { + return ` + + + + Uploaded {{.File}} + + + {{.Favicon}} + + +
+
+

Uploaded!

+

+ {{.File}} was successfull uploaded. +

+

+ Back to root +

+
+
+ +` +} -- cgit v1.2.3