Browse Source

Добавлено отображение количества книг в серии (раздел "Авторы")

Book Pauk 2 years ago
parent
commit
79f85f362a
1 changed files with 21 additions and 1 deletions
  1. 21 1
      client/components/Search/AuthorList/AuthorList.vue

+ 21 - 1
client/components/Search/AuthorList/AuthorList.vue

@@ -25,7 +25,7 @@
 
                 <div class="q-ml-sm text-bold" style="color: #555">
                     {{ getBookCount(item) }}
-                </div>                    
+                </div>
             </div>
 
             <div v-if="item.bookLoading" class="book-row row items-center">
@@ -54,6 +54,10 @@
                             <div class="clickable2 q-ml-xs q-py-sm text-bold" @click="selectSeries(book.series)">
                                 Серия: {{ book.series }}
                             </div>
+
+                            <div class="q-ml-sm text-bold" style="color: #555">
+                                {{ getSeriesBookCount(book) }}
+                            </div>
                         </div>
 
                         <div v-if="isExpandedSeries(book) && book.seriesBooks">
@@ -184,6 +188,22 @@ class AuthorList extends BaseList {
         return `(${result})`;
     }
 
+    getSeriesBookCount(book) {
+        let result = '';
+        if (!this.showCounts || book.type != 'series')
+            return result;
+
+        let count = book.seriesBooks.length;
+        result = `${count}`;
+        if (book.allBooksLoaded) {
+            if (book.showAllBooks)
+                result = `${book.allBooksLoaded.length}`;
+            result += `/${book.allBooksLoaded.length}`;
+        }
+
+        return `(${result})`;
+    }
+
     async expandAuthor(item) {
         this.$emit('listEvent', {action: 'ignoreScroll'});