From: Mike Taylor Date: Wed, 20 Nov 2013 16:50:37 +0000 (+0000) Subject: Simplify plural code. X-Git-Tag: 0.9.1~148^2~67 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=3bab15c51acc37f065bcf7b14daa10287247b118 Simplify plural code. --- diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 3769422..a369f2d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -569,10 +569,8 @@ function renderDetails(data, marker) details += renderField("Subject", data["location"][0]["md-subject"]); if (locations.length == 0) { details += 'No locations for record!'; - } else if (locations.length == 1) { - details += renderField("Location", locations); } else { - details += renderField("Locations", locations); + details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations); } details += '';