diff --git a/static/resources_list.txt b/static/resources_list.txt index cf11aa3d8..4d48e7287 100644 --- a/static/resources_list.txt +++ b/static/resources_list.txt @@ -1,6 +1,7 @@ skin/caret.png skin/bittorrent.png skin/magnet.png +skin/feed.png skin/download.png skin/hash.png skin/search-icon.svg diff --git a/static/skin/feed.png b/static/skin/feed.png new file mode 100644 index 000000000..5176e7bf6 Binary files /dev/null and b/static/skin/feed.png differ diff --git a/static/skin/index.css b/static/skin/index.css index f6e16be20..ae9294fa2 100644 --- a/static/skin/index.css +++ b/static/skin/index.css @@ -441,6 +441,13 @@ body { width: auto; } +.feedLogo { + margin: 16px 12px 0 0; + height: 30px; + float: right; + border-radius: 5px; +} + @media screen and (max-width: 1100px) { .kiwixHomeBody { @@ -482,4 +489,8 @@ body { .kiwixNav__filters { grid-template-columns: 1fr; } + + .feedLogo { + display: none; + } } diff --git a/static/skin/index.js b/static/skin/index.js index 7f29b316e..036e18516 100644 --- a/static/skin/index.js +++ b/static/skin/index.js @@ -18,6 +18,19 @@ let timer; let languages = {}; + function updateFeedLink() { + const inputParams = new URLSearchParams(window.location.search); + const filteredParams = new URLSearchParams(); + for (const [key, value] of inputParams) { + if ( value != '' ) { + filteredParams.append(key, value); + } + } + const feedLink = `${root}/catalog/v2/entries?${filteredParams.toString()}`; + document.querySelector('#headFeedLink').href = feedLink; + document.querySelector('#feedLink').href = feedLink; + } + function queryUrlBuilder() { let url = `${root}/catalog/search?`; url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&"); @@ -363,6 +376,7 @@ setCookie(filterCookieName, params.toString()); } updateFilterColors(); + updateFeedLink(); await loadAndDisplayBooks(true); } @@ -492,6 +506,7 @@ langFilter.dispatchEvent(new Event('change')); } } + updateFeedLink(); setCookie(filterCookieName, params.toString()); } })(); diff --git a/static/templates/index.html b/static/templates/index.html index 2bd067a23..0274e9a3a 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -10,6 +10,13 @@ href="{{root}}/skin/index.css?KIWIXCACHEID" rel="Stylesheet" /> + @@ -35,6 +42,9 @@ + + +
diff --git a/test/server.cpp b/test/server.cpp index c99e960e9..00519fbf9 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -61,9 +61,9 @@ const ResourceCollection resources200Compressible{ { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/i18n.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/i18n.js?cacheid=6da2bca0" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=316dbc21" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" }, - { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=2f5a81ac" }, + { STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=b0cc9d6b" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" }, { STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" }, { DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" }, @@ -268,7 +268,7 @@ TEST_F(ServerTest, CacheIdsOfStaticResources) const std::vector testData{ { /* url */ "/ROOT%23%3F/", -R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e" +R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=316dbc21" @@ -280,7 +280,8 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e" src: url("/ROOT%23%3F/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype"); - + + )EXPECTEDRESULT" }, {