diff --git a/i18n/de.json b/i18n/de.json index 33db6a8..8584b10 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -10,6 +10,7 @@ "LABEL_CREATOR_ID": "Persönliche ID (wie ORCID, GND, ...)", "LABEL_CREATOR_LAST_NAME": "Nachname", "LABEL_CREATOR_REMOVE": "Autor entfernen", + "LABEL_CUSTOM_INSTITUTION": "benutzerdefinierte Institution", "LABEL_DESCRIPTION": "Zusammenfassung", "LABEL_EDUCATIONALLEVEL": "Bildungsstufe", "LABEL_EDUCATIONALLEVEL_CHOOSE": "Wähle eine Bildungsstufe ...", diff --git a/i18n/en.json b/i18n/en.json index 82a93dd..45ecd32 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -10,6 +10,7 @@ "LABEL_CREATOR_ID": "Personal ID (like ORCID, GND, ...)", "LABEL_CREATOR_LAST_NAME": "Lastname", "LABEL_CREATOR_REMOVE": "remove Author", + "LABEL_CUSTOM_INSTITUTION": "custom Institution", "LABEL_DESCRIPTION": "Abstract", "LABEL_EDUCATIONALLEVEL": "Level", "LABEL_EDUCATIONALLEVEL_CHOOSE": "Choose a level ...", diff --git a/metadata-generator.html b/metadata-generator.html index 1b0e6ea..1f5fbe7 100644 --- a/metadata-generator.html +++ b/metadata-generator.html @@ -461,7 +461,19 @@ } } - function addCreator(firstName = "", lastName = "", authorId = "", institution = "", organizationName = "", type = "Person") { + function changeAffiliationType(creatorListItem, type) { + const affiliationElements = creatorListItem.getElementsByClassName("inputAffiliation") + for (const element of affiliationElements) { + if (element.classList.contains("customAffiliation")) { + element.disabled = type !== "custom"; + } else { + element.disabled = type === "custom"; + } + } + $('.selectpicker').selectpicker('refresh'); + } + + function addCreator(firstName = "", lastName = "", authorId = "", institution = "", organizationName = "", type = "Person", affiliationName = "") { const creatorList = document.getElementById("creator-list"); const item = document.createElement("li"); item.setAttribute("class", "list-group-item"); @@ -469,6 +481,7 @@ $.each(vocabInstitutions, function (i, item) { institutionOptions += ''; }); + let customInstitutionSelected = institution === "" && affiliationName !== ""; let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : '' radioGroupName += 'x' @@ -501,13 +514,24 @@