diff --git a/Api/PostImages.go b/Api/PostImages.go index dea0442..ea1145b 100644 --- a/Api/PostImages.go +++ b/Api/PostImages.go @@ -74,10 +74,11 @@ func createPostImage(w http.ResponseWriter, r *http.Request) { } postImage = Models.PostImage{ - PostID: postUUID, - Filepath: fileObject.Filepath, - Mimetype: fileObject.Mimetype, - Size: fileObject.Size, + PostID: postUUID, + Filepath: fileObject.Filepath, + PublicFilepath: fileObject.PublicFilepath, + Mimetype: fileObject.Mimetype, + Size: fileObject.Size, } err = Database.CreatePostImage(&postImage) diff --git a/Api/Routes.go b/Api/Routes.go index edee089..761ad2e 100644 --- a/Api/Routes.go +++ b/Api/Routes.go @@ -46,5 +46,5 @@ func InitApiEndpoints(router *mux.Router) { api.HandleFunc("/admin/logout", Auth.Logout).Methods("GET") api.HandleFunc("/admin/me", Auth.Me).Methods("GET") - //router.PathPrefix("/").Handler(http.StripPrefix("/images/", http.FileServer(http.Dir("./uploads")))) + // router.PathPrefix("/").Handler(http.StripPrefix("/images/", http.FileServer(http.Dir("./uploads")))) } diff --git a/Frontend/Routes.go b/Frontend/Routes.go index 3ce773a..9124c2f 100644 --- a/Frontend/Routes.go +++ b/Frontend/Routes.go @@ -46,6 +46,11 @@ func InitFrontendRoutes(router *mux.Router) { HandlerFunc(indexHandler(indexPath)) } - router.PathPrefix("/").Handler(frontendFS) + router.PathPrefix("/public/"). + Handler(http.StripPrefix( + "/public/", + http.FileServer(http.Dir("./Frontend/public/")), + )) + router.PathPrefix("/").Handler(frontendFS) } diff --git a/Frontend/vue/package-lock.json b/Frontend/vue/package-lock.json index 55af1f8..c769c9f 100644 --- a/Frontend/vue/package-lock.json +++ b/Frontend/vue/package-lock.json @@ -20,6 +20,7 @@ "@vuepic/vue-datepicker": "^3.0.0", "axios": "^0.26.1", "bootstrap": "^5.1.3", + "bootstrap-vue-3": "^0.1.10", "core-js": "^3.8.3", "vee-validate": "^4.5.10", "vue": "^3.2.13", @@ -4131,6 +4132,17 @@ "@popperjs/core": "^2.10.2" } }, + "node_modules/bootstrap-vue-3": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/bootstrap-vue-3/-/bootstrap-vue-3-0.1.10.tgz", + "integrity": "sha512-r5zd5DIzclFpR16s6nwFRkZlrLoTANbZ9OWFFGoKLGcHOnL+WFuR8HULUB5QEyKdH5mf9ltTBCEsX/mFRq2S1w==", + "dependencies": { + "core-js": "3.x.x" + }, + "peerDependencies": { + "bootstrap": "5.x.x" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -15455,6 +15467,14 @@ "integrity": "sha512-fcQztozJ8jToQWXxVuEyXWW+dSo8AiXWKwiSSrKWsRB/Qt+Ewwza+JWoLKiTuQLaEPhdNAJ7+Dosc9DOIqNy7Q==", "requires": {} }, + "bootstrap-vue-3": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/bootstrap-vue-3/-/bootstrap-vue-3-0.1.10.tgz", + "integrity": "sha512-r5zd5DIzclFpR16s6nwFRkZlrLoTANbZ9OWFFGoKLGcHOnL+WFuR8HULUB5QEyKdH5mf9ltTBCEsX/mFRq2S1w==", + "requires": { + "core-js": "3.x.x" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", diff --git a/Frontend/vue/package.json b/Frontend/vue/package.json index 83b5906..2a0a3ec 100644 --- a/Frontend/vue/package.json +++ b/Frontend/vue/package.json @@ -21,6 +21,7 @@ "@vuepic/vue-datepicker": "^3.0.0", "axios": "^0.26.1", "bootstrap": "^5.1.3", + "bootstrap-vue-3": "^0.1.10", "core-js": "^3.8.3", "vee-validate": "^4.5.10", "vue": "^3.2.13", diff --git a/Frontend/vue/src/assets/css/admin.css b/Frontend/vue/src/assets/css/admin.css index 674c6e3..3824e01 100644 --- a/Frontend/vue/src/assets/css/admin.css +++ b/Frontend/vue/src/assets/css/admin.css @@ -133,3 +133,25 @@ label[role=alert] { .ProseMirror p:last-child { margin-bottom: 0; } + +.image-button-overlay { + position: relative; + top: 3rem; + z-index: 3; + width: 100%; + text-align: right; + padding-right: 1rem; +} + +.image-delete { + color: var(--bs-danger); + z-index: 3; + font-size: 1.6rem; + height: 2rem; + width: 2rem; + border-radius: 50%; +} + +.image-delete:hover { + background-color: white; +} diff --git a/Frontend/vue/src/components/admin/views/posts/AdminPostsForm.vue b/Frontend/vue/src/components/admin/views/posts/AdminPostsForm.vue index 13eb3e7..a3a5dd2 100644 --- a/Frontend/vue/src/components/admin/views/posts/AdminPostsForm.vue +++ b/Frontend/vue/src/components/admin/views/posts/AdminPostsForm.vue @@ -14,18 +14,26 @@ > Post Details + -