Добавлено отображение количества книг в поиске
This commit is contained in:
@@ -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': `Поиск по названиям книг`,
|
||||
},
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user