Skip to content

Commit

Permalink
feat: add possibility to write reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
bayang committed Jul 26, 2022
1 parent ed09f51 commit b9611d1
Show file tree
Hide file tree
Showing 39 changed files with 1,805 additions and 159 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ All your data is now located into a single-file database which can be saved anyw
* Provide some stats about your readings
* Multi user support
* provides an API
* Write reviews and share them, see the reviews of other users on your instance

## Usage

Expand Down Expand Up @@ -167,6 +168,10 @@ Embed code and preview :

![](screenshots/embed.png)

Review creation :

![](screenshots/review_modal.jpg)

## Roadmap

* Koreader integration (https://koreader.rocks/)
Expand Down
Binary file added screenshots/review_modal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 37 additions & 2 deletions src/jelu-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/jelu-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"vue-chartjs": "^4.1.0",
"vue-i18n": "^9.1.9",
"vue-router": "4.0.14",
"vue-star-rating": "^2.1.0",
"vue3-star-ratings": "^1.1.0",
"vuejs-sidebar-menu": "^1.0.0",
"vuex": "^4.0.2"
},
Expand Down
5 changes: 5 additions & 0 deletions src/jelu-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ store.dispatch('getUser')
// }
})
.catch(() => {
if (store.state.route != null && store.state.route.name === "review-detail") {
router.push(store.state.route)
initialLoad.value = false
return
}
initialLoad.value = false
console.log("catch in App")
router.push({ name: 'login' }).then(() => { console.log("ok nav") }).catch(() => { console.log("error nav") })
Expand Down
7 changes: 7 additions & 0 deletions src/jelu-ui/src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@
width: min(600px, 90vw);
}

.review-modal {
/* margin: 30px; */
@apply m-5 sm:p-5;
height: min(600px, 70vh);
width: min(600px, 85vw);
}

.small-cover {
@apply w-28;
}
Expand Down
49 changes: 29 additions & 20 deletions src/jelu-ui/src/components/BookCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,26 @@ watch(checked, (newVal, oldVal) => {
>
</figure>
</router-link>
<figure v-else>
<img
v-if="book.book.image"
:src="'/files/' + book.book.image"
alt="cover image"
class="object-fill"
:class="props.size === 'xl' ? 'h-96' : 'h-72'"
>
<img
v-else
src="../assets/placeholder_asset.jpg"
alt="cover placeholder"
class="h-72 object-fill"
>
</figure>
<router-link
v-else
:to="{ name: 'book-reviews', params: { bookId: book.book.id } }"
>
<figure>
<img
v-if="book.book.image"
:src="'/files/' + book.book.image"
alt="cover image"
class="object-fill"
:class="props.size === 'xl' ? 'h-96' : 'h-72'"
>
<img
v-else
src="../assets/placeholder_asset.jpg"
alt="cover placeholder"
class="h-72 object-fill"
>
</figure>
</router-link>
<div
v-if="showProgressBar(book)"
class="bg-success absolute h-1.5"
Expand Down Expand Up @@ -188,13 +193,17 @@ watch(checked, (newVal, oldVal) => {
{{ book.book.title }}
</h2>
</router-link>
<h2
<router-link
v-else
v-tooltip="book.book.title"
class="card-title text-base max-h-11 line-clamp-2"
:to="{ name: 'book-reviews', params: { bookId: book.book.id } }"
>
{{ book.book.title }}
</h2>
<h2
v-tooltip="book.book.title"
class="card-title text-base max-h-11 line-clamp-2 hover:link"
>
{{ book.book.title }}
</h2>
</router-link>
<div v-if="book.book.authors != null && book.book.authors.length > 0">
<router-link
v-for="author in book.book.authors.slice(0,3)"
Expand Down
Loading

0 comments on commit b9611d1

Please sign in to comment.