Skip to content

Commit

Permalink
YDA-5808 - Modified to display Base DOI in VAULT space.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaur16 committed Aug 7, 2024
1 parent c09df4f commit 9b7e9ff
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 31 deletions.
13 changes: 13 additions & 0 deletions vault/static/vault/css/vault.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,16 @@ table.dataTable > tbody > tr > td {
color: #444;
padding-left:3px;
}

.meta-content-size {
text-align: justify;
}

/* Version */
.version tbody {
font-size: 14px;
}

.highlight td {
background-color: var(--bs-primary-border-subtle);
}
46 changes: 46 additions & 0 deletions vault/static/vault/js/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,9 @@ function topInformation (dir, showAlert, rebuildFileBrowser = false) {
const downloadable = data.downloadable
const archive = data.archive
researchGroupAccess = data.research_group_access
const all_versions = data.all_versions
const base_doi = data.base_doi
const package_doi = data.package_doi

$('.btn-group button.metadata-form').hide()
$('.top-information').hide()
Expand Down Expand Up @@ -790,6 +793,49 @@ function topInformation (dir, showAlert, rebuildFileBrowser = false) {
$('.alert.is-processing').show()
} else {
metadataInfo(dir)
if (vaultStatus === 'PUBLISHED'){
$('.metadata-form-size').addClass('col-lg-8')
$('.meta-title-size').removeClass('col-lg-2').addClass('col-lg-3')
$('.meta-content-size').removeClass('col-lg-10').addClass('col-lg-9')

// List DOIs
const list_dois = $('.version tbody')
const base_doi_span = $('.base_doi span')
let ld = ''
let highlight = ''
let bdoi = ''
for(var i = 0; i < all_versions.length; i++) {
if (package_doi === all_versions[i][1] && all_versions.length > 1) {
highlight = ' class="highlight"'
}
else {
highlight = ''
}

ld += '<tr' + highlight + '><td>'
+ '<a href="https://doi.org/' + all_versions[i][1] + '">https://doi.org/' + all_versions[i][1] + '</a>'
+ '</td>'
+ '<td>'
+ '<small title="' + all_versions[i][2] + '">' + all_versions[i][0] + '</small>'
+ '</td></tr>'
}
list_dois.html(ld)
if (base_doi != null){
bdoi += '<a href="https://doi.org/' + base_doi + '">https://doi.org/' + base_doi + '</a><br>'
base_doi_span.html(bdoi)
$('.base_doi').show()
}
else {
$('.base_doi').hide()
}
$('.version').show()
}
else{
$('.metadata-form-size').removeClass('col-lg-8')
$('.meta-title-size').removeClass('col-lg-3').addClass('col-lg-2')
$('.meta-content-size').removeClass('col-lg-9').addClass('col-lg-10')
$('.version').hide()
}
}

// Datamanager sees access buttons in vault.
Expand Down
80 changes: 49 additions & 31 deletions vault/templates/vault/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,38 +329,56 @@ <h5 class="modal-title">Unarchive datapackage from tape</h5>
<section class="metadata-info container hide">
<h3 class="metadata-title"></h3>
<h5 class="metadata-creator mt-3"></h5>
<div class="row">
<div class="col-lg-2">
<strong>Description <i class="fa-solid fa-question-circle" aria-hidden="true" title="Description of this data package"></i></strong>
</div>
<div class="col-lg-10">
<div class="metadata-description"></div>
<button type="button" class="btn read-more-button hide">Read full description...</button>
<button type="button" class="btn read-less-button hide">Collapse description...</button>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Data classification <i class="fa-solid fa-question-circle" aria-hidden="true" title="Classification of data package with regard to information security policy"></i></strong>
</div>
<div class="col-lg-10">
<span class="metadata-data-classification"></span>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>Data package access <i class="fa-solid fa-question-circle" aria-hidden="true" title="Data package accessibility to third parties"></i></strong>
</div>
<div class="col-lg-10">
<span class="metadata-access"></span>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<strong>License <i class="fa-solid fa-question-circle" aria-hidden="true" title="The license under which this data package is available for use by third parties"></i></strong>
<div class="row pb-4 mb-3">
<div class="metadata-form-size">
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Description of this data package">Description</strong>
</div>
<div class="meta-content-size col-lg-10">
<div class="metadata-description"></div>
<button type="button" class="btn read-more-button hide">Read full description...</button>
<button type="button" class="btn read-less-button hide">Collapse description...</button>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Classification of data package with regard to information security policy">Data classification</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-data-classification"></span>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="Data package accessibility to third parties">Data package access</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-access"></span>
</div>
</div>
<div class="row">
<div class="meta-title-size col-lg-2">
<strong data-toggle="tooltip" data-placement="bottom" title="The license under which this data package is available for use by third parties">License</strong>
</div>
<div class="meta-content-size col-lg-10">
<span class="metadata-license"></span>
</div>
</div>
</div>
<div class="col-lg-10">
<span class="metadata-license"></span>
<div class="version col-lg-4 hide">
<div>
<h6 class="ml-1"><b>Versions</b></h6>
<table class="table table-sm">
<tbody>
</tbody>
</table>
<small class="base_doi hide">
<b>Base DOI: </b>
<span></span>
This DOI represents all versions of this publication and will resolve to the latest publication.
</small>
</div>
</div>
</div>
</section>
Expand Down

0 comments on commit 9b7e9ff

Please sign in to comment.