Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5210 - display long checksums #5211

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ file.fileName=File Name
file.type.tabularData=Tabular Data
file.originalChecksumType=Original File {0}
file.checksum.exists.tip=A file with this checksum already exists in the dataset.
file.checksum.copy=Click Button to Copy to Clipboard:
file.selectedThumbnail=Thumbnail
file.selectedThumbnail.tip=The thumbnail for this file is used as the default thumbnail for the dataset. Click 'Advanced Options' button of another file to select that file.
file.cloudStorageAccess=Cloud Storage Access
Expand Down
26 changes: 22 additions & 4 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,27 @@
<h:outputText id="fileTypeOutputTabular" value="#{bundle['file.type.tabularData']}" rendered="#{FilePage.fileMetadata.dataFile.tabularData}"/>
<h:outputText id="fileSize" value=" - #{FilePage.fileMetadata.dataFile.friendlySize}" />
<h:outputText id="fileCreatePublishDate" value=" - #{bundle['file.lastupdated.label']}: #{FilePage.fileMetadata.fileDateToDisplay}" rendered="#{!(empty FilePage.fileMetadata.id)}"/>
<div class="checksum-block" jsf:rendered="#{!FilePage.file.tabularData}">
<h:outputText id="file-checksum" value="#{FilePage.file.tabularData ? FilePage.file.originalChecksumType : FilePage.file.checksumType}: #{FilePage.file.checksumValue}"
rendered="#{!(empty FilePage.file.checksumValue)}"/>
<div class="checksum-block" jsf:rendered="#{!FilePage.file.tabularData and !(empty FilePage.file.checksumValue)}">
<button class="btn btn-secondary checksum" type="button"
data-clipboard-action="copy"
data-clipboard-text="#{FilePage.file.checksumValue}"
title="#{bundle['file.checksum.copy']} #{FilePage.file.checksumValue}">
#{FilePage.file.tabularData ? FilePage.file.originalChecksumType : FilePage.file.checksumType}
<span class="glyphicon glyphicon-copy"></span>
</button>
<script>
$(document).ready(function() {
// clipboard.js > checksum copy buttons
var clipboard = new Clipboard('button.checksum');
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
});
</script>

</div>
<div id="unf-block" class="text-muted" jsf:rendered="#{FilePage.file.tabularData}">
<h:outputText id="fileNumVars" value="#{FilePage.file.dataTable.varQuantity} #{bundle['file.metaData.dataFile.dataTab.variables']}, " rendered="#{FilePage.file.tabularData}"/>
Expand Down Expand Up @@ -441,7 +459,7 @@
<h:outputText value="#{FilePage.file.unf}"/>
</div>
</div>
<div class="form-group" jsf:rendered="#{!(empty FilePage.file.checksumValue)}">
<div class="form-group checksum-block" jsf:rendered="#{!(empty FilePage.file.checksumValue)}">
<label class="col-sm-3 control-label">
#{FilePage.file.tabularData ? FilePage.file.originalChecksumType : FilePage.file.checksumType}
</label>
Expand Down
20 changes: 18 additions & 2 deletions src/main/webapp/filesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,24 @@
<f:param value="#{DatasetPage.getGuestbookResponseCount(fileMetadata)}"/>
</h:outputFormat>

<div class="checksum-block" jsf:rendered="#{!fileMetadata.dataFile.tabularData}">
<h:outputText id="file-checksum" value="#{fileMetadata.dataFile.checksumType}: #{fileMetadata.dataFile.checksumValue}" rendered="#{!(empty fileMetadata.dataFile.checksumValue) and ((DatasetPage.editMode != 'FILE' and DatasetPage.editMode != 'CREATE') or !DatasetPage.isDuplicate(fileMetadata))}"/>
<div class="checksum-block" jsf:rendered="#{!fileMetadata.dataFile.tabularData and !(empty fileMetadata.dataFile.checksumValue) and ((DatasetPage.editMode != 'FILE' and DatasetPage.editMode != 'CREATE') or !DatasetPage.isDuplicate(fileMetadata))}">
<button class="btn checksum" type="button" data-clipboard-action="copy" data-clipboard-text="#{fileMetadata.dataFile.checksumValue}" title="#{bundle['file.checksum.copy']} #{fileMetadata.dataFile.checksumValue}">
#{fileMetadata.dataFile.checksumType}
<span class="glyphicon glyphicon-copy"></span>
</button>
<script>
$(document).ready(function () {
// clipboard.js > checksum copy buttons
var clipboard = new Clipboard('button.checksum');

clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
});
</script>
</div>
</div>
<!-- UNF + Variables, Obsersvations -->
Expand Down
25 changes: 23 additions & 2 deletions src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ a[id$='advsearchlink'] {margin-left:1em;}

span.search-term-match {font-weight: bold;}
[id$='resultsTable'] {width:100%;}
[id$='resultsTable'] div[class*='Result'] {font-size: 90%;}
[id$='resultsTable'] div[class*='Result'] {
font-size: 90%;
word-break:break-word;
}
[id$='resultsTable'] div[class*='Result'] > div.card-title-icon-block,
[id$='resultsTable'] div[class*='Result'] > div.card-preview-icon-block,
[id$='resultsTable'] div[class*='Result'] > div.file-tags-block {font-size: 110%;}
Expand Down Expand Up @@ -502,6 +505,9 @@ a.facetLink.facetSelected span.glyphicon-remove {vertical-align:text-top; margin
#my_data_filter_column div.checkbox label:not(.facetTypeLabel) {color:#428bca;font-size:90%;}
#my_data_filter_column div.checkbox.facetSelected label, #my_data_filter_column div.checkbox label.facetSelected {font-weight: bold;}
#my_data_filter_column div.checkbox label.facetSelected:hover {color: #23527c;}
#div-card-results {
word-break:break-word;
}

table.ui-panelgrid.facetsMoreLess {width:100%;}
table.ui-panelgrid.facetsMoreLess tr.ui-widget-content {border:0;}
Expand Down Expand Up @@ -775,6 +781,14 @@ div[id$="filesTable"] .ui-paginator .ui-paginator-pages .ui-state-active {
border-color: rgb(51, 122, 183);
}

.checksum-block .checksum {
padding: 2px 2px;
line-height: 1.0;
}
.checksum-block {
word-break:break-all;
}

span.ingest-warning {display:inline-block; font-size:24px; line-height:1; vertical-align: middle;}
span.ingest-warning span.glyphicon {top:3px}

Expand All @@ -791,7 +805,14 @@ div.dvnDifferanceTable > div.ui-datatable-tablewrapper > table > tbody > tr, div
div.dvnDifferanceTable div.ui-datatable-tablewrapper table td.versionValue {width:30%;}
div.dvnDifferanceTable div.ui-datatable-tablewrapper table td.versionDetails {width:35%;}

div.dvnDifferanceTable .diffDetailBlock {display:block;}
div.dvnDifferanceTable .diffDetailBlock {
display:block;
word-break:break-word;
}

div.dvnDifferanceTable .versionValue {
word-break:break-word;
}

.dropin-btn-status.ui-icon {background: url("https://www.dropbox.com/static/images/widgets/dbx-saver-status.png") no-repeat;}

Expand Down