diff --git a/metadata-generator.html b/metadata-generator.html index 33dc696..68b075b 100644 --- a/metadata-generator.html +++ b/metadata-generator.html @@ -528,6 +528,14 @@ institutionOptions += ''; organizationOptions += ''; }); + if (institution?.length > 0 && !vocabInstitutions.find((e) => e["ror"] === institution)) { + if (affiliationName?.length > 0) { + institutionOptions += ''; + } + if (organizationName?.length > 0) { + organizationOptions += ''; + } + } let customInstitutionSelected = institution === "" && affiliationName !== ""; let customOrganizationSelected = institution === "" && organizationName !== ""; let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : '' @@ -772,6 +780,7 @@ const aboutIds = data.about ? data.about.map(idMap) : []; const learningResourceTypeIds = data.learningResourceType ? data.learningResourceType.map(idMap) : []; const educationalLevelIds = data.educationalLevel ? data.educationalLevel.map(idMap) : []; + const licenseUrl = data.license ? idMap(data.license) : "" document.getElementById("inputStatus").value = data.creativeWorkStatus ? data.creativeWorkStatus : "Draft"; $("#datepicker1").datepicker("update", new Date(data.datePublished)); @@ -782,7 +791,7 @@ document.getElementById("inputDescription").value = data.description ? data.description : ""; $('#inputLanguage').val(data.inLanguage ? data.inLanguage : []).selectpicker('refresh'); $('#inputSubjectOf').val(aboutIds).selectpicker('refresh'); - setLicense((data.license && data.license.id) ? idMap(data.license) : "") + setLicense(licenseUrl) document.getElementById("inputImage").value = data.image ? data.image : ""; $('#inputResourceType').val(learningResourceTypeIds).selectpicker('refresh'); if (educationalLevelIds.length > 0) {