OPDS: добавлен раздел "Жанры", в поиск добавлен раздел "Поиск книг в жанре" (#9)
This commit is contained in:
@@ -15,6 +15,7 @@ class SearchPage extends BasePage {
|
||||
const query = {
|
||||
type: req.query.type || '',
|
||||
term: req.query.term || '',
|
||||
genre: req.query.genre || '',
|
||||
page: parseInt(req.query.page, 10) || 1,
|
||||
};
|
||||
|
||||
@@ -27,7 +28,7 @@ class SearchPage extends BasePage {
|
||||
|
||||
const limit = 100;
|
||||
const offset = (page - 1)*limit;
|
||||
const queryRes = await this.webWorker.search(from, {[from]: query.term, del: 0, offset, limit});
|
||||
const queryRes = await this.webWorker.search(from, {[from]: query.term, genre: query.genre, del: '0', offset, limit});
|
||||
|
||||
const found = queryRes.found;
|
||||
|
||||
@@ -98,6 +99,15 @@ class SearchPage extends BasePage {
|
||||
'*TEXT': `Искать по названиям книг`,
|
||||
},
|
||||
}),
|
||||
this.makeEntry({
|
||||
id: 'search_genre',
|
||||
title: 'Поиск книг в жанре',
|
||||
link: this.navLink({href: `/genre?from=search&term=${encodeURIComponent(query.term)}`}),
|
||||
content: {
|
||||
'*ATTRS': {type: 'text'},
|
||||
'*TEXT': `Искать по названиям книг в выбранном жанре`,
|
||||
},
|
||||
}),
|
||||
this.makeEntry({
|
||||
id: 'search_help',
|
||||
title: '[Памятка по поиску]',
|
||||
|
||||
Reference in New Issue
Block a user