From 1446e8b3372ad2de5b863e1347d0a3b20ef1e84a Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Fri, 20 Sep 2024 14:08:09 -0600 Subject: [PATCH] Common style, more footers --- handlers.go | 10 ++++++++-- static/style/common.css | 10 ++++++++++ static/style/video.css | 11 ----------- templates/download.html | 4 ++++ templates/home.html | 4 ++++ templates/login.html | 1 + templates/videos.html | 1 + 7 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 static/style/common.css diff --git a/handlers.go b/handlers.go index 18cf67f..c57e505 100644 --- a/handlers.go +++ b/handlers.go @@ -54,7 +54,10 @@ func loginHandler(c echo.Context) error { } func homeHandler(c echo.Context) error { - return c.Render(http.StatusOK, "home.html", nil) + return c.Render(http.StatusOK, "home.html", + map[string]interface{}{ + "Footer": makeFooter(), + }) } func loginPostHandler(c echo.Context) error { @@ -99,7 +102,10 @@ func logoutHandler(c echo.Context) error { } func downloadHandler(c echo.Context) error { - return c.Render(http.StatusOK, "download.html", nil) + return c.Render(http.StatusOK, "download.html", + map[string]interface{}{ + "Footer": makeFooter(), + }) } func downloadPostHandler(c echo.Context) error { diff --git a/static/style/common.css b/static/style/common.css new file mode 100644 index 0000000..1b1964c --- /dev/null +++ b/static/style/common.css @@ -0,0 +1,10 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 20px; + box-sizing: border-box; +} + +h1 { + text-align: center; +} \ No newline at end of file diff --git a/static/style/video.css b/static/style/video.css index 2f66af2..bcb4c21 100644 --- a/static/style/video.css +++ b/static/style/video.css @@ -1,14 +1,3 @@ -body { - font-family: Arial, sans-serif; - margin: 0; - padding: 20px; - box-sizing: border-box; -} - -h1 { - text-align: center; -} - .video-container { max-width: 600px; margin: 0 auto; diff --git a/templates/download.html b/templates/download.html index 6f7fde1..185ea03 100644 --- a/templates/download.html +++ b/templates/download.html @@ -4,6 +4,8 @@ + + {{template "footer-css" .}} Download Video @@ -20,6 +22,8 @@ View Downloaded Videos Logout + + {{template "footer" .}} \ No newline at end of file diff --git a/templates/home.html b/templates/home.html index 30e1413..d03e3ff 100644 --- a/templates/home.html +++ b/templates/home.html @@ -4,6 +4,8 @@ + + {{template "footer-css" .}} Video Downloader @@ -11,6 +13,8 @@

Welcome to Video Downloader

Login Videos + + {{template "footer" .}} \ No newline at end of file diff --git a/templates/login.html b/templates/login.html index 64f9363..233cb28 100644 --- a/templates/login.html +++ b/templates/login.html @@ -4,6 +4,7 @@ + Login diff --git a/templates/videos.html b/templates/videos.html index 64ebd0f..0bd3a2d 100644 --- a/templates/videos.html +++ b/templates/videos.html @@ -6,6 +6,7 @@ Downloaded Videos + {{template "footer-css" .}}