From b2b2fc3268f0f1a6f3bd0dffb011adc897834ff1 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Sun, 12 Sep 2021 11:31:43 +0300 Subject: [PATCH] feat: add originals and thumbnails folder for pictures --- controllers/threads_controller.go | 2 ++ templates/index.html | 2 +- templates/thread.html | 4 ++-- utils/utils.go | 11 +++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/controllers/threads_controller.go b/controllers/threads_controller.go index 463d1ba..877a71e 100644 --- a/controllers/threads_controller.go +++ b/controllers/threads_controller.go @@ -151,6 +151,7 @@ func CreateThread(c *gin.Context) { path := filepath.Join( Utils.UPLOADS_DIR_PATH, strconv.Itoa(postID), + "o", strconv.Itoa(fileID)+"."+file.Ext, ) err = c.SaveUploadedFile(fileInRequest, path) @@ -247,6 +248,7 @@ func UpdateThread(c *gin.Context) { path := filepath.Join( Utils.UPLOADS_DIR_PATH, strconv.Itoa(threadID), + "o", strconv.Itoa(fileID)+"."+file.Ext, ) err = c.SaveUploadedFile(fileInRequest, path) diff --git a/templates/index.html b/templates/index.html index e4d6427..aa12f20 100644 --- a/templates/index.html +++ b/templates/index.html @@ -24,7 +24,7 @@ {{ if gt $length 0 }} {{ $FirstFile := index $Post.Files 0 }} Uploaded picture diff --git a/templates/thread.html b/templates/thread.html index 85d4011..ee2db63 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -31,9 +31,9 @@
{{ range $File := $Post.Files }}