aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/handlers_sections.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/web/handlers_sections.go')
-rw-r--r--internal/web/handlers_sections.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/web/handlers_sections.go b/internal/web/handlers_sections.go
index 325192e..eb45e1c 100644
--- a/internal/web/handlers_sections.go
+++ b/internal/web/handlers_sections.go
@@ -73,10 +73,10 @@ func (s *Server) handleSectionSave(w http.ResponseWriter, r *http.Request) {
fail := func(msg string) {
s.renderStatus(w, r, http.StatusBadRequest, "dashboard/section_form.html", map[string]any{"section": sec, "error": msg})
}
- img, err := s.readUpload(r, "inline_image")
+ img, err := s.readUpload(r, "inline_file", false)
switch {
case err != nil:
- fail(s.tr(r, "Image not added:") + " " + err.Error())
+ fail(s.tr(r, "File not added:") + " " + err.Error())
return
case len(sec.Title) > 120:
fail(s.tr(r, "Title is too long (max 120 characters)."))
@@ -88,7 +88,7 @@ func (s *Server) handleSectionSave(w http.ResponseWriter, r *http.Request) {
fail(s.tr(r, "Announcement is too long (20 KB max)."))
return
}
- sec.BodyMD = appendImageMD(sec.BodyMD, img)
+ sec.BodyMD = appendFileMD(sec.BodyMD, img)
sec.BodyHTML = markdown.Render(sec.BodyMD)
if sec.ID == 0 {
sec, err = blogStore(r).CreateSection(r.Context(), sec)