HFP-1905 Fix source and link in copyright view
parent
8190fe1d42
commit
d113809e80
|
@ -1095,8 +1095,10 @@ H5P.buildMetadataCopyrights = function (metadata, contentTypeName) {
|
||||||
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
if (metadata && metadata.license !== undefined && metadata.license !== 'U') {
|
||||||
var dataset = {
|
var dataset = {
|
||||||
title: metadata.title,
|
title: metadata.title,
|
||||||
author: (metadata.authors && metadata.authors.length > 0) ? metadata.authors.map(function(author) {return author.name + ' (' + author.role + ')';}).join(', ') : undefined,
|
author: (metadata.authors && metadata.authors.length > 0) ? metadata.authors.map(function(author) {
|
||||||
source: (metadata.source) ? '<a href="' + metadata.source + '" target="_blank">' + metadata.source + '</a>' : undefined,
|
return (author.role) ? author.name + ' (' + author.role + ')' : author.name;
|
||||||
|
}).join(', ') : undefined,
|
||||||
|
source: metadata.source,
|
||||||
year: (metadata.yearFrom) ? (metadata.yearFrom + ((metadata.yearTo) ? '-' + metadata.yearTo: '')) : undefined,
|
year: (metadata.yearFrom) ? (metadata.yearFrom + ((metadata.yearTo) ? '-' + metadata.yearTo: '')) : undefined,
|
||||||
license: metadata.license,
|
license: metadata.license,
|
||||||
version: metadata.licenseVersion,
|
version: metadata.licenseVersion,
|
||||||
|
@ -1415,6 +1417,9 @@ H5P.MediaCopyright = function (copyright, labels, order, extraFields) {
|
||||||
if (fieldName === 'license') {
|
if (fieldName === 'license') {
|
||||||
humanValue = humanizeLicense(copyright.license, copyright.version);
|
humanValue = humanizeLicense(copyright.license, copyright.version);
|
||||||
}
|
}
|
||||||
|
if (fieldName === 'source') {
|
||||||
|
humanValue = (humanValue) ? '<a href="' + humanValue + '" target="_blank">' + humanValue + '</a>' : undefined;
|
||||||
|
}
|
||||||
list.add(new H5P.Field(getLabel(fieldName), humanValue));
|
list.add(new H5P.Field(getLabel(fieldName), humanValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue