Started UI for editing images

This commit is contained in:
Leon Mika 2026-03-25 21:09:57 +11:00
parent 8c371ccae9
commit 18f9f49c0a
10 changed files with 191 additions and 9 deletions

View file

@ -75,7 +75,7 @@ func (ph PostsHandler) New(c fiber.Ctx) error {
"post": p,
"categories": cats,
"selectedCategories": map[int64]bool{},
"bodyClass": "post-edit-page",
"bodyClass": "large-editor",
})
}
@ -116,7 +116,7 @@ func (ph PostsHandler) Edit(c fiber.Ctx) error {
"post": post,
"categories": cats,
"selectedCategories": selectedCategories,
"bodyClass": "post-edit-page",
"bodyClass": "large-editor",
})
}))
}

View file

@ -162,3 +162,24 @@ func (uh UploadsHandler) UploadComplete(c fiber.Ctx) error {
return c.Status(fiber.StatusAccepted).JSON(fiber.Map{})
}
func (uh UploadsHandler) Edit(c fiber.Ctx) error {
uploadIDStr := c.Params("uploadID")
if uploadIDStr == "" {
return fiber.ErrBadRequest
}
uploadID, err := strconv.ParseInt(uploadIDStr, 10, 64)
if err != nil {
return fiber.ErrBadRequest
}
upload, err := uh.UploadsService.FetchUpload(c.Context(), uploadID)
if err != nil {
return err
}
return c.Render("uploads/edit", fiber.Map{
"upload": upload,
"bodyClass": "large-editor",
})
}