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

Cleaned up preview tab on file pg [ref #6437] #6438

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,6 @@ file.rsyncUpload.rsyncUploadDisabledDueFileUploadedViaHttpAndPublished=Upload wi

file.metaData.dataFile.dataTab.variables=Variables
file.metaData.dataFile.dataTab.observations=Observations
file.metaData.viewOnWorldMap=Explore on WorldMap
file.addDescription=Add file description...
file.tags=Tags
file.editTags=Edit Tags
Expand Down Expand Up @@ -1652,7 +1651,7 @@ file.dataFilesTab.versions.viewDetails.btn=View Details
file.dataFilesTab.versions.widget.viewMoreInfo=To view more information about the versions of this dataset, and to edit it if this is your dataset, please visit the <a href="/dataset.xhtml?persistentId={0}" title="{1}" target="_blank">full version of this dataset</a> at the {2}.
file.dataFilesTab.versions.preloadmessage=(Loading versions...)
file.previewTab.externalTools.header=Available Previews
file.previewTab.button.label=Previews
file.previewTab.button.label=Preview Tools
file.previewTab.previews.not.available=Public previews are not available for this file.
file.deleteDialog.tip=Are you sure you want to delete this dataset and all of its files? You cannot undelete this dataset.
file.deleteDialog.header=Delete Dataset
Expand Down Expand Up @@ -1793,6 +1792,8 @@ file.DatasetVersion=Version

file.previewTab.tool.open=Open
file.previewTab.header=Preview
file.previewTab.presentation=File Preview Tool
file.previewTab.exploreBtn={0} on {1}
file.metadataTab.fileMetadata.header=File Metadata
file.metadataTab.fileMetadata.persistentid.label=Data File Persistent ID
file.metadataTab.fileMetadata.downloadUrl.label=Download URL
Expand Down
129 changes: 67 additions & 62 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -363,81 +363,88 @@
<ui:param name="fileDownloadService" value="#{DatasetPage.fileDownloadService}"/>
</ui:include>
</p:tab>


<p:tab id="previewTab" title="#{bundle['file.previewTab.header']}" rendered="#{FilePage.publiclyDownloadable and (FilePage.toolsWithPreviews.size() > 0) and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)
and FilePage.fileMetadata.datasetVersion.isPublished()}">
<!-- Add external tools as an inner tab with buttons to full tool-->
<p:tab id="previewTab" title="#{bundle['file.previewTab.header']}"
rendered="#{FilePage.publiclyDownloadable and (FilePage.toolsWithPreviews.size() > 0) and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata) and FilePage.fileMetadata.datasetVersion.isPublished()}">
<div class="btn-toolbar margin-bottom" role="toolbar" aria-label="#{bundle['file.previewTab.button.label']}">
<!-- Preview Button Group -->
<div>
<div class="btn-group" jsf:rendered="#{FilePage.toolsWithPreviews.size() > 1 and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)}">
<button type="button" id="selectTool" class="btn btn-default btn-access dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-eye-open"/> #{bundle['file.previewTab.button.label']} <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right text-left" role="menu">
<ui:repeat value="#{FilePage.toolsWithPreviews}" var="tool" >

<li>
<h:commandLink action="#{FilePage.setSelectedTool(tool)}" >
<h:outputText value="#{tool.displayName}" />
</h:commandLink>
</li>

</ui:repeat>
</ul>
</div>
<!-- END: Preview Button Group -->
<div class="btn-group" jsf:rendered="#{FilePage.toolsWithPreviews.size() > 1 and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)}">
<button type="button" id="selectTool" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-eye-open"/> #{bundle['file.previewTab.button.label']} <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<ui:repeat value="#{FilePage.toolsWithPreviews}" var="tool">
<li>
<h:commandLink action="#{FilePage.setSelectedTool(tool)}">
<h:outputText value="#{tool.displayName}"/>
</h:commandLink>
</li>
</ui:repeat>
</ul>
</div>
<div>
<ui:fragment rendered="#{FilePage.toolsWithPreviews.size() > 0 and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)}" id="previewPresentation">
<ui:fragment rendered="#{!FilePage.selectedTool.worldMapTool}">
<h:commandButton rendered="#{!downloadPopupRequired}" value="#{bundle['file.previewTab.tool.open']} #{FilePage.selectedTool.displayName}"
<!-- END: Preview Button Group -->
<div class="btn-group" jsf:rendered="#{FilePage.toolsWithPreviews.size() > 0 and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)}">
<!-- Modular/Configured Explore Tool -->
<h:commandLink rendered="#{!FilePage.selectedTool.worldMapTool and !downloadPopupRequired}"
type="submit"
styleClass="#{(FilePage.fileMetadata.dataFile.ingestInProgress) ? 'disabled' : ''}"
styleClass="btn btn-default #{(FilePage.fileMetadata.dataFile.ingestInProgress) ? 'disabled' : ''}"
disabled="#{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
action="#{FilePage.fileDownloadService.explore(FilePage.guestbookResponse, FilePage.fileMetadata, FilePage.selectedTool )}">
</h:commandButton>
<p:commandButton rendered="#{downloadPopupRequired}" value="#{bundle['file.previewTab.tool.open']} #{FilePage.selectedTool.displayName}"
action="#{FilePage.fileDownloadService.explore(FilePage.guestbookResponse, FilePage.fileMetadata, FilePage.selectedTool)}">
<span class="glyphicon glyphicon-equalizer"></span>
<h:outputFormat value="#{bundle['file.previewTab.exploreBtn']}">
<f:param value="#{bundle.explore}"/>
<f:param value="#{FilePage.selectedTool.displayName}"/>
</h:outputFormat>
</h:commandLink>
<p:commandLink rendered="#{!FilePage.selectedTool.worldMapTool and downloadPopupRequired}"
action="#{FilePage.guestbookResponseService.modifyDatafileAndFormat(FilePage.guestbookResponse, FilePage.fileMetadata, 'externalTool', FilePage.selectedTool)}"
styleClass="btn btn-default"
disabled="#{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
type="submit"
process="@this"
update="@widgetVar(downloadPopup)"
oncomplete="PF('downloadPopup').show();handleResizeDialog('downloadPopup');">
</p:commandButton>
</ui:fragment>

