Add links to content for tiles in /nojs

If the tiles are now clicked, they redirect to main page of book.
This commit is contained in:
Nikhil Tanwar 2023-02-14 00:32:22 +05:30
parent c1d7cc37fd
commit dbded6eee2
2 changed files with 6 additions and 1 deletions

View File

@ -39,12 +39,17 @@ std::string HTMLDumper::dumpPlainHTML() const
for ( const auto& bookId : library->getBooksIds() ) {
const auto bookObj = library->getBookById(bookId);
const auto bookTitle = bookObj.getTitle();
std::string contentId = "";
try {
contentId = urlEncode(nameMapper->getNameForId(bookId));
} catch (...) {}
const auto bookDescription = bookObj.getDescription();
const auto langCode = bookObj.getCommaSeparatedLanguages();
const auto bookIconUrl = rootLocation + "/catalog/v2/illustration/" + bookId + "/?size=48";
const auto tags = bookObj.getTags();
std::string faviconAttr = "style=background-image:url(" + bookIconUrl + ")";
booksData.push_back(kainjow::mustache::object{
{"id", contentId},
{"title", bookTitle},
{"description", bookDescription},
{"langCode", langCode},

View File

@ -51,7 +51,7 @@
<div class="book__list">
{{#books}}
<div class="book__wrapper">
<a class="book__link" href="#" title="Preview" aria-label="Preview">
<a class="book__link" href="{{root}}/content/{{id}}" title="Preview" aria-label="Preview">
<div class="book__link__wrapper">
<div class="book__icon" {{faviconAttr}}></div>
<div class="book__header">