mirror of
https://gitlab.com/comenius-institut/foerbico/metadata-form.git
synced 2025-12-09 16:24:30 +00:00
Merge branch '11-apply-style-and-functions-from-course-catalogue-metadata-form' into 'master'
Apply style and functionality from course metadata form See merge request oersi/metadata-form!19
This commit is contained in:
commit
7daa937c85
3 changed files with 363 additions and 247 deletions
|
|
@ -47,5 +47,8 @@
|
||||||
"LABEL_NO_INSTITUTION_FOUND": "Keine passende Institution gefunden",
|
"LABEL_NO_INSTITUTION_FOUND": "Keine passende Institution gefunden",
|
||||||
"LABEL_DATE_PUBLISHED": "Veröffentlichungsdatum",
|
"LABEL_DATE_PUBLISHED": "Veröffentlichungsdatum",
|
||||||
"LABEL_SOFTWARE_LICENSE": "Software-Lizenz",
|
"LABEL_SOFTWARE_LICENSE": "Software-Lizenz",
|
||||||
"LABEL_CC_LICENSE": "CC-Lizenz"
|
"LABEL_CC_LICENSE": "CC-Lizenz",
|
||||||
|
"LABEL_METADATA_OUTPUT": "Generierte Metadaten",
|
||||||
|
"LABEL_RESET": "Zurücksetzen",
|
||||||
|
"LABEL_CONFIRM_RESET": "Möchten Sie wirklich alle Einträge zurücksetzen?"
|
||||||
}
|
}
|
||||||
|
|
@ -47,5 +47,8 @@
|
||||||
"LABEL_NO_INSTITUTION_FOUND": "No matching institution found",
|
"LABEL_NO_INSTITUTION_FOUND": "No matching institution found",
|
||||||
"LABEL_DATE_PUBLISHED": "Date published",
|
"LABEL_DATE_PUBLISHED": "Date published",
|
||||||
"LABEL_SOFTWARE_LICENSE": "Software license",
|
"LABEL_SOFTWARE_LICENSE": "Software license",
|
||||||
"LABEL_CC_LICENSE": "CC license"
|
"LABEL_CC_LICENSE": "CC license",
|
||||||
|
"LABEL_METADATA_OUTPUT": "Metadata output",
|
||||||
|
"LABEL_RESET": "Reset",
|
||||||
|
"LABEL_CONFIRM_RESET": "Do you really want to reset all entries?"
|
||||||
}
|
}
|
||||||
|
|
@ -34,54 +34,90 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-color: #0A1F40;
|
background-color: #0A1F40;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
.btn-outline-primary {
|
.btn-outline-primary {
|
||||||
color: #0A1F40;
|
color: #0A1F40;
|
||||||
border-color: #0A1F40;
|
border-color: #0A1F40;
|
||||||
}
|
}
|
||||||
.btn-outline-primary:not(:disabled):not(.disabled).active, .btn-outline-primary:not(:disabled):not(.disabled):active, .show > .btn-outline-primary.dropdown-toggle {
|
.btn-outline-primary:not(:disabled):not(.disabled).active, .btn-outline-primary:not(:disabled):not(.disabled):active, .show > .btn-outline-primary.dropdown-toggle {
|
||||||
background-color: #0A1F40;
|
background-color: #0A1F40;
|
||||||
border-color: #0A1F40;
|
border-color: #0A1F40;
|
||||||
}
|
}
|
||||||
.btn-outline-primary:hover {
|
.btn-outline-primary:hover {
|
||||||
background-color: #0A1F40;
|
background-color: #0A1F40;
|
||||||
border-color: #0A1F40;
|
border-color: #0A1F40;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
padding: 0 20px;
|
padding: 0 60px;
|
||||||
margin-bottom: 120px;
|
margin-bottom: 50px;
|
||||||
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-dropdown {
|
.input-dropdown {
|
||||||
background: #F1F6DF;
|
background: #F1F6DF;
|
||||||
color: #0A1F40;
|
color: #0A1F40;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||||
|
background-color: white;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow {
|
||||||
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 1400px) {
|
||||||
|
.dualpane {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
column-gap: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 1400px) {
|
||||||
|
.dualpane {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
row-gap: 40px;
|
||||||
|
}
|
||||||
|
.widescreen {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-light bg-light">
|
<nav class="navbar navbar-light bg-light shadow" style="display: flex; justify-content: space-between;">
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand">
|
||||||
<img src="logo.svg" height="50" width="116" alt="LOGO">
|
<img src="logo.svg" height="50" width="116" alt="LOGO">
|
||||||
</div>
|
</div>
|
||||||
<form class="form-inline ml-auto mr-3">
|
<div>
|
||||||
<button class="btn" type="button" data-toggle="modal" data-target="#importModal">Import</button>
|
<h2 data-i18n="FORM_HEADING">Kurskatalog Metadaten Formular</h2>
|
||||||
</form>
|
</div>
|
||||||
<ul class="navbar-nav">
|
<div class="form-inline">
|
||||||
<li class="nav-item dropdown">
|
<form class=" ml-auto mr-3">
|
||||||
<a class="nav-link dropdown-toggle" href="#" id="navbarLanguageDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn" type="button" data-toggle="modal" data-target="#importModal">Import</button>
|
||||||
<span id="selectedLanguageLabel">DE</span>
|
</form>
|
||||||
</a>
|
<ul class="navbar-nav">
|
||||||
<div class="dropdown-menu position-absolute dropdown-menu-right" aria-labelledby="navbarLanguageDropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="dropdown-item" onclick="changeLanguage('en')">English</a>
|
<a class="nav-link dropdown-toggle" href="#" id="navbarLanguageDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<a class="dropdown-item" onclick="changeLanguage('de')">Deutsch</a>
|
<span id="selectedLanguageLabel">DE</span>
|
||||||
</div>
|
</a>
|
||||||
</li>
|
<div class="dropdown-menu position-absolute dropdown-menu-right" aria-labelledby="navbarLanguageDropdown">
|
||||||
</ul>
|
<a class="dropdown-item" onclick="changeLanguage('en')">English</a>
|
||||||
|
<a class="dropdown-item" onclick="changeLanguage('de')">Deutsch</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="importModalLabel" aria-hidden="true">
|
<div class="modal fade" id="importModal" tabindex="-1" role="dialog" aria-labelledby="importModalLabel" aria-hidden="true">
|
||||||
|
|
@ -104,189 +140,208 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container main">
|
<div class="main">
|
||||||
<h2 style="margin-bottom:40px;" data-i18n="FORM_HEADING">OER Metadaten Formular</h2>
|
<div class="dualpane">
|
||||||
<form class="was-validated">
|
<!-- left side -->
|
||||||
<div class="form-group row">
|
<div style="flex: 2;" class="card">
|
||||||
<label for="inputTitle" class="col-sm-2 col-form-label" data-i18n="LABEL_TITLE">Titel</label>
|
<form id="metadata-form" class="was-validated">
|
||||||
<div class="col-sm-10">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" id="inputTitle" placeholder="Titel"
|
<label for="inputTitle" class="form-row col-form-label" data-i18n="LABEL_TITLE">Titel</label>
|
||||||
data-i18n-placeholder="LABEL_TITLE" value="" required>
|
<div class="form-row">
|
||||||
<div class="valid-feedback"></div>
|
<input type="text" class="form-control" id="inputTitle" placeholder="Titel"
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
data-i18n-placeholder="LABEL_TITLE" value="" oninput="generate()" required>
|
||||||
</div>
|
<div class="valid-feedback"></div>
|
||||||
</div>
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputDescription" class="col-sm-2 col-form-label"
|
|
||||||
data-i18n="LABEL_DESCRIPTION">Beschreibung</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<textarea class="form-control" id="inputDescription" placeholder="Beschreibung" data-i18n-placeholder="LABEL_DESCRIPTION"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputTags" class="col-sm-2 col-form-label" data-i18n="LABEL_KEYWORDS">Schlagworte</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" class="form-control" id="inputTags" placeholder="Komma getrennte Liste von Schlagworten"
|
|
||||||
data-i18n-placeholder="LABEL_KEYWORDS_PLACEHOLDER" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputEducationalLevel" class="col-sm-2 col-form-label" data-i18n="LABEL_EDUCATIONALLEVEL">Bildungsstufe</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputEducationalLevel" data-i18n-title="LABEL_EDUCATIONALLEVEL_CHOOSE" required multiple>
|
|
||||||
</select>
|
|
||||||
<div class="valid-feedback"></div>
|
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputResourceType" class="col-sm-2 col-form-label" data-i18n="LABEL_LEARNINGRESOURCETYPE">Materialart</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputResourceType" data-live-search="true" data-i18n-title="LABEL_LEARNINGRESOURCETYPE_CHOOSE" required multiple>
|
|
||||||
</select>
|
|
||||||
<div class="valid-feedback"></div>
|
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="creator-list" class="col-sm-2 col-form-label" data-i18n="LABEL_CREATOR">Autor</label>
|
|
||||||
<div class="col-sm-10 form-row">
|
|
||||||
<ul class="list-group col" id="creator-list">
|
|
||||||
<li class="list-group-item">
|
|
||||||
<button type="button" onclick="addCreator()" class="btn btn-primary"><i class="fa fa-plus"></i> <span
|
|
||||||
data-i18n="LABEL_CREATOR_ADD">Autor hinzufügen</span></button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputLanguage" class="col-sm-2 col-form-label" data-i18n="LABEL_LANGUAGE">Sprache</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputLanguage" data-i18n-title="LABEL_CHOOSE" required multiple>
|
|
||||||
</select>
|
|
||||||
<div class="valid-feedback"></div>
|
|
||||||
<div class="invalid-feedback">Pflichtfeld</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="choicesLicense" class="col-sm-2 col-form-label" data-i18n="LABEL_LICENSE">Lizenz</label>
|
|
||||||
<div class="col-sm-2">
|
|
||||||
<input type="radio" value="ccLicense" name="license" id="radioLicenseCC" onchange="ccOrSoftwareLicense()" checked>
|
|
||||||
<label data-i18n="LABEL_CC_LICENSE">CC-Lizenz</label>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-6" id="choicesLicense">
|
|
||||||
<div class="form-check">
|
|
||||||
<label class="form-check-label">
|
|
||||||
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseBY" value="BY"
|
|
||||||
checked>
|
|
||||||
<span data-i18n="LABEL_LICENSE_CHECKBOX_BY">darf ohne Namensnennung verwendet werden</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<label class="form-check-label">
|
|
||||||
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseSA" value="SA"
|
|
||||||
checked>
|
|
||||||
<span data-i18n="LABEL_LICENSE_CHECKBOX_SA">darf unter anderer Lizenz veröffentlicht werden</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<label class="form-check-label">
|
|
||||||
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseND" value="ND"
|
|
||||||
checked>
|
|
||||||
<span data-i18n="LABEL_LICENSE_CHECKBOX_ND">darf verändert werden</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<label class="form-check-label">
|
|
||||||
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseNC" value="NC"
|
|
||||||
checked>
|
|
||||||
<span data-i18n="LABEL_LICENSE_CHECKBOX_NC">darf kommerziell genutzt werden</span>
|
|
||||||
<input type="hidden" id="licenseUrl"
|
|
||||||
value="https://creativecommons.org/share-your-work/public-domain/cc0/">
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2">
|
<div class="form-group">
|
||||||
<label for="choicesLicense" id="choosenLicense" class="col-form-label">CC-0</label>
|
<label for="inputDescription" class="form-row col-form-label"
|
||||||
|
data-i18n="LABEL_DESCRIPTION">Beschreibung</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<textarea class="form-control" id="inputDescription" oninput="generate()" placeholder="Beschreibung" data-i18n-placeholder="LABEL_DESCRIPTION"></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label for="choicesLicense" class="col-sm-2 col-form-label"></label>
|
<div class="form-group">
|
||||||
<div class="col-sm-2" id="softwareLicense">
|
<label for="inputTags" class="form-row col-form-label" data-i18n="LABEL_KEYWORDS">Schlagworte</label>
|
||||||
<input type="radio" value="softwareLicenseInput" name="license" id="radioLicenseSoftware" onchange="ccOrSoftwareLicense()">
|
<div class="form-row">
|
||||||
<label data-i18n="LABEL_SOFTWARE_LICENSE">Software-Lizenz</label>
|
<input type="text" class="form-control" id="inputTags" placeholder="Komma getrennte Liste von Schlagworten"
|
||||||
|
data-i18n-placeholder="LABEL_KEYWORDS_PLACEHOLDER" value="" oninput="generate()">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8" style="padding-top: 1ch">
|
<div class="form-group">
|
||||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputSoftwareLicense" data-live-search="true" data-i18n-title="LABEL_LICENSE" required disabled>
|
<label for="inputEducationalLevel" class="form-row col-form-label" data-i18n="LABEL_EDUCATIONALLEVEL">Bildungsstufe</label>
|
||||||
</select>
|
<div class="form-row">
|
||||||
<div class="valid-feedback"></div>
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputEducationalLevel" data-i18n-title="LABEL_EDUCATIONALLEVEL_CHOOSE" required multiple>
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
</select>
|
||||||
|
<div class="valid-feedback"></div>
|
||||||
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group row">
|
<label for="inputResourceType" class="form-row col-form-label" data-i18n="LABEL_LEARNINGRESOURCETYPE">Materialart</label>
|
||||||
<label for="inputSubjectOf" class="col-sm-2 col-form-label" data-i18n="LABEL_SUBJECT">Fach</label>
|
<div class="form-row">
|
||||||
<div class="col-sm-10">
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputResourceType" data-live-search="true" data-i18n-title="LABEL_LEARNINGRESOURCETYPE_CHOOSE" required multiple>
|
||||||
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputSubjectOf" data-live-search="true" data-i18n-title="LABEL_CHOOSE" multiple>
|
</select>
|
||||||
</select>
|
<div class="valid-feedback"></div>
|
||||||
</div>
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputUrl" class="col-sm-2 col-form-label" data-i18n="LABEL_URL">URL</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="url" class="form-control" id="inputUrl" placeholder="URL" data-i18n-placeholder="LABEL_URL_PLACEHOLDER" value="">
|
|
||||||
<div class="valid-feedback"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<label for="inputImage" class="col-sm-2 col-form-label" data-i18n="LABEL_IMAGE_URL">Vorschaubild URL</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="url" class="form-control" id="inputImage" placeholder="Vorschaubild URL" data-i18n-placeholder="LABEL_IMAGE_URL" value="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row">
|
|
||||||
<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" onchange="createOrUpdateDatePicker()" required>
|
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group row" id="datePublishedFormGroup">
|
|
||||||
<label for="datePublished" class="col-sm-2 col-form-label" data-i18n="LABEL_DATE_PUBLISHED">Veröffentlichungsdatum</label>
|
|
||||||
<div class="col-sm-10 input-group date" id="datepicker1" data-target-input="nearest">
|
|
||||||
<input type="text" id="datepickerInput" class="form-control datepicker-input" data-target="#datepicker1"/>
|
|
||||||
<div class="input-group-append" data-target="#datepicker1" data-toggle="datepicker">
|
|
||||||
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
|
<label for="creator-list" class="form-row col-form-label" data-i18n="LABEL_CREATOR">Autor</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<ul class="list-group col" id="creator-list">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<button type="button" onclick="addCreator()" class="btn btn-primary"><i class="fa fa-plus"></i> <span
|
||||||
|
data-i18n="LABEL_CREATOR_ADD">Autor hinzufügen</span></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputLanguage" class="form-row col-form-label" data-i18n="LABEL_LANGUAGE">Sprache</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputLanguage" data-i18n-title="LABEL_CHOOSE" required multiple>
|
||||||
|
</select>
|
||||||
|
<div class="valid-feedback"></div>
|
||||||
|
<div class="invalid-feedback">Pflichtfeld</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="choicesLicense" class="form-row col-form-label" data-i18n="LABEL_LICENSE">Lizenz</label>
|
||||||
|
<div class="list-group-item">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<input type="radio" value="ccLicense" name="license" id="radioLicenseCC" onchange="ccOrSoftwareLicense()" checked>
|
||||||
|
<label data-i18n="LABEL_CC_LICENSE">CC-Lizenz</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-7" id="choicesLicense">
|
||||||
|
<div class="form-check">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseBY" value="BY"
|
||||||
|
checked>
|
||||||
|
<span data-i18n="LABEL_LICENSE_CHECKBOX_BY">darf ohne Namensnennung verwendet werden</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseSA" value="SA"
|
||||||
|
checked>
|
||||||
|
<span data-i18n="LABEL_LICENSE_CHECKBOX_SA">darf unter anderer Lizenz veröffentlicht werden</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseND" value="ND"
|
||||||
|
checked>
|
||||||
|
<span data-i18n="LABEL_LICENSE_CHECKBOX_ND">darf verändert werden</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<label class="form-check-label">
|
||||||
|
<input type="checkbox" onclick="chooseCCLicense()" class="form-check-input" id="inputLicenseNC" value="NC"
|
||||||
|
checked>
|
||||||
|
<span data-i18n="LABEL_LICENSE_CHECKBOX_NC">darf kommerziell genutzt werden</span>
|
||||||
|
<input type="hidden" id="licenseUrl"
|
||||||
|
value="https://creativecommons.org/share-your-work/public-domain/cc0/">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<label for="choicesLicense" id="choosenLicense" class="col-form-label">CC-0</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3" id="softwareLicense">
|
||||||
|
<input type="radio" value="softwareLicenseInput" name="license" id="radioLicenseSoftware" onchange="ccOrSoftwareLicense()">
|
||||||
|
<label data-i18n="LABEL_SOFTWARE_LICENSE">Software-Lizenz</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-9" style="padding-top: 1ch">
|
||||||
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputSoftwareLicense" data-live-search="true" data-i18n-title="LABEL_LICENSE" required disabled>
|
||||||
|
</select>
|
||||||
|
<div class="valid-feedback"></div>
|
||||||
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputSubjectOf" class="form-row col-form-label" data-i18n="LABEL_SUBJECT">Fach</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputSubjectOf" data-live-search="true" data-i18n-title="LABEL_CHOOSE" multiple>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputUrl" class="form-row col-form-label" data-i18n="LABEL_URL">URL</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<input type="url" class="form-control" id="inputUrl" placeholder="URL" data-i18n-placeholder="LABEL_URL_PLACEHOLDER" value="" oninput="generate()">
|
||||||
|
<div class="valid-feedback"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputImage" class="form-row col-form-label" data-i18n="LABEL_IMAGE_URL">Vorschaubild URL</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<input type="url" class="form-control" id="inputImage" placeholder="Vorschaubild URL" data-i18n-placeholder="LABEL_IMAGE_URL" value="" oninput="generate()">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="inputStatus" class="form-row col-form-label" data-i18n="LABEL_STATUS">Status</label>
|
||||||
|
<div class="form-row">
|
||||||
|
<select data-style="input-dropdown" data-width="100%" class="selectpicker" id="inputStatus" onchange="createOrUpdateDatePicker()" required>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" id="datePublishedFormGroup">
|
||||||
|
<label for="datePublished" class="form-row col-form-label" data-i18n="LABEL_DATE_PUBLISHED">Veröffentlichungsdatum</label>
|
||||||
|
<div class="form-row input-group date" id="datepicker1" data-target-input="nearest">
|
||||||
|
<input type="text" id="datepickerInput" class="form-control datepicker-input" data-target="#datepicker1"/>
|
||||||
|
<div class="input-group-append" data-target="#datepicker1" data-toggle="datepicker">
|
||||||
|
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<!-- right side -->
|
||||||
<button type="button" onclick="generate()" class="btn btn-primary"><i class="fa fa-arrow-down"></i> <span data-i18n="LABEL_GENERATE">Generieren</span></button>
|
<div style="flex: 1;">
|
||||||
</div>
|
<div class="card">
|
||||||
<div class="form-group">
|
<h3 style="text-align: center;" data-i18n="LABEL_METADATA_OUTPUT">Metadata output</h3>
|
||||||
<ul class="nav nav-tabs" id="outputTab" role="tablist">
|
|
||||||
<li class="nav-item" role="presentation">
|
<div class="form-group mt-4">
|
||||||
<button class="nav-link active" id="yaml-tab" data-toggle="tab" data-target="#yaml" type="button" role="tab" aria-controls="yaml" aria-selected="true">YAML</button>
|
<ul class="nav nav-tabs" id="outputTab" role="tablist">
|
||||||
</li>
|
<li class="nav-item" role="presentation">
|
||||||
<li class="nav-item" role="presentation">
|
<button class="nav-link active" id="yaml-tab" data-toggle="tab" data-target="#yaml" type="button" role="tab" aria-controls="yaml" aria-selected="true">YAML</button>
|
||||||
<button class="nav-link" id="json-tab" data-toggle="tab" data-target="#json" type="button" role="tab" aria-controls="json" aria-selected="false">JSON</button>
|
</li>
|
||||||
</li>
|
<li class="nav-item" role="presentation">
|
||||||
</ul>
|
<button class="nav-link" id="json-tab" data-toggle="tab" data-target="#json" type="button" role="tab" aria-controls="json" aria-selected="false">JSON</button>
|
||||||
<div class="tab-content" id="outputTabContent">
|
</li>
|
||||||
<div class="tab-pane fade show active" id="yaml" role="tabpanel" aria-labelledby="yaml-tab">
|
</ul>
|
||||||
<button type="button" disabled onclick="copy_generated_output('yaml_output')" class="btn btn-primary my-2" id="button_copy_generated_output_yaml"><i class="fa fa-copy"></i> YAML <span data-i18n="LABEL_COPY">Kopieren</span></button>
|
<div class="tab-content mt-1" id="outputTabContent">
|
||||||
<textarea class="form-control" rows="15" id="yaml_output"></textarea>
|
<div class="tab-pane fade show active" id="yaml" role="tabpanel" aria-labelledby="yaml-tab">
|
||||||
</div>
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<div class="tab-pane fade" id="json" role="tabpanel" aria-labelledby="json-tab">
|
<button type="button" disabled onclick="copy_generated_output('yaml_output')" class="btn btn-primary my-2" id="button_copy_generated_output_yaml"><i class="fa fa-copy"></i> YAML <span data-i18n="LABEL_COPY">Kopieren</span></button>
|
||||||
<button type="button" disabled onclick="copy_generated_output('json_output')" class="btn btn-primary my-2" id="button_copy_generated_output_json"><i class="fa fa-copy"></i> JSON <span data-i18n="LABEL_COPY">Kopieren</span></button>
|
<button type="button" onclick="resetForm()" class="btn btn-primary my-2"><i class="fa fa-rotate-left"></i> <span data-i18n="LABEL_RESET">Reset</span></button>
|
||||||
<textarea class="form-control" rows="15" id="json_output"></textarea>
|
</div>
|
||||||
|
<textarea class="form-control" rows="15" id="yaml_output"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane fade" id="json" role="tabpanel" aria-labelledby="json-tab">
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<button type="button" disabled onclick="copy_generated_output('json_output')" class="btn btn-primary my-2" id="button_copy_generated_output_json"><i class="fa fa-copy"></i> JSON <span data-i18n="LABEL_COPY">Kopieren</span></button>
|
||||||
|
<button type="button" onclick="resetForm();" class="btn btn-primary my-2"><i class="fa fa-rotate-left"></i> <span data-i18n="LABEL_RESET">Reset</span></button>
|
||||||
|
</div>
|
||||||
|
<textarea class="form-control" rows="15" id="json_output"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="copied_to_clipboard_toast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
|
<div id="copied_to_clipboard_toast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
|
||||||
|
|
@ -312,6 +367,9 @@
|
||||||
addSoftwareLicenses();
|
addSoftwareLicenses();
|
||||||
addCreator();
|
addCreator();
|
||||||
$("#inputEducationalLevel option[value='https://w3id.org/kim/educationalLevel/level_A']").attr("selected", "true");
|
$("#inputEducationalLevel option[value='https://w3id.org/kim/educationalLevel/level_A']").attr("selected", "true");
|
||||||
|
$('.selectpicker').on('change', function (e) {
|
||||||
|
generate();
|
||||||
|
});
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('.selectpicker').selectpicker('refresh');
|
||||||
|
|
||||||
var userLang = navigator.language || navigator.userLanguage;
|
var userLang = navigator.language || navigator.userLanguage;
|
||||||
|
|
@ -536,6 +594,8 @@
|
||||||
document.getElementById("licenseUrl").value = licenses[x].url
|
document.getElementById("licenseUrl").value = licenses[x].url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addSoftwareLicenses() {
|
function addSoftwareLicenses() {
|
||||||
|
|
@ -557,6 +617,7 @@
|
||||||
document.getElementById("inputSoftwareLicense").removeAttribute("disabled");
|
document.getElementById("inputSoftwareLicense").removeAttribute("disabled");
|
||||||
}
|
}
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('.selectpicker').selectpicker('refresh');
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function splitKeywords(keywordString) {
|
function splitKeywords(keywordString) {
|
||||||
|
|
@ -565,14 +626,28 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeCreatorType(creatorListItem, type) {
|
function changeCreatorType(creatorListItem, type) {
|
||||||
const personElements = creatorListItem.getElementsByClassName("person-element")
|
if (type === "Person") {
|
||||||
|
creatorListItem.getElementsByClassName("person-label")[0].classList.add("active");
|
||||||
|
creatorListItem.getElementsByClassName("person-radio")[0].setAttribute("checked", "true");
|
||||||
|
creatorListItem.getElementsByClassName("organization-label")[0].classList.remove("active");
|
||||||
|
creatorListItem.getElementsByClassName("organization-radio")[0].removeAttribute("checked");
|
||||||
|
} else {
|
||||||
|
creatorListItem.getElementsByClassName("person-label")[0].classList.remove("active");
|
||||||
|
creatorListItem.getElementsByClassName("person-radio")[0].removeAttribute("checked");
|
||||||
|
creatorListItem.getElementsByClassName("organization-label")[0].classList.add("active");
|
||||||
|
creatorListItem.getElementsByClassName("organization-radio")[0].setAttribute("checked", "true");
|
||||||
|
}
|
||||||
|
|
||||||
|
const personElements = creatorListItem.getElementsByClassName("person-element");
|
||||||
for (let i = 0; i < personElements.length; i++) {
|
for (let i = 0; i < personElements.length; i++) {
|
||||||
personElements[i].style.display = type === "Person" ? "flex" : "none"
|
personElements[i].style.display = type === "Person" ? "flex" : "none";
|
||||||
}
|
}
|
||||||
const organizationElements = creatorListItem.getElementsByClassName("organization-element")
|
const organizationElements = creatorListItem.getElementsByClassName("organization-element")
|
||||||
for (let i = 0; i < organizationElements.length; i++) {
|
for (let i = 0; i < organizationElements.length; i++) {
|
||||||
organizationElements[i].style.display = type === "Organization" ? "flex" : "none"
|
organizationElements[i].style.display = type === "Organization" ? "flex" : "none"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeAffiliationType(creatorListItem, type) {
|
function changeAffiliationType(creatorListItem, type) {
|
||||||
|
|
@ -585,6 +660,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('.selectpicker').selectpicker('refresh');
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeOrganizationType(creatorListItem, type) {
|
function changeOrganizationType(creatorListItem, type) {
|
||||||
|
|
@ -597,6 +673,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('.selectpicker').selectpicker('refresh');
|
$('.selectpicker').selectpicker('refresh');
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addCreator(firstName = "", lastName = "", authorId = "", institution = "", organizationName = "", type = "Person", affiliationName = "") {
|
function addCreator(firstName = "", lastName = "", authorId = "", institution = "", organizationName = "", type = "Person", affiliationName = "") {
|
||||||
|
|
@ -625,29 +702,29 @@
|
||||||
item.innerHTML = `
|
item.innerHTML = `
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="btn-group btn-group-toggle inputType" role="group" data-toggle="buttons">
|
<div class="btn-group btn-group-toggle inputType" role="group" data-toggle="buttons">
|
||||||
<label class="btn btn-outline-primary ${type === "Person" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Person')">
|
<label class="btn btn-outline-primary person-label ${type === "Person" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Person')">
|
||||||
<input type="radio" name="${radioGroupName}" ${type === "Person" ? "checked" : ""} value="Person"><span data-i18n="LABEL_PERSON">Person</span>
|
<input type="radio" class="person-radio" name="${radioGroupName}" ${type === "Person" ? "checked" : ""} value="Person"><span data-i18n="LABEL_PERSON">Person</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="btn btn-outline-primary ${type === "Organization" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Organization')">
|
<label class="btn btn-outline-primary organization-label ${type === "Organization" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Organization')">
|
||||||
<input type="radio" name="${radioGroupName}" ${type === "Organization" ? "checked" : ""} value="Organization"><span data-i18n="LABEL_ORGANIZATION">Organisation</span>
|
<input type="radio" class="organization-radio" name="${radioGroupName}" ${type === "Organization" ? "checked" : ""} value="Organization"><span data-i18n="LABEL_ORGANIZATION">Organisation</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row mt-3 person-element" ${type !== "Person" ? 'style="display:none;"':''}>
|
<div class="form-row mt-3 person-element" ${type !== "Person" ? 'style="display:none;"':''}>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type="text" class="form-control inputGivenName" placeholder="Vorname" data-i18n-placeholder="LABEL_CREATOR_GIVEN_NAME" value="${firstName}" required>
|
<input type="text" class="form-control inputGivenName" placeholder="Vorname" data-i18n-placeholder="LABEL_CREATOR_GIVEN_NAME" value="${firstName}" oninput="generate()" required >
|
||||||
<div class="valid-feedback"></div>
|
<div class="valid-feedback"></div>
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type="text" class="form-control inputFamilyName" placeholder="Nachname" data-i18n-placeholder="LABEL_CREATOR_LAST_NAME" value="${lastName}" required>
|
<input type="text" class="form-control inputFamilyName" placeholder="Nachname" data-i18n-placeholder="LABEL_CREATOR_LAST_NAME" value="${lastName}" oninput="generate()" required>
|
||||||
<div class="valid-feedback"></div>
|
<div class="valid-feedback"></div>
|
||||||
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
<div class="invalid-feedback" data-i18n="LABEL_MANDATORY_FIELD">Pflichtfeld</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row mt-2 person-element" ${type !== "Person" ? 'style="display:none;"':''}>
|
<div class="form-row mt-2 person-element" ${type !== "Person" ? 'style="display:none;"':''}>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<input type="url" class="form-control inputAuthorId" placeholder="Persönliche ID (optional, wie ORCID, GND)" data-i18n-placeholder="LABEL_CREATOR_ID" value="${authorId}">
|
<input type="url" class="form-control inputAuthorId" placeholder="Persönliche ID (optional, wie ORCID, GND)" data-i18n-placeholder="LABEL_CREATOR_ID" value="${authorId}" oninput="generate()">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -669,7 +746,7 @@
|
||||||
<input class="affiliationType" type="radio" name="institution_${radioGroupName}" aria-label="radio button for custom institution" ${customInstitutionSelected ? "checked":""} value="custom" onclick="changeAffiliationType(this.parentNode.parentNode.parentNode, 'custom')">
|
<input class="affiliationType" type="radio" name="institution_${radioGroupName}" aria-label="radio button for custom institution" ${customInstitutionSelected ? "checked":""} value="custom" onclick="changeAffiliationType(this.parentNode.parentNode.parentNode, 'custom')">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-11">
|
<div class="col-11">
|
||||||
<input type="text" ${customInstitutionSelected ? "":"disabled"} class="form-control customAffiliation inputAffiliation" placeholder="Institution" data-i18n-placeholder="LABEL_CUSTOM_INSTITUTION" value="${customInstitutionSelected ? affiliationName:""}">
|
<input type="text" ${customInstitutionSelected ? "":"disabled"} class="form-control customAffiliation inputAffiliation" placeholder="Institution" data-i18n-placeholder="LABEL_CUSTOM_INSTITUTION" value="${customInstitutionSelected ? affiliationName:""}" oninput="generate()">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -689,7 +766,7 @@
|
||||||
<input class="organizationType" type="radio" name="organization_${radioGroupName}" aria-label="radio button for organization list" ${customOrganizationSelected ? "checked":""} value="custom" onclick="changeOrganizationType(this.parentNode.parentNode.parentNode, 'custom')">
|
<input class="organizationType" type="radio" name="organization_${radioGroupName}" aria-label="radio button for organization list" ${customOrganizationSelected ? "checked":""} value="custom" onclick="changeOrganizationType(this.parentNode.parentNode.parentNode, 'custom')">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-11">
|
<div class="col-11">
|
||||||
<input type="text" ${customOrganizationSelected ? "":"disabled"} class="form-control customOrganization inputOrganization" placeholder="Institution" data-i18n-placeholder="LABEL_CUSTOM_INSTITUTION" value="${customOrganizationSelected ? organizationName:""}">
|
<input type="text" ${customOrganizationSelected ? "":"disabled"} class="form-control customOrganization inputOrganization" placeholder="Institution" data-i18n-placeholder="LABEL_CUSTOM_INSTITUTION" value="${customOrganizationSelected ? organizationName:""}" oninput="generate()">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -710,6 +787,7 @@
|
||||||
|
|
||||||
function removeCreator(creatorListItem) {
|
function removeCreator(creatorListItem) {
|
||||||
creatorListItem.parentNode.removeChild(creatorListItem);
|
creatorListItem.parentNode.removeChild(creatorListItem);
|
||||||
|
generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCreators() {
|
function getCreators() {
|
||||||
|
|
@ -728,16 +806,19 @@
|
||||||
} : undefined;
|
} : undefined;
|
||||||
} else {
|
} else {
|
||||||
organizationInput = creatorsElement[i].querySelector("select.inputOrganization");
|
organizationInput = creatorsElement[i].querySelector("select.inputOrganization");
|
||||||
organization = organizationInput ? {
|
let organizationName = organizationInput.options[organizationInput.selectedIndex].innerHTML;
|
||||||
name: organizationInput.options[organizationInput.selectedIndex].innerHTML,
|
organization = organizationInput && organizationName != "Choose Institution ..." ? {
|
||||||
|
name: organizationName,
|
||||||
id: organizationInput.value
|
id: organizationInput.value
|
||||||
} : undefined;
|
} : undefined;
|
||||||
}
|
}
|
||||||
creators.push({
|
if (organization) {
|
||||||
name: organization.name,
|
creators.push({
|
||||||
id: organization.id ? organization.id : undefined,
|
name: organization.name,
|
||||||
type: "Organization"
|
id: organization.id ? organization.id : undefined,
|
||||||
})
|
type: "Organization"
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const creatorId = creatorsElement[i].getElementsByClassName("inputAuthorId")[0].value;
|
const creatorId = creatorsElement[i].getElementsByClassName("inputAuthorId")[0].value;
|
||||||
const affiliationTypeElement = creatorsElement[i].querySelector("input.affiliationType:checked");
|
const affiliationTypeElement = creatorsElement[i].querySelector("input.affiliationType:checked");
|
||||||
|
|
@ -750,11 +831,13 @@
|
||||||
} : undefined
|
} : undefined
|
||||||
} else {
|
} else {
|
||||||
const affiliationInput = creatorsElement[i].querySelector("select.inputAffiliation");
|
const affiliationInput = creatorsElement[i].querySelector("select.inputAffiliation");
|
||||||
affiliation = affiliationInput.value ? {
|
affiliation = affiliationInput.value;
|
||||||
|
if (affiliation && affiliation != "Choose Institution ...")
|
||||||
|
affiliation = {
|
||||||
name: affiliationInput.options[affiliationInput.selectedIndex].innerHTML,
|
name: affiliationInput.options[affiliationInput.selectedIndex].innerHTML,
|
||||||
id: affiliationInput.value,
|
id: affiliationInput.value,
|
||||||
type: "Organization"
|
type: "Organization"
|
||||||
} : undefined
|
};
|
||||||
}
|
}
|
||||||
creators.push({
|
creators.push({
|
||||||
givenName: creatorsElement[i].getElementsByClassName("inputGivenName")[0].value.trim(),
|
givenName: creatorsElement[i].getElementsByClassName("inputGivenName")[0].value.trim(),
|
||||||
|
|
@ -779,6 +862,21 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetForm() {
|
||||||
|
if (window.confirm(i18next.t("LABEL_CONFIRM_RESET"))) {
|
||||||
|
document.getElementById("metadata-form").reset();
|
||||||
|
$('.selectpicker').on('change', function (e) {
|
||||||
|
generate();
|
||||||
|
});
|
||||||
|
$('.selectpicker').selectpicker('refresh');
|
||||||
|
setCreators();
|
||||||
|
chooseCCLicense();
|
||||||
|
ccOrSoftwareLicense();
|
||||||
|
createOrUpdateDatePicker(reset=true);
|
||||||
|
generate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function generate() {
|
function generate() {
|
||||||
const creators = getCreators()
|
const creators = getCreators()
|
||||||
const selectedLanguages = $('#inputLanguage').val();
|
const selectedLanguages = $('#inputLanguage').val();
|
||||||
|
|
@ -786,7 +884,7 @@
|
||||||
const selectedResourceTypes = $('#inputResourceType').val();
|
const selectedResourceTypes = $('#inputResourceType').val();
|
||||||
const selectedEducationalLevel = $('#inputEducationalLevel').val();
|
const selectedEducationalLevel = $('#inputEducationalLevel').val();
|
||||||
const identifier = document.getElementById("inputUrl").value;
|
const identifier = document.getElementById("inputUrl").value;
|
||||||
const datePublished = $("#datepicker1").datepicker("getDate");
|
const datePublished = $("#datepickerInput").datepicker("getDate");
|
||||||
let meta = {
|
let meta = {
|
||||||
"@context": "https://schema.org/",
|
"@context": "https://schema.org/",
|
||||||
creativeWorkStatus: document.getElementById("inputStatus").value,
|
creativeWorkStatus: document.getElementById("inputStatus").value,
|
||||||
|
|
@ -842,20 +940,23 @@
|
||||||
for (let i = 0; i < creatorsElement.length - 1; i++) {
|
for (let i = 0; i < creatorsElement.length - 1; i++) {
|
||||||
removeCreator(creatorsElement[i]);
|
removeCreator(creatorsElement[i]);
|
||||||
}
|
}
|
||||||
for (let i = 0; i < creators.length; i++) {
|
if (creators) {
|
||||||
if (creators[i].type === "Organization") {
|
for (let i = 0; i < creators.length; i++) {
|
||||||
const name = creators[i].name ? creators[i].name : "";
|
if (creators[i].type === "Organization") {
|
||||||
const ror = creators[i].id ? creators[i].id : "";
|
const name = creators[i].name ? creators[i].name : "";
|
||||||
console.log(creators[i], name, ror);
|
const ror = creators[i].id ? creators[i].id : "";
|
||||||
addCreator("", "", "", ror, name, "Organization");
|
addCreator("", "", "", ror, name, "Organization");
|
||||||
} else {
|
} else {
|
||||||
const firstName = creators[i].givenName ? creators[i].givenName : creators[i].name.split(" ")[0];
|
const firstName = creators[i].givenName ? creators[i].givenName : creators[i].name.split(" ")[0];
|
||||||
const lastName = creators[i].familyName ? creators[i].familyName: creators[i].name.substring(creators[i].name.indexOf(" ") + 1);
|
const lastName = creators[i].familyName ? creators[i].familyName: creators[i].name.substring(creators[i].name.indexOf(" ") + 1);
|
||||||
const authorId = creators[i].id ? creators[i].id : "";
|
const authorId = creators[i].id ? creators[i].id : "";
|
||||||
const ror = creators[i].affiliation?.id ? creators[i].affiliation.id : "";
|
const ror = creators[i].affiliation?.id ? creators[i].affiliation.id : "";
|
||||||
const affiliationName = creators[i].affiliation?.name ? creators[i].affiliation.name : "";
|
const affiliationName = creators[i].affiliation?.name ? creators[i].affiliation.name : "";
|
||||||
addCreator(firstName, lastName, authorId, ror, "", "Person", affiliationName);
|
addCreator(firstName, lastName, authorId, ror, "", "Person", affiliationName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
addCreator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function importData() {
|
function importData() {
|
||||||
|
|
@ -868,7 +969,7 @@
|
||||||
const licenseUrl = data.license ? idMap(data.license) : ""
|
const licenseUrl = data.license ? idMap(data.license) : ""
|
||||||
|
|
||||||
document.getElementById("inputStatus").value = data.creativeWorkStatus ? data.creativeWorkStatus : "Draft";
|
document.getElementById("inputStatus").value = data.creativeWorkStatus ? data.creativeWorkStatus : "Draft";
|
||||||
$("#datepicker1").datepicker("update", new Date(data.datePublished));
|
$("#datepickerInput").datepicker("update", new Date(data.datePublished));
|
||||||
document.getElementById("inputUrl").value = data.id ? data.id : "";
|
document.getElementById("inputUrl").value = data.id ? data.id : "";
|
||||||
document.getElementById("inputTitle").value = data.name;
|
document.getElementById("inputTitle").value = data.name;
|
||||||
setCreators(data.creator ? data.creator : []);
|
setCreators(data.creator ? data.creator : []);
|
||||||
|
|
@ -1034,6 +1135,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('.select-organization').on('select2:select', function (e) {
|
||||||
|
generate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createOrUpdateSelectInputAffiliation() {
|
function createOrUpdateSelectInputAffiliation() {
|
||||||
|
|
@ -1080,31 +1184,37 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('.select-institution').on('select2:select', function (e) {
|
||||||
|
generate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createOrUpdateDatePicker() {
|
function createOrUpdateDatePicker(reset=false) {
|
||||||
// Keep previously set date when changing the language
|
// Keep previously set date when changing the language
|
||||||
let date = $('#datepicker1').datepicker("getDate");
|
let date = $("#datepickerInput").datepicker("getDate");
|
||||||
|
|
||||||
if (document.getElementById("inputStatus").value != "Published") {
|
if (document.getElementById("inputStatus").value != "Published") {
|
||||||
document.getElementById("datepickerInput").required = false;
|
document.getElementById("datepickerInput").required = false;
|
||||||
|
document.getElementById("datePublishedFormGroup").hidden = true;
|
||||||
} else {
|
} else {
|
||||||
// Make required if input status is set to published
|
// Make required if input status is set to published
|
||||||
document.getElementById("datepickerInput").required = true;
|
document.getElementById("datepickerInput").required = true;
|
||||||
// When set to published, set datePublished to today
|
document.getElementById("datePublishedFormGroup").hidden = false;
|
||||||
if (!date) {
|
|
||||||
$('#datepicker1').datepicker("update", new Date());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$('#datepicker1').datepicker("destroy");
|
$('#datepickerInput').datepicker("destroy");
|
||||||
let language = document.getElementById("selectedLanguageLabel").textContent.toLowerCase();
|
let language = document.getElementById("selectedLanguageLabel").textContent.toLowerCase();
|
||||||
if (language == "en") language += "-US";
|
if (language == "en") language += "-US";
|
||||||
$('#datepicker1').datepicker({
|
$('#datepickerInput').datepicker({
|
||||||
language: language
|
language: language
|
||||||
});
|
});
|
||||||
if (date) {
|
if (date && !reset) {
|
||||||
$('#datepicker1').datepicker("update", new Date(date));
|
$("#datepickerInput").datepicker("update", new Date(date));
|
||||||
|
} else {
|
||||||
|
$("#datepickerInput").val("").datepicker("update");;
|
||||||
}
|
}
|
||||||
|
$("#datepickerInput").datepicker().on("changeDate", function(e) {
|
||||||
|
generate();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateContent() {
|
function updateContent() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue