Simplify plural code.
authorMike Taylor <mike@indexdata.com>
Wed, 20 Nov 2013 16:50:37 +0000 (16:50 +0000)
committerMike Taylor <mike@indexdata.com>
Wed, 20 Nov 2013 16:50:37 +0000 (16:50 +0000)
tools/htdocs/mkws.js

index 3769422..a369f2d 100644 (file)
@@ -569,10 +569,8 @@ function renderDetails(data, marker)
     details += renderField("Subject", data["location"][0]["md-subject"]);
     if (locations.length == 0) {
        details += '<tr><td colspan="2">No locations for record!</td></tr>';
-    } else if (locations.length == 1) {
-       details += renderField("Location", locations);
     } else {
-       details += renderField("Locations", locations);
+       details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations);
     }
     details += '</table></div>';