<!--WorldMap Explore-->
<ui:fragment rendered="#{FilePage.selectedTool.worldMapTool}">

<h:commandLink rendered="#{!downloadPopupRequired}"
styleClass="btn btn-default btn-xs #{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
disabled="#{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"

action="#{FilePage.fileDownloadService.startWorldMapDownloadLink(FilePage.guestbookResponse, FilePage.fileMetadata )}" target="_blank" >
#{bundle['file.previewTab.tool.open']} #{bundle['file.mapData.worldMap']}
</h:commandLink>
<p:commandButton rendered="#{downloadPopupRequired}"
styleClass="#{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
disabled="#{FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload}"
process="@this"
action="#{FilePage.guestbookResponseService.modifyDatafileAndFormat(FilePage.guestbookResponse, FilePage.fileMetadata, 'worldMap' )}"
update="@widgetVar(downloadPopup)"
oncomplete="PF('downloadPopup').show();handleResizeDialog('downloadPopup');">
#{bundle['file.previewTab.tool.open']} #{bundle['file.mapData.worldMap']}
</p:commandButton>
</ui:fragment>

<iframe role="presentation" title="External File Preview Tool" height="500" width="100%" src="#{FilePage.preview(FilePage.selectedTool)}"></iframe>
</ui:fragment>
<span class="glyphicon glyphicon-equalizer"></span>
<h:outputFormat value="#{bundle['file.previewTab.exploreBtn']}">
<f:param value="#{bundle.explore}"/>
<f:param value="#{FilePage.selectedTool.displayName}"/>
</h:outputFormat>
</p:commandLink>
<!-- Modular/Configured Explore Tool -->
<!-- WorldMap Explore -->
<h:commandLink rendered="#{FilePage.selectedTool.worldMapTool and !downloadPopupRequired}"
styleClass="btn btn-default #{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
disabled="#{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
action="#{FilePage.fileDownloadService.startWorldMapDownloadLink(FilePage.guestbookResponse, FilePage.fileMetadata )}" target="_blank" rel="noopener">
<span class="glyphicon glyphicon-equalizer"></span>
<h:outputFormat value="#{bundle['file.previewTab.exploreBtn']}">
<f:param value="#{bundle.explore}"/>
<f:param value="#{bundle['file.mapData.worldMap']}"/>
</h:outputFormat>
</h:commandLink>
<p:commandLink rendered="#{FilePage.selectedTool.worldMapTool and downloadPopupRequired}"
styleClass="btn btn-default #{(FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload) ? 'disabled' : ''}"
disabled="#{FilePage.fileMetadata.dataFile.ingestInProgress or lockedFromDownload}"
process="@this"
action="#{FilePage.guestbookResponseService.modifyDatafileAndFormat(FilePage.guestbookResponse, FilePage.fileMetadata, 'worldMap')}"
update="@widgetVar(downloadPopup)"
oncomplete="PF('downloadPopup').show();handleResizeDialog('downloadPopup');">
<span class="glyphicon glyphicon-equalizer"></span>
<h:outputFormat value="#{bundle['file.previewTab.exploreBtn']}">
<f:param value="#{bundle.explore}"/>
<f:param value="#{bundle['file.mapData.worldMap']}"/>
</h:outputFormat>
</p:commandLink>
<!-- END WorldMap Explore -->
</div>
</div>
<!-- FRAME -->
<div id="previewPresentation" class="embed-responsive embed-responsive-16by9" jsf:rendered="#{FilePage.toolsWithPreviews.size() > 0 and fileDownloadHelper.canDownloadFile(FilePage.fileMetadata)}">
<iframe role="presentation" title="#{bundle['file.previewTab.presentation']}" src="#{FilePage.preview(FilePage.selectedTool)}"></iframe>
</div>
</p:tab>


<p:tab id="metadataMapTab" class="padding-none" title="#{bundle['file.dataFilesTab.metadata.header']}"
rendered="#{(!FilePage.fileMetadata.datasetVersion.deaccessioned or
(FilePage.fileMetadata.datasetVersion.deaccessioned and FilePage.canUpdateDataset()))}">

<!-- Metadata -->
<div class="button-block tab-header margin-bottom text-right">
<!-- Add + Edit Metadata Button -->
Expand All @@ -456,7 +463,6 @@
<span class="glyphicon glyphicon-pencil"/> #{bundle['dataset.editBtn']}
</button>
</div>

<!-- Export Button -->
<div class="btn-group" jsf:rendered="#{FilePage.fileMetadata.datasetVersion.dataset.released}">
<button class="btn btn-default btn-export dropdown-toggle" type="button" data-toggle="dropdown">
Expand All @@ -472,7 +478,6 @@
</ul>
</div>
</div>

<div class="panel panel-default">
<div data-toggle="collapse" data-target="#panelCollapseFMD" class="panel-heading text-info">
#{bundle['file.metadataTab.fileMetadata.header']} &#160;<span class="glyphicon glyphicon-chevron-up"/>
Expand Down
Loading