diff --git a/ipwb/assets/webui.js b/ipwb/assets/webui.js index 6ad4c841..4a8c70f7 100644 --- a/ipwb/assets/webui.js +++ b/ipwb/assets/webui.js @@ -131,12 +131,8 @@ function setShowURIsVisibility () { } function setPlurality () { - const urimCount = document.getElementById('memCountInt').innerHTML const htmlFilesPlurality = document.getElementById('htmlPages').innerHTML - if (urimCount === '1') { - document.getElementById('plural').classList.add('hidden') - } if (htmlFilesPlurality === '1') { document.getElementById('htmlPagesPlurality').classList.add('hidden') } diff --git a/ipwb/replay.py b/ipwb/replay.py index 52859d74..9bc125ab 100755 --- a/ipwb/replay.py +++ b/ipwb/replay.py @@ -68,6 +68,11 @@ IPFS_API = ipfsapi.Client(IPFSAPI_HOST, IPFSAPI_PORT) +@app.context_processor +def formatters(): + return {'pluralize': lambda x, s, p: "{} {}".format(x, s if x == 1 else p)} + + @app.after_request def setServerHeader(response): response.headers['Server'] = 'InterPlanetary Wayback Replay/' + ipwbVersion diff --git a/ipwb/templates/index.html b/ipwb/templates/index.html index b4f94055..f4c3a40b 100644 --- a/ipwb/templates/index.html +++ b/ipwb/templates/index.html @@ -49,7 +49,7 @@

ipwb