diff --git a/front/src/BookForm.vue b/front/src/BookForm.vue index 67966b5..7530207 100644 --- a/front/src/BookForm.vue +++ b/front/src/BookForm.vue @@ -3,7 +3,6 @@ import { ref, computed } from 'vue' import { getBook, getImagePathOrDefault, - putReadBook, putWantReadBook, putRateBook, putStartReadDate, @@ -15,6 +14,7 @@ import { import { useRouter, onBeforeRouteUpdate } from 'vue-router' import { VRating } from 'vuetify/components/VRating' import BookFormIcons from './BookFormIcons.vue' +import ReviewModal from './ReviewModal.vue' const router = useRouter() const props = defineProps({ @@ -109,8 +109,9 @@ function goToAuthor() { :model-value="data.rating / 2" @update:modelValue="onRatingUpdate" active-color="bulma-body-color" - class="centered" + class="centered mt-2" /> +

{{ data.title }}

@@ -141,12 +142,6 @@ img { width: auto; } -.centered { - display: flex; - justify-content: center; - align-items: center; -} - @media (min-width: 1024px) { .left-panel { margin-left: 3rem; diff --git a/front/src/ReviewModal.vue b/front/src/ReviewModal.vue new file mode 100644 index 0000000..3f91c5c --- /dev/null +++ b/front/src/ReviewModal.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/front/src/locales/en.json b/front/src/locales/en.json index 7c452c3..44981d3 100644 --- a/front/src/locales/en.json +++ b/front/src/locales/en.json @@ -59,6 +59,7 @@ }, "bookform": { "error": "Error when loading book: {error}", + "reviewbtn": "My review", "read": "Read", "startread": "Started", "wantread": "Interested" diff --git a/front/src/locales/fr.json b/front/src/locales/fr.json index b87eac6..745bbb0 100644 --- a/front/src/locales/fr.json +++ b/front/src/locales/fr.json @@ -59,6 +59,7 @@ }, "bookform": { "error": "Erreur pendant le chargement du livre: {error}", + "reviewbtn": "Ma critique", "read": "Lu", "startread": "Commencé", "wantread": "À lire" diff --git a/front/src/styles/global.css b/front/src/styles/global.css index cd9df37..bb7e71e 100644 --- a/front/src/styles/global.css +++ b/front/src/styles/global.css @@ -1,3 +1,9 @@ .clickable { cursor: pointer; } + +.centered { + display: flex; + justify-content: center; + align-items: center; +} diff --git a/internal/dto/in.go b/internal/dto/in.go index 1abf66e..f27eafe 100644 --- a/internal/dto/in.go +++ b/internal/dto/in.go @@ -27,6 +27,7 @@ type UserBookPutUpdate struct { WantRead *bool `json:"wantread"` Rating *int `json:"rating"` StartDate *string `json:"startDate"` + Review *string `json:"review"` } type FileInfoPost struct { diff --git a/internal/routes/userbookputupdate.go b/internal/routes/userbookputupdate.go index adadb16..d2edceb 100644 --- a/internal/routes/userbookputupdate.go +++ b/internal/routes/userbookputupdate.go @@ -71,6 +71,9 @@ func PutUserBookHandler(ac appcontext.AppContext) { } updateRating(&userbook, &userBookPut) } + if userBookPut.Review != nil { + userbook.Review = *userBookPut.Review + } ac.Db.Save(&userbook) ac.C.String(http.StatusOK, "Success") }