From b2edcd65697a1cfe67ec632450e4207a31ee39f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCller?= Date: Mon, 11 Sep 2017 23:40:03 +0200 Subject: [PATCH] new.html form added --- assets/public/new.html | 35 +++++++++++++++++++++++++++++++++++ assets/public/style.css | 17 +++++++++++++---- server.go | 11 +++++++++++ 3 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 assets/public/new.html diff --git a/assets/public/new.html b/assets/public/new.html new file mode 100644 index 0000000..76ff8e2 --- /dev/null +++ b/assets/public/new.html @@ -0,0 +1,35 @@ + + + + NoteHub — Add note + + + + + + +
+ +
+ + + +
+
+ + + + diff --git a/assets/public/style.css b/assets/public/style.css index 38580f8..dbbf9b0 100644 --- a/assets/public/style.css +++ b/assets/public/style.css @@ -236,10 +236,13 @@ td { } textarea { - font-size: 1em; + background-color: #303535; + font-size: 1.2em; + color: #b0b0b0; border-radius: 5px; flex: 1 0; - margin: 1em; + margin: 3em; + padding: 2em; } textarea, fieldset { @@ -247,7 +250,13 @@ textarea, fieldset { } fieldset { - padding-left: 1em; - padding-right: 1em; + margin-left: 3em; + margin-right: 3em; + margin-bottom: 3em; } +form { + display: flex; + flex: 1 0; + flex-direction: column; +} diff --git a/server.go b/server.go index ba5aad1..db36b38 100644 --- a/server.go +++ b/server.go @@ -2,6 +2,7 @@ package main import ( "bytes" + "fmt" "html/template" "io" "io/ioutil" @@ -43,6 +44,7 @@ func main() { e.File("/robots.txt", "assets/public/robots.txt") e.File("/style.css", "assets/public/style.css") e.File("/index.html", "assets/public/index.html") + e.File("/new", "assets/public/new.html") e.File("/", "assets/public/index.html") e.GET("/TOS.md", func(c echo.Context) error { @@ -65,6 +67,15 @@ func main() { return c.Render(code, "Note", n) }) + e.POST("/note", func(c echo.Context) error { + vals, err := c.FormParams() + if err != nil { + return err + } + fmt.Printf("DEBUG %+v", vals) + return nil + }) + e.Logger.Fatal(e.Start(":3000")) }