X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=a369f2d85b406287d81fbbf3b27fd8437702e327;hb=3bab15c51acc37f065bcf7b14daa10287247b118;hp=e41e165146ccf0718296397174e8c23ce30cbdad;hpb=12a0a25d50017b675e5ec81ddc1011dde30b5da6;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index e41e165..a369f2d 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -557,16 +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']); - } - if (sources.length == 0) { - details += ''; - } else if (sources.length == 1) { - details += renderField("Source", sources); - } else { - details += renderField("Sources", sources); + locations.push(data.location[i]['@name']); } details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]); @@ -574,7 +567,11 @@ 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"]); - details += renderField("Location", data["location"][0]["@name"], data["location"][0]["@id"]); + if (locations.length == 0) { + details += ''; + } else { + details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations); + } details += '
'+ marker + '
No sources for record!
No locations for record!
'; return details;