Files
\
\
';
default:
return null;
}
}
function renderFilesTable(files) {
var license_link_html = "";
var license = "";
var logged_in = false;
var lang = "en";
var file_status_translations = {"Public": "Public", "Restricted": "Restricted"};
var cols = [{"sortable": true, "label": "Filename", "name": "name", "field_type": "string", "field": "name", "title": "Filename", "targets": 1, "visible": true}, {"sortable": true, "label": "Size", "name": "size", "field_type": "string", "field": "size", "title": "Size", "targets": 2, "visible": true}, {"sortable": true, "label": "Access", "name": "status", "field_type": "string", "field_format": "select", "enum": [{"label": "Public", "name": "public"}, {"label": "Restricted", "name": "restricted"}, {"label": "Embargo Date", "name": "embargo"}], "field": "status", "title": "Access", "targets": 3, "visible": true}, {"sortable": true, "label": "Description", "name": "description", "field_type": "string", "field": "description", "title": "Description", "targets": 4, "visible": true}, {"sortable": true, "label": "License", "name": "rec_license", "field_type": "string", "field_format": "select", "enum": [{"label": "Copyrighted", "name": "copyright"}, {"label": "CC BY (Creative Commons: Attribution)", "name": "CC BY"}, {"label": "CC BY-NC-ND (Creative Commons: Attribution-NonCommercial-No Derivatives)", "name": "CC BY-NC-ND"}, {"label": "CC BY-NC (Creative Commons: Attribution-NonCommercial)", "name": "CC BY-NC"}, {"label": "CC BY-ND (Creative Commons: Attribution-No Derivatives)", "name": "CC BY-ND"}, {"label": "CC BY-SA (Creative Commons: Attribution-ShareAlike)", "name": "CC BY-SA"}, {"label": "CC BY-NC-SA (Creative Commons: Attribution-NonCommercial-ShareAlike)", "name": "CC BY-NC-SA"}, {"label": "CC0 (No rights reserved)", "name": "CC0"}, {"label": "MIT License", "name": "MIT License"}, {"label": "GNU-GPL", "name": "GNU-GPL"}, {"label": "BSD", "name": "BSD"}, {"label": "Apache License", "name": "Apache License"}], "field": "rec_license", "title": "License", "targets": 5, "visible": true}];
// Define validation status column
cols.push({
sortable: false,
name: 'validation_status',
field: 'validation_status',
field_type: 'string',
visible: true,
label: ''
});
var filesData = [];
if (files.length == 1) {
$('#file-count-total').html('1 ' + 'file');
} else {
$('#file-count-total').html('' + files.length + ' ' + 'files');
}
for (var i = 0; i < files.length; ++i) {
var file = files[i];
var fileFullName = escape(file.name + file.format);
let downloadButton = $('