Skip to content

Commit

Permalink
File table responsive clean up, added file date labels [ref #5210, #6685
Browse files Browse the repository at this point in the history
]
  • Loading branch information
mheppler committed Jan 19, 2021
1 parent 6b4fb24 commit 2ee739a
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 200 deletions.
3 changes: 3 additions & 0 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ restrictedaccess=Restricted Access
find=Find
search=Search
language=Language
created=Created
deposited=Deposited
published=Published
unpublished=Unpublished
cancel=Cancel
ok=OK
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,8 +1152,9 @@
rendered="#{!empty(DatasetPage.datasetVersionDifference.datasetFilesDiffList)}">
<p:column styleClass="versionValue">
<h:outputText value="#{bundle['file.viewDiffDialog.fileID']} #{fileDiff.fileId}"/>
<br></br>
<h:outputText value="#{fileDiff.fileChecksumType} #{fileDiff.fileChecksumValue}"/>
<div class="checksum-block">
<h:outputText value="#{fileDiff.fileChecksumType} #{fileDiff.fileChecksumValue}"/>
</div>
</p:column>
<p:column styleClass="versionDetails" rendered="#{! fileDiff.file1Empty}">
<h:outputText value="#{bundle['file.viewDiffDialog.fileName']}: #{fileDiff.fileName1}" styleClass="diffDetailBlock" rendered="#{fileDiff.fileName1 != null}"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/editFilesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
<h:outputText id="fileTypeOutputRegular" value="#{fileMetadata.dataFile.friendlyType}" rendered="#{!(fileMetadata.dataFile.tabularData)}"/>
<h:outputText id="fileTypeOutputTabular" value="#{bundle['file.type.tabularData']}" rendered="#{fileMetadata.dataFile.tabularData}"/>
<h:outputText id="fileCreatePublishDate" value=" - #{fileMetadata.getFileDateToDisplay()}" rendered="#{!(empty fileMetadata.id)}"/>
<div class="checksum-block" style="word-break: break-all;">
<div class="checksum-block">
<h:outputText id="fileChecksum" value="#{fileMetadata.dataFile.tabularData ? fileMetadata.dataFile.originalChecksumType : fileMetadata.dataFile.checksumType}: #{fileMetadata.dataFile.checksumValue}"/>
</div>
<!-- UNF + Variables, Obsersvations -->
Expand Down
126 changes: 64 additions & 62 deletions src/main/webapp/file-info-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,77 +10,79 @@
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:o="http://omnifaces.org/ui"
xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">
<p:outputPanel>
<div id="fileInfoInclude-filesTable" class="col-sm-12 row">
<div class="pull-left col-file-thumb">
<div class="thumbnail-block text-center">
<span class="icon-#{dataFileServiceBean.getFileThumbnailClass(fileMetadata.dataFile)} file-thumbnail-icon text-muted" jsf:rendered="#{!dataFileServiceBean.isThumbnailAvailable(fileMetadata.dataFile)}"/>
<span class="file-thumbnail-preview-img" jsf:rendered="#{dataFileServiceBean.isThumbnailAvailable(fileMetadata.dataFile)}"
data-toggle="popover" data-placement="bottom" data-trigger="hover" data-html="true" data-content="&lt;img src=&#34;/api/access/datafile/#{fileMetadata.dataFile.id}?imageThumb=400&#34; alt=&#34;#{bundle['file.preview']} #{fileMetadata.label}&#34; /&gt;"
data-template='&lt;div class="popover thumb-preview" role="tooltip"&gt;&lt;div class="arrow"&gt;&lt;/div&gt;&lt;h3 class="popover-title"&gt;&lt;/h3&gt;&lt;div class="popover-content"&gt;&lt;/div&gt;&lt;/div&gt;'>
<p:graphicImage value="/api/access/datafile/#{fileMetadata.dataFile.id}?imageThumb=true" alt="#{fileMetadata.label}"/>
</span>
<!-- Restricted File Icon -->
<div class="file-icon-restricted-block" jsf:rendered="#{fileMetadata.restricted and !fileDownloadHelper.canDownloadFile(fileMetadata)}">
<span class="glyphicon glyphicon-lock text-danger"/>
</div>
<div class="file-icon-restricted-block" jsf:rendered="#{fileMetadata.restricted and fileDownloadHelper.canDownloadFile(fileMetadata)}">
<span class="icon-unlock text-success"/>
</div>
<p:outputPanel id="fileInfoInclude-filesTable" styleClass="media">
<div class="media-left col-file-thumb" style="padding-top:4px;">
<div class="media-object thumbnail-block text-center">
<span class="icon-#{dataFileServiceBean.getFileThumbnailClass(fileMetadata.dataFile)} file-thumbnail-icon text-muted" jsf:rendered="#{!dataFileServiceBean.isThumbnailAvailable(fileMetadata.dataFile)}"/>
<span class="file-thumbnail-preview-img" jsf:rendered="#{dataFileServiceBean.isThumbnailAvailable(fileMetadata.dataFile)}"
data-toggle="popover" data-placement="auto top" data-trigger="hover" data-html="true" data-content="&lt;img src=&#34;/api/access/datafile/#{fileMetadata.dataFile.id}?imageThumb=400&#34; alt=&#34;#{bundle['file.preview']} #{fileMetadata.label}&#34; /&gt;"
data-template='&lt;div class="popover thumb-preview" role="tooltip"&gt;&lt;div class="arrow"&gt;&lt;/div&gt;&lt;h3 class="popover-title"&gt;&lt;/h3&gt;&lt;div class="popover-content"&gt;&lt;/div&gt;&lt;/div&gt;'>
<p:graphicImage value="/api/access/datafile/#{fileMetadata.dataFile.id}?imageThumb=true" alt="#{fileMetadata.label}"/>
</span>
<!-- Restricted File Icon -->
<div class="file-icon-restricted-block" jsf:rendered="#{fileMetadata.restricted and !fileDownloadHelper.canDownloadFile(fileMetadata)}">
<span class="glyphicon glyphicon-lock text-danger"/>
</div>
<div class="file-icon-restricted-block" jsf:rendered="#{fileMetadata.restricted and fileDownloadHelper.canDownloadFile(fileMetadata)}">
<span class="icon-unlock text-success"/>
</div>
</div>
</div>
<div class="media-body col-file-metadata">
<div class="fileNameOriginal">
<ui:fragment rendered="#{!editDatafilesPage}">
<!-- conditional render in file page links, if file has global id, use that; if not, we use database id -->
<a href="#{widgetWrapper.wrapURL('/file.xhtml?'.concat(!empty fileMetadata.dataFile.globalIdString ? 'persistentId=' : 'fileId=').concat(!empty fileMetadata.dataFile.globalIdString ? fileMetadata.dataFile.globalIdString : fileMetadata.dataFile.id).concat('&amp;version=').concat(fileMetadata.datasetVersion.friendlyVersionNumber))}">
#{fileMetadata.label}
</a>
</ui:fragment>
<ui:fragment rendered="#{editDatafilesPage}">
<span>#{fileMetadata.label}</span>
</ui:fragment>
</div>
<div class="col-sm-10 col-file-metadata">
<div class="fileNameOriginal">
<ui:fragment rendered="#{!editDatafilesPage}">
<!-- conditional render in file page links, if file has global id, use that; if not, we use database id -->
<a href="#{widgetWrapper.wrapURL('/file.xhtml?'.concat(!empty fileMetadata.dataFile.globalIdString ? 'persistentId=' : 'fileId=').concat(!empty fileMetadata.dataFile.globalIdString ? fileMetadata.dataFile.globalIdString : fileMetadata.dataFile.id).concat('&amp;version=').concat(fileMetadata.datasetVersion.friendlyVersionNumber))}">
#{fileMetadata.label}
</a>
</ui:fragment>
<ui:fragment rendered="#{editDatafilesPage}">
<span>#{fileMetadata.label}</span>
</ui:fragment>
<!-- HIERARCHY + TYPE + SIZE + DATE + CHECKSUM -->
<div class="text-muted small">
<!-- id:#{fileMetadata.dataFile.id} -->
<h:outputText id="fileHierarchy" styleClass="show" value="#{fileMetadata.directoryLabel}/" rendered="#{!empty fileMetadata.directoryLabel}"/>
<h:outputText id="fileType" value="#{fileMetadata.dataFile.tabularData ? bundle['file.type.tabularData'] : fileMetadata.dataFile.friendlyType}"/>
<h:outputText id="fileSize" value=" - #{fileMetadata.dataFile.friendlySize}"/>
<div class="dateCreatePublish-block">
<h:outputText id="fileCreatePublishDate" value="#{fileMetadata.dataFile.released ? bundle['published'] : bundle['deposited']} #{fileMetadata.getFileDateToDisplay()}" rendered="#{!(empty fileMetadata.id)}"/>
</div>
<!-- HIERARCHY + TYPE + SIZE + DATE + CHECKSUM -->
<div class="text-muted small">
<!-- id:#{fileMetadata.dataFile.id} -->
<h:outputText id="fileHierarchy" styleClass="show" value="#{fileMetadata.directoryLabel}/" rendered="#{!empty fileMetadata.directoryLabel}"/>
<h:outputText id="fileType" value="#{fileMetadata.dataFile.tabularData ? bundle['file.type.tabularData'] : fileMetadata.dataFile.friendlyType}"/>
<h:outputText id="fileSize" value=" - #{fileMetadata.dataFile.friendlySize}"/>
<h:outputText id="fileCreatePublishDate" value=" - #{fileMetadata.getFileDateToDisplay()}" rendered="#{!(empty fileMetadata.id)}"/>
<h:outputFormat id="fileDownloadCount" value=" - {0} #{bundle['metrics.downloads']}" rendered="#{!(settingsWrapper.rsyncOnly)}">
<div class="downloads-block">
<h:outputFormat styleClass="visible-xs-block visible-sm-block visible-md-inline visible-lg-inline" id="fileDownloadCount" value="{0} #{bundle['metrics.downloads']}" rendered="#{!(settingsWrapper.rsyncOnly)}">
<f:param value="#{guestbookResponseServiceBean.getCountGuestbookResponsesByDataFileId(fileMetadata.dataFile.id)}"/>
</h:outputFormat>
<!-- CHECKSUM -->
<div class="checksum-block" jsf:rendered="#{!fileMetadata.dataFile.tabularData and !(empty fileMetadata.dataFile.checksumValue)}">
#{fileMetadata.dataFile.checksumType}: <span class="#{!editDatafilesPage ? 'checksum-truncate' : ''}"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.checksumValue}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.checksumValue}">#{fileMetadata.dataFile.checksumValue}</span>
</div>
<!-- TABULAR VARIABLES, OBSERVATIONS + UNF -->
<div class="unf-block" jsf:rendered="#{fileMetadata.dataFile.tabularData}">
<h:outputText id="fileNumVars" value="#{fileMetadata.dataFile.dataTable.varQuantity} #{bundle['file.metaData.dataFile.dataTab.variables']}, "/>
<h:outputText id="fileNumObs" value="#{fileMetadata.dataFile.dataTable.caseQuantity} #{bundle['file.metaData.dataFile.dataTab.observations']} #{!empty fileMetadata.dataFile.unf ? ' - ' : ''}"/>
<span jsf:id="fileUNF" class="#{!editDatafilesPage ? 'checksum-truncate' : ''}"
jsf:rendered="#{!(empty fileMetadata.dataFile.unf)}"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.unf}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.unf}">#{fileMetadata.dataFile.unf}</span>
</div>
</div>
<div class="fileDescription small" jsf:rendered="#{!(empty fileMetadata.description)}">
<h:outputText id="fileDescNonEmpty" value="#{fileMetadata.description}"/>
<!-- CHECKSUM -->
<div class="checksum-block" jsf:rendered="#{!fileMetadata.dataFile.tabularData and !(empty fileMetadata.dataFile.checksumValue)}">
#{fileMetadata.dataFile.checksumType}: <span class="#{!editDatafilesPage ? 'checksum-truncate' : ''}"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.checksumValue}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.checksumValue}">#{fileMetadata.dataFile.checksumValue}</span>
</div>
<div class="file-tags-block" jsf:rendered="#{!(empty fileMetadata.categories) or !(empty fileMetadata.dataFile.tags)}">
<ui:repeat value="#{fileMetadata.categories}" var="cat">
<h:outputText value="#{cat.name}" styleClass="label label-default"/>
</ui:repeat>
<ui:repeat value="#{fileMetadata.dataFile.tags}" var="tag">
<h:outputText value="#{tag.typeLabel}" styleClass="label label-info"/>
</ui:repeat>
<!-- TABULAR VARIABLES, OBSERVATIONS + UNF -->
<div class="unf-block" jsf:rendered="#{fileMetadata.dataFile.tabularData}">
<h:outputText id="fileNumVars" value="#{fileMetadata.dataFile.dataTable.varQuantity} #{bundle['file.metaData.dataFile.dataTab.variables']}, "/>
<h:outputText id="fileNumObs" value="#{fileMetadata.dataFile.dataTable.caseQuantity} #{bundle['file.metaData.dataFile.dataTab.observations']}"/>
<span style="display:block;" jsf:id="fileUNF" class="#{!editDatafilesPage ? 'checksum-truncate' : ''}"
jsf:rendered="#{!(empty fileMetadata.dataFile.unf)}"
data-clipboard-action="copy"
data-clipboard-text="#{fileMetadata.dataFile.unf}"
title="#{bundle['file.metaData.checksum.copy']} #{fileMetadata.dataFile.unf}">#{fileMetadata.dataFile.unf}</span>
</div>
</div>
<div class="fileDescription small" jsf:rendered="#{!(empty fileMetadata.description)}">
<h:outputText id="fileDescNonEmpty" value="#{fileMetadata.description}"/>
</div>
<div class="file-tags-block" jsf:rendered="#{!(empty fileMetadata.categories) or !(empty fileMetadata.dataFile.tags)}">
<ui:repeat value="#{fileMetadata.categories}" var="cat">
<h:outputText value="#{cat.name}" styleClass="label label-default"/>
</ui:repeat>
<ui:repeat value="#{fileMetadata.dataFile.tags}" var="tag">
<h:outputText value="#{tag.typeLabel}" styleClass="label label-info"/>
</ui:repeat>
</div>
</div>
</p:outputPanel>
</ui:composition>
Loading

0 comments on commit 2ee739a

Please sign in to comment.