From cd5a61e06f396c3c8ac179270472dac662662886 Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Mon, 27 Aug 2018 12:17:58 -0400 Subject: [PATCH 1/5] Fix plurality of mementos and resources on main replay page. Closes #534 --- ipwb/assets/webui.js | 4 ---- ipwb/replay.py | 6 +++++- ipwb/templates/index.html | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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..a996594a 100755 --- a/ipwb/replay.py +++ b/ipwb/replay.py @@ -552,9 +552,13 @@ def showAdmin(): def showLandingPage(): iFile = ipwbUtils.getIPWBReplayIndexPath() (mCount, uniqueURIRs) = retrieveMemCount(iFile) + urimPlurality = 'memento' if mCount == 1 else 'mementos' + urirPlurality = 'resource' if uniqueURIRs == 1 else 'resources' summary = {'indexPath': iFile, 'urimCount': mCount, - 'urirCount': uniqueURIRs} + 'urirCount': uniqueURIRs, + 'urimPlurality': urimPlurality, + 'urirPlurality': urirPlurality} uris = getURIsAndDatetimesInCDXJ(iFile) return render_template('index.html', summary=summary, uris=uris) diff --git a/ipwb/templates/index.html b/ipwb/templates/index.html index b4f94055..a975a2da 100644 --- a/ipwb/templates/index.html +++ b/ipwb/templates/index.html @@ -49,7 +49,7 @@

ipwb