diff --git a/server/core/opds/SearchPage.js b/server/core/opds/SearchPage.js index 239069d..589ae4b 100644 --- a/server/core/opds/SearchPage.js +++ b/server/core/opds/SearchPage.js @@ -1,4 +1,5 @@ const BasePage = require('./BasePage'); +const utils = require('../utils'); class SearchPage extends BasePage { constructor(config) { @@ -38,8 +39,12 @@ class SearchPage extends BasePage { entry.push( this.makeEntry({ id: row.id, - title: row[from], + title: `${(from === 'series' ? 'Серия: ': '')}${row[from]}`, link: this.navLink({href: `/${from}?${from}==${encodeURIComponent(row[from])}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': `${row.bookCount} книг${utils.wordEnding(row.bookCount, 8)}`, + }, }), ); } @@ -61,16 +66,28 @@ class SearchPage extends BasePage { id: 'search_author', title: 'Поиск авторов', link: this.navLink({href: `/${this.id}?type=author&term=${encodeURIComponent(query.term)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': `Поиск по авторам книг`, + }, }), this.makeEntry({ id: 'search_series', title: 'Поиск серий', link: this.navLink({href: `/${this.id}?type=series&term=${encodeURIComponent(query.term)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': `Поиск по сериям книг`, + }, }), this.makeEntry({ id: 'search_title', title: 'Поиск книг', link: this.navLink({href: `/${this.id}?type=title&term=${encodeURIComponent(query.term)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': `Поиск по названиям книг`, + }, }), ] }