mirror of
https://gitlab.com/comenius-institut/foerbico/metadata-form.git
synced 2025-12-09 16:24:30 +00:00
use selectpicker, vocab, ror for institutions
This commit is contained in:
parent
8c994dab41
commit
137e73af5c
3 changed files with 53 additions and 39 deletions
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"FORM_HEADING": "OER Metadaten Formular",
|
||||
"LABEL_CHOOSE": "Wähle ...",
|
||||
"LABEL_CREATOR": "Autor",
|
||||
"LABEL_CREATOR_ADD": "weiteren Autor hinzufügen",
|
||||
"LABEL_CREATOR_GIVEN_NAME": "Vorname",
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
"LABEL_LICENSE_CHECKBOX_ND": "darf verändert werden",
|
||||
"LABEL_LICENSE_CHECKBOX_NC": "darf kommerziell genutzt werden",
|
||||
"LABEL_MANDATORY_FIELD": "Pflichtfeld",
|
||||
"LABEL_ORGANIZATION": "Institution",
|
||||
"LABEL_STATUS": "Status",
|
||||
"LABEL_STATUS_DRAFT": "Entwurf",
|
||||
"LABEL_STATUS_INCOMPLETE": "Unvollständig",
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@
|
|||
margin-top: 7px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.input-dropdown {
|
||||
background: #F1F6DF;
|
||||
color: #0A1F40;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
|
@ -83,9 +88,9 @@
|
|||
<label for="inputStatus" class="col-sm-2 col-form-label" data-i18n="LABEL_STATUS">Status</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" id="inputStatus" required>
|
||||
<option value="Published" data-i18n="LABEL_STATUS_PUBLISHED">Veröffentlicht</option>
|
||||
<option value="Draft" data-i18n="LABEL_STATUS_DRAFT">Entwurf</option>
|
||||
<option value="Draft" data-i18n="LABEL_STATUS_DRAFT" selected>Entwurf</option>
|
||||
<option value="Incomplete" data-i18n="LABEL_STATUS_INCOMPLETE">Unvollständig</option>
|
||||
<option value="Published" data-i18n="LABEL_STATUS_PUBLISHED">Veröffentlicht</option>
|
||||
</select>
|
||||
<div class="valid-feedback"></div>
|
||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||
|
|
@ -185,40 +190,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputFunder" class="col-sm-2 col-form-label">Institution</label>
|
||||
<label for="inputSourceOrganization" class="col-sm-2 col-form-label" data-i18n="LABEL_ORGANIZATION">Institution</label>
|
||||
<div class="col-sm-10">
|
||||
<select style="background: #F1F6DF; color: #0A1F40;" class="custom-select" id="inputFunder">
|
||||
<option selected>Wähle ...</option>
|
||||
<option value="TUBS">Braunschweig - Technische Universität</option>
|
||||
<option value="HSBS">Braunschweig - Hochschule für Bildende Künste</option>
|
||||
<option value="TUCZ">Clausthal-Zellerfeld - Technische Universität</option>
|
||||
<option value="JHEF">Elsfleth - Jade Hochschule</option>
|
||||
<option value="HSELE">Emden - Hochschule Emden/Leer</option>
|
||||
<option value="GAUG">Göttingen - Georg August Universität</option>
|
||||
<option value="HSG">Göttingen - Hochschule für angewandte Wissenschaft und Kust</option>
|
||||
<option value="LUH">Hannover - Leibniz Universität</option>
|
||||
<option value="HSH">Hannover - Hochschule</option>
|
||||
<option value="MHH">Hannover - Medizinische Hochschule</option>
|
||||
<option value="TIB">Hannover - Technische Informationsbibliothek (TIB)</option>
|
||||
<option value="THH">Hannover - Tierärztliche Hochschule</option>
|
||||
<option value="HSMTMH">Hannover - Hochschule für Musik, Theater und Medien</option>
|
||||
<option value="SUHI">Hildesheim - Stiftung Universität</option>
|
||||
<option value="AWKHI">Hildesheim - Hochschule für angewandte Wissenschaft und Kust</option>
|
||||
<option value="NHRHI">Hildesheim - Norddeutsche Hochschule für Rechtspflege</option>
|
||||
<option value="AWKHO">Holzminden - Hochschule für angewandte Wissenschaft und Kust</option>
|
||||
<option value="HSELL">Leer - Hochschule Emden/Leer</option>
|
||||
<option value="HSOSLI">Lingen - Hochschule Osnabrück</option>
|
||||
<option value="LULU">Lüneburg - Leuphana Universität</option>
|
||||
<option value="COUOL">Oldenburg - Carl von Ossietzky Universität</option>
|
||||
<option value="JHOL">Oldenburg - Jade Hochschule</option>
|
||||
<option value="UOS">Osnabrück - Universität Osnabrück</option>
|
||||
<option value="HSOS">Osnabrück - Hochschule Osnabrück</option>
|
||||
<option value="OHAWSZ">Salzgitter - Ostfalia Hochschule für angewandte Wissenschaften</option>
|
||||
<option value="OHAWSU">Suderburg - Ostfalia Hochschule für angewandte Wissenschaften</option>
|
||||
<option value="UVE">Vechta - Universität Vechta</option>
|
||||
<option value="JHWH">Wilhelmshaven - Jade Hochschule</option>
|
||||
<option value="OHAWWF">Wolfenbüttel - Ostfalia Hochschule für angewandte Wissenschaften</option>
|
||||
<option value="OHAWWO">Wolfsburg - Ostfalia Hochschule für angewandte Wissenschaften</option>
|
||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputSourceOrganization" data-live-search="true">
|
||||
<option value="" selected data-i18n="LABEL_CHOOSE">Wähle ...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -291,9 +266,9 @@
|
|||
|
||||
<script>
|
||||
loadVocabs()
|
||||
i18nLoader()
|
||||
chooseLicense()
|
||||
addCreator()
|
||||
i18nLoader()
|
||||
|
||||
function loadVocabs() {
|
||||
$(document).ready(function () {
|
||||
|
|
@ -307,6 +282,11 @@
|
|||
$("#inputLanguage").append('<option value="' + item + '" data-i18n="' + item + '"></option>');
|
||||
});
|
||||
});
|
||||
$.getJSON("vocabs/organizations.json", function (result) {
|
||||
$.each(result, function (i, item) {
|
||||
$("#inputSourceOrganization").append('<option value="' + item["ror"] + '">' + item["label"] + '</option>');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -518,15 +498,23 @@
|
|||
}
|
||||
|
||||
function generate() {
|
||||
const inputSourceOrganization = document.getElementById("inputSourceOrganization");
|
||||
var meta = "---\n"
|
||||
meta += "name: \"" + document.getElementById("inputTitle").value + "\"\n"
|
||||
meta += "creator:\n"
|
||||
meta += getCreators().map((c) => " - name: \"" + c.name + "\"" + (c.creatorId ? "\n id: \"" + c.creatorId + "\"" : "")).join("\n") + "\n"
|
||||
meta += "keywords:\n"
|
||||
meta += splitKeywords(document.getElementById("inputTags").value)
|
||||
if (document.getElementById("inputTags").value) {
|
||||
meta += "keywords:\n"
|
||||
meta += splitKeywords(document.getElementById("inputTags").value)
|
||||
}
|
||||
meta += "description: \"" + document.getElementById("inputDescription").value + "\"\n"
|
||||
meta += "inLanguage: \"" + document.getElementById("inputLanguage").value + "\"\n"
|
||||
meta += "funder: \"" + document.getElementById("inputFunder").value + "\"\n"
|
||||
if (inputSourceOrganization.value) {
|
||||
meta += "sourceOrganization:\n"
|
||||
meta += " - name: \"" + inputSourceOrganization.options[inputSourceOrganization.selectedIndex].innerHTML + "\"\n"
|
||||
meta += " id: \"" + inputSourceOrganization.value + "\"\n"
|
||||
meta += " type: \"Organization\"\n"
|
||||
}
|
||||
meta += "subjectOf: \"" + document.getElementById("inputSubjectOf").value + "\"\n"
|
||||
meta += "version: 1.0\n"
|
||||
meta += "license: \"" + document.getElementById("licenseUrl").value + "\"\n"
|
||||
|
|
@ -579,6 +567,7 @@
|
|||
const k = element.getAttribute("data-i18n-placeholder");
|
||||
element.setAttribute("placeholder", i18next.t(k));
|
||||
}
|
||||
$('.selectpicker').selectpicker('refresh');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
23
vocabs/organizations.json
Normal file
23
vocabs/organizations.json
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[
|
||||
{"ror": "https://ror.org/010nsgg66", "label": "Technische Universität Braunschweig"},
|
||||
{"ror": "https://ror.org/03aft2f80", "label": "Hochschule für Bildende Künste Braunschweig"},
|
||||
{"ror": "https://ror.org/04qb8nc58", "label": "Technische Universität Clausthal"},
|
||||
{"ror": "https://ror.org/02vvvm705", "label": "Jade Hochschule Wilhelmshaven/Oldenburg/Elsfleth"},
|
||||
{"ror": "https://ror.org/01bc76c69", "label": "Hochschule Emden/Leer"},
|
||||
{"ror": "https://ror.org/01y9bpm73", "label": "Georg-August-Universität Göttingen"},
|
||||
{"ror": "https://ror.org/00f5q5839", "label": "Hochschule für angewandte Wissenschaft und Kunst Hildesheim/Holzminden/Göttingen"},
|
||||
{"ror": "https://ror.org/0304hq317", "label": "Leibniz Universität Hannover"},
|
||||
{"ror": "https://ror.org/03m2kj587", "label": "Hochschule Hannover"},
|
||||
{"ror": "https://ror.org/00f2yqf98", "label": "Medizinische Hochschule Hannover"},
|
||||
{"ror": "https://ror.org/04aj4c181", "label": "Technische Informationsbibliothek (TIB)"},
|
||||
{"ror": "https://ror.org/015qjqf64", "label": "Tierärztliche Hochschule Hannover"},
|
||||
{"ror": "https://ror.org/00x67m532", "label": "Hochschule für Musik, Theater und Medien Hannover"},
|
||||
{"ror": "https://ror.org/02f9det96", "label": "Universität Hildesheim"},
|
||||
{"ror": "https://ror.org/02743t710", "label": "Norddeutsche Hochschule für Rechtspflege"},
|
||||
{"ror": "https://ror.org/059vymd37", "label": "Hochschule Osnabrück"},
|
||||
{"ror": "https://ror.org/04qmmjx98", "label": "Universität Osnabrück"},
|
||||
{"ror": "https://ror.org/02w2y2t16", "label": "Leuphana Universität Lüneburg"},
|
||||
{"ror": "https://ror.org/033n9gh91", "label": "Carl von Ossietzky Universität Oldenburg"},
|
||||
{"ror": "https://ror.org/01bk10867", "label": "Ostfalia Hochschule für angewandte Wissenschaften"},
|
||||
{"ror": "https://ror.org/045y6d111", "label": "Universität Vechta"}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue