From a5b6232c775cdd00943a8b7ed81dc6942cdf6b82 Mon Sep 17 00:00:00 2001 From: lauralani Date: Fri, 28 Apr 2023 23:39:02 +0200 Subject: [PATCH] add a bit more polish --- internal/app/fiber.go | 2 +- internal/web/link.go | 2 +- views/links.tmpl | 10 ++++++---- web/link_add.js | 37 +++++++++++++++++++++++++++++++++++++ web/links.html | 4 ++-- web/links.js | 16 ++++++++++++++++ 6 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 web/link_add.js diff --git a/internal/app/fiber.go b/internal/app/fiber.go index b13947c..af55561 100644 --- a/internal/app/fiber.go +++ b/internal/app/fiber.go @@ -57,7 +57,7 @@ func SetupFiber() error { fiberapp.Post("/admin/login", web.HandleAdminLoginPost) fiberapp.Get("/admin/", web.HandleAdminLinkIndexGet) - fiberapp.Get("/admin/links/add", web.HandleAdminLinkAddGet) + fiberapp.Get("/admin/links/new", web.HandleAdminLinkNewGet) fiberapp.Static("/admin/", "./web") diff --git a/internal/web/link.go b/internal/web/link.go index 6c102ee..2333205 100644 --- a/internal/web/link.go +++ b/internal/web/link.go @@ -7,7 +7,7 @@ import ( "github.com/gofiber/fiber/v2" ) -func HandleAdminLinkAddGet(c *fiber.Ctx) error { +func HandleAdminLinkNewGet(c *fiber.Ctx) error { return c.Render("add_link", nil) } diff --git a/views/links.tmpl b/views/links.tmpl index fbb4d06..d1e4dd4 100644 --- a/views/links.tmpl +++ b/views/links.tmpl @@ -12,6 +12,8 @@ + + @@ -24,8 +26,8 @@ {{range .}} - - + + {{range .}} - - + +
{{.ID}}{{.URL}}{{.ID}}{{.URL}}
{{.ID}}{{.URL}}{{.ID}}{{.URL}}