X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=a369f2d85b406287d81fbbf3b27fd8437702e327;hb=3bab15c51acc37f065bcf7b14daa10287247b118;hp=eb88ebdf60c31290fe8e48b8b829fcd0ba326a47;hpb=451a039238c07a618679fe14ad1784180fcbc857;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index eb88ebd..a369f2d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -557,9 +557,9 @@ function renderDetails(data, marker) var details = '
'; if (marker) details += ''; - var sources = []; + var locations = []; for (var i in data.location) { - sources.push(data.location[i]['@name']); + locations.push(data.location[i]['@name']); } details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]); @@ -567,12 +567,10 @@ function renderDetails(data, marker) details += renderField("Author", data["md-author"]); details += renderField("URL", data["md-electronic-url"]); details += renderField("Subject", data["location"][0]["md-subject"]); - if (sources.length == 0) { + if (locations.length == 0) { details += ''; - } else if (sources.length == 1) { - details += renderField("Location", sources); } else { - details += renderField("Locations", sources); + details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations); } details += '
'+ marker + '
No locations for record!
';