Skip to content

Commit

Permalink
Add tooltips to vault package metadata labels
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Aug 9, 2024
1 parent 63a3b9f commit fe84d5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
4 changes: 4 additions & 0 deletions vault/static/vault/js/vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,10 @@ function topInformation (dir, showAlert, rebuildFileBrowser = false) {
if (typeof vaultStatus !== 'undefined') {
$('.top-information').show()
$('.top-info-buttons').show()

// Trigger tooltips.
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)) // eslint-disable-line no-unused-vars
}
if (rebuildFileBrowser) {
buildFileBrowser(dir)
Expand Down
24 changes: 11 additions & 13 deletions vault/templates/vault/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ <h5 class="modal-title">Unarchive datapackage from tape</h5>

<nav aria-label="breadcrumb">
<div class="breadcrumb-container">
<a class="btn btn-sm btn-secondary float-end btn-go-to-research mt-2 me-2" title="Go to research space of group" research-area="">Go to research</a>
<a class="btn btn-sm btn-secondary float-end btn-go-to-group-manager mt-2 me-2" title="Go to group in group manager" group="">Go to group manager</a>
<a class="btn btn-sm btn-secondary float-end btn-go-to-research mt-2 me-2" data-bs-toggle="tooltip" data-bs-title="Go to research space of group" research-area="">Go to research</a>
<a class="btn btn-sm btn-secondary float-end btn-go-to-group-manager mt-2 me-2"data-bs-toggle="tooltip" data-bs-title="Go to group in group manager" group="">Go to group manager</a>
<ol class="breadcrumb">
<li class="breadcrumb-item">Vault</li>
</ol>
Expand All @@ -333,7 +333,7 @@ <h5 class="metadata-creator mt-3"></h5>
<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>
<strong data-bs-toggle="tooltip" data-bs-title="Description of this data package">Description</strong>
</div>
<div class="meta-content-size col-lg-10">
<div class="metadata-description"></div>
Expand All @@ -343,23 +343,23 @@ <h5 class="metadata-creator mt-3"></h5>
</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>
<strong data-bs-toggle="tooltip" data-bs-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>
<strong data-bs-toggle="tooltip" data-bs-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>
<strong data-bs-toggle="tooltip" data-bs-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>
Expand All @@ -368,13 +368,13 @@ <h5 class="metadata-creator mt-3"></h5>
</div>
<div class="version col-lg-4 hide">
<div>
<h6 class="ml-1"><b>Versions</b></h6>
<h6 class="ml-1"><strong>Versions</strong></h6>
<table class="table table-sm">
<tbody>
</tbody>
</table>
<small class="base_doi hide">
<b>Base DOI: </b>
<strong>Base DOI: </strong>
<span></span>
This DOI represents all versions of this publication and will resolve to the latest publication.
</small>
Expand All @@ -388,7 +388,7 @@ <h6 class="ml-1"><b>Versions</b></h6>
<h2 class="me-2 d-inline"></h2>
<div class="btn-toolbar float-end d-inline" role="toolbar">
<div class="btn-group me-2" role="group">
<button type="button" class="btn btn-outline-secondary metadata-form" data-path="" title="Show metadata form">Metadata</button>
<button type="button" class="btn btn-outline-secondary metadata-form" data-path="" data-bs-toggle="tooltip" data-bs-title="Show metadata form">Metadata</button>
</div>
<div class="btn-group">
<div class="dropdown">
Expand All @@ -400,14 +400,13 @@ <h2 class="me-2 d-inline"></h2>
</div>

<div class="card system-metadata mt-2">
<div class="card-header">System metadata</div>
<div class="card-header">System Metadata</div>
<div class="list-group system-metadata-items"></div>
</div>
<div class="card actionlog mt-2">
<div class="card-header">Provenance information</div>
<div class="card-header">Provenance Information</div>
<div class="list-group actionlog-items"></div>
</div>

</div>

<table id="file-browser" class="table yoda-table table-striped">
Expand All @@ -420,5 +419,4 @@ <h2 class="me-2 d-inline"></h2>
</tr>
</thead>
</table>

{% endblock content %}

0 comments on commit fe84d5e

Please sign in to comment.