diff --git a/template/layout.jet.html b/template/layout.jet.html index b0940d6..8f68cf6 100644 --- a/template/layout.jet.html +++ b/template/layout.jet.html @@ -37,6 +37,8 @@
iconLatest by followed + + iconYour bookmarks iconYour profile
diff --git a/views/pages.go b/views/pages.go index 3cfacbb..b74a920 100644 --- a/views/pages.go +++ b/views/pages.go @@ -265,6 +265,19 @@ func following_works_page(c *fiber.Ctx) error { return c.Render("pages/following", fiber.Map{"Title": "Following works", "Queries": queries, "Artworks": artworks, "Page": pageInt}) } +func your_bookmark_page(c *fiber.Ctx) error { + token := get_session_value(c, "token") + if token == nil { + return c.Redirect("/login") + } + + // The left part of the token is the member ID + userId := strings.Split(*token, "_") + + c.Redirect("/users/" + userId[0] + "/bookmarks#checkpoint") + return nil +} + func login_page(c *fiber.Ctx) error { return c.Render("pages/login", fiber.Map{}) } diff --git a/views/routes.go b/views/routes.go index c24dce0..ddf14e9 100644 --- a/views/routes.go +++ b/views/routes.go @@ -52,6 +52,7 @@ func SetupRoutes(r *fiber.App) { self := r.Group("self") self.Get("/", get_logged_in_user) self.Get("/following_works", following_works_page) + self.Get("/bookmarks", your_bookmark_page) r.Get("login", login_page) r.Post("tags", search)