diff --git a/client/components/Search/BookView/BookView.vue b/client/components/Search/BookView/BookView.vue index c1a66c4..f34fd55 100644 --- a/client/components/Search/BookView/BookView.vue +++ b/client/components/Search/BookView/BookView.vue @@ -1,6 +1,29 @@ @@ -45,7 +70,9 @@ class BookView { genreTree: Array, }; + showRate = true; showGenres = true; + showDeleted = false; created() { this.loadSettings(); @@ -54,7 +81,9 @@ class BookView { loadSettings() { const settings = this.settings; + this.showRate = settings.showRate; this.showGenres = settings.showGenres; + this.showDeleted = settings.showDeleted; } get settings() { @@ -71,6 +100,14 @@ class BookView { return `${size.toFixed(0)}${unit}`; } + get rateColor() { + const rate = (this.book.librate > 5 ? 5 : this.book.librate); + if (rate > 2) + return `green-${(rate - 1)*2}`; + else + return `red-${10 - rate*2}`; + } + get bookGenre() { let result = []; const genre = new Set(this.book.genre.split(',')); diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 1f64523..3387c2b 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -214,7 +214,8 @@ /> - + + @@ -284,6 +285,9 @@ const componentOptions = { showCounts(newValue) { this.setSetting('showCounts', newValue); }, + showRate(newValue) { + this.setSetting('showRate', newValue); + }, showGenres(newValue) { this.setSetting('showGenres', newValue); }, @@ -337,7 +341,8 @@ class Search { expanded = []; expandedSeries = []; showCounts = true; - showGenres = true; + showRate = true; + showGenres = true; showDeleted = false; abCacheEnabled = true; langDefault = ''; @@ -402,6 +407,7 @@ class Search { this.expanded = _.cloneDeep(settings.expanded); this.expandedSeries = _.cloneDeep(settings.expandedSeries); this.showCounts = settings.showCounts; + this.showRate = settings.showRate; this.showGenres = settings.showGenres; this.showDeleted = settings.showDeleted; this.abCacheEnabled = settings.abCacheEnabled; @@ -1228,6 +1234,6 @@ export default vueComponent(Search); } .book-row { - margin-left: 70px; + margin-left: 50px; } diff --git a/client/quasar.js b/client/quasar.js index d7093f1..055d66b 100644 --- a/client/quasar.js +++ b/client/quasar.js @@ -35,6 +35,7 @@ import {QTree} from 'quasar/src/components/tree'; //import {QVirtualScroll} from 'quasar/src/components/virtual-scroll'; //import {QExpansionItem} from 'quasar/src/components/expansion-item'; import {QOptionGroup} from 'quasar/src/components/option-group'; +import {QKnob} from 'quasar/src/components/knob'; const components = { @@ -68,6 +69,7 @@ const components = { //QExpansionItem, //QVirtualScroll, QOptionGroup, + QKnob, }; //directives diff --git a/client/store/root.js b/client/store/root.js index 19ae796..b808aa8 100644 --- a/client/store/root.js +++ b/client/store/root.js @@ -7,6 +7,7 @@ const state = { expanded: [], expandedSeries: [], showCounts: true, + showRate: true, showGenres: true, showDeleted: false, abCacheEnabled: true,