diff options
| author | Bobby <[email protected]> | 2025-07-07 22:57:31 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-07-07 22:57:31 +0530 |
| commit | 52a0248c1c81a14699b3d33ba7efe0c56bbe7477 (patch) | |
| tree | 02d35fee769d518beb5dd01715e84d13ea421d51 /controllers | |
| parent | b6a04140f2668a0dcae4befcd272e05b75bd14e5 (diff) | |
| download | imageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.tar.xz imageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.zip | |
massive y2k retro overhaul with sidebar, context processors, and proper database organization
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/home.go | 12 | ||||
| -rw-r--r-- | controllers/login.go | 1 | ||||
| -rw-r--r-- | controllers/posts.go | 1 | ||||
| -rw-r--r-- | controllers/preferences.go | 1 | ||||
| -rw-r--r-- | controllers/register.go | 1 |
5 files changed, 12 insertions, 4 deletions
diff --git a/controllers/home.go b/controllers/home.go new file mode 100644 index 0000000..5e14b9e --- /dev/null +++ b/controllers/home.go @@ -0,0 +1,12 @@ +package controllers + +import ( + "imageboard/utils/shortcuts" + + "github.com/gofiber/fiber/v2" +) + +func HomeController(ctx *fiber.Ctx) error { + ctx.Locals("Title", "Home Page") + return shortcuts.Render(ctx, "home", nil) +} diff --git a/controllers/login.go b/controllers/login.go index dc8dd48..1d6bc5e 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -8,6 +8,5 @@ import ( func LoginController(ctx *fiber.Ctx) error { ctx.Locals("Title", "Login") - ctx.Locals("request", fiber.Map{"path": ctx.Path()}) return shortcuts.Render(ctx, "login", nil) } diff --git a/controllers/posts.go b/controllers/posts.go index c3da9c1..6fdcd26 100644 --- a/controllers/posts.go +++ b/controllers/posts.go @@ -8,7 +8,6 @@ import ( func PostsController(ctx *fiber.Ctx) error {
ctx.Locals("Title", "Posts")
- ctx.Locals("request", fiber.Map{"path": ctx.Path()})
searchQuery := ctx.Query("tags", "")
diff --git a/controllers/preferences.go b/controllers/preferences.go index 3a504ed..86e0fb3 100644 --- a/controllers/preferences.go +++ b/controllers/preferences.go @@ -8,6 +8,5 @@ import ( func PreferencesController(ctx *fiber.Ctx) error { ctx.Locals("Title", "Site Preferences") - ctx.Locals("request", fiber.Map{"path": ctx.Path()}) return shortcuts.Render(ctx, "preferences", nil) } diff --git a/controllers/register.go b/controllers/register.go index 9343732..3be4e64 100644 --- a/controllers/register.go +++ b/controllers/register.go @@ -8,6 +8,5 @@ import ( func RegisterController(ctx *fiber.Ctx) error { ctx.Locals("Title", "Register") - ctx.Locals("request", fiber.Map{"path": ctx.Path()}) return shortcuts.Render(ctx, "register", nil) } |
