diff --git a/client/components/Reader/RecentBooksPage/RecentBooksPage.vue b/client/components/Reader/RecentBooksPage/RecentBooksPage.vue
index ee47f324..d723a2f9 100644
--- a/client/components/Reader/RecentBooksPage/RecentBooksPage.vue
+++ b/client/components/Reader/RecentBooksPage/RecentBooksPage.vue
@@ -168,7 +168,7 @@
class="col column justify-center"
style="font-size: 75%; padding-left: 6px; border: 1px solid #cccccc; border-left: 0;"
>
-
+
@@ -179,6 +179,9 @@
@click="handleDel(item.key)"
>
+
+ {{ (archive ? 'Удалить окончательно' : 'Перенести в архив') }}
+
-
+
+
+ Восстановить из архива
+
@@ -440,7 +446,8 @@ class RecentBooksPage {
wordEnding(num, type = 0) {
const endings = [
['ов', '', 'а', 'а', 'а', 'ов', 'ов', 'ов', 'ов', 'ов'],
- ['й', 'я', 'и', 'и', 'и', 'й', 'й', 'й', 'й', 'й']
+ ['й', 'я', 'и', 'и', 'и', 'й', 'й', 'й', 'й', 'й'],
+ ['о', '', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о']
];
const deci = num % 100;
if (deci > 10 && deci < 20) {
@@ -452,7 +459,7 @@ class RecentBooksPage {
get header() {
const len = (this.tableData ? this.tableData.length : 0);
- return `${(this.search ? 'Найдено' : 'Всего')} ${len} файл${this.wordEnding(len)}${this.archive ? ' в архиве' : ''}`;
+ return `${(this.search ? `Найден${this.wordEnding(len, 2)}` : 'Всего')} ${len} файл${this.wordEnding(len)}${this.archive ? ' в архиве' : ''}`;
}
async downloadBook(fb2path, fullTitle) {
@@ -490,8 +497,8 @@ class RecentBooksPage {
}
async handleRestore(key) {
- await bookManager.delRecentBook({key});
- this.$root.notify.info('Перенесено в архив');
+ await bookManager.restoreRecentBook({key});
+ this.$root.notify.info('Восстановлено из архива');
}
loadBook(row) {
@@ -733,6 +740,21 @@ export default vueComponent(RecentBooksPage);
background-color: #FF3030;
}
+.restore-button {
+ width: 25px;
+ height: 20px;
+ position: absolute;
+ border-right: 1px solid #cccccc;
+ border-bottom: 1px solid #cccccc;
+ border-radius: 0 0 10px 0;
+ margin: 1px;
+}
+
+.restore-button:hover {
+ color: white;
+ background-color: #00bb00;
+}
+
.header-button, .header-button-pressed {
width: 80px;
height: 30px;
diff --git a/client/components/Reader/share/bookManager.js b/client/components/Reader/share/bookManager.js
index 9ff19dca..cc7d76f9 100644
--- a/client/components/Reader/share/bookManager.js
+++ b/client/components/Reader/share/bookManager.js
@@ -445,6 +445,13 @@ class BookManager {
this.emit('recent-deleted', value.key);
}
+ async restoreRecentBook(value) {
+ const item = this.recent[value.key];
+ item.deleted = 0;
+
+ await this.recentSetItem(item);
+ }
+
async cleanRecentBooks() {
const sorted = this.getSortedRecent();