From dbded6eee2fc4497cfadd26055906b9a028e9f74 Mon Sep 17 00:00:00 2001 From: Nikhil Tanwar <2002nikhiltanwar@gmail.com> Date: Tue, 14 Feb 2023 00:32:22 +0530 Subject: [PATCH] Add links to content for tiles in /nojs If the tiles are now clicked, they redirect to main page of book. --- src/html_dumper.cpp | 5 +++++ static/templates/no_js_library_page.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/html_dumper.cpp b/src/html_dumper.cpp index 6674080a2..277dc92ec 100644 --- a/src/html_dumper.cpp +++ b/src/html_dumper.cpp @@ -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}, diff --git a/static/templates/no_js_library_page.html b/static/templates/no_js_library_page.html index 2db51a0d6..3494bd74d 100644 --- a/static/templates/no_js_library_page.html +++ b/static/templates/no_js_library_page.html @@ -51,7 +51,7 @@