Skip to content

Commit

Permalink
Created new "file-setup" include fragment for Map button, removing it…
Browse files Browse the repository at this point in the history
… from fragment with file Explore/Download buttons. [ref #3747]
  • Loading branch information
mheppler committed Apr 28, 2017
1 parent ec49142 commit 431784a
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 58 deletions.
14 changes: 0 additions & 14 deletions src/main/webapp/file-download-button-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,6 @@
</p:commandLink>
</ui:fragment>

<ui:fragment rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}">
<!-- WorldMap Map Data button group -->
<!-- 4.2.1: VERIFIED: none of these checks add any queries, if there are no map layers. -->
<!-- WorldMap Map Data -->
<h:outputLink pt:role="button" rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata)}"
type="button" styleClass="btn btn-default" value="#{fileMetadata.dataFile.getMapItURL(dataverseSession.user.id)}" role="button">
<span class="glyphicon glyphicon-map-marker"/> #{bundle['file.map']}
</h:outputLink>
<!-- Unpublished Map Data -->
<button type="button" jsf:rendered="#{worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}" class="btn btn-default" onclick="PF('mapData_popup').show()">
<span class="glyphicon glyphicon-map-marker"/> #{bundle['file.map']}
</button>
</ui:fragment>

<button type="button" jsf:rendered="#{isFilePg}" class="btn btn-default">
<span class="glyphicon glyphicon-flash"/> #{bundle['file.compute']}
</button>
Expand Down
27 changes: 27 additions & 0 deletions src/main/webapp/file-setup-button.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:jsf="http://xmlns.jcp.org/jsf"
xmlns:pt="http://java.sun.com/jsf/passthrough"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:o="http://omnifaces.org/ui"
xmlns:iqbs="http://xmlns.jcp.org/jsf/composite/iqbs">


<!-- WorldMap Map Data button group -->
<!-- 4.2.1: VERIFIED: none of these checks add any queries, if there are no map layers. -->
<!-- WorldMap Map Data -->
<h:outputLink pt:role="button" rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata)}"
type="button" styleClass="btn btn-default btn-access" value="#{fileMetadata.dataFile.getMapItURL(dataverseSession.user.id)}" role="button">
<span class="glyphicon glyphicon-map-marker"/> #{bundle['file.map']}
</h:outputLink>
<!-- Unpublished Map Data -->
<button type="button" jsf:rendered="#{worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}" class="btn btn-default btn-access" onclick="PF('mapData_popup').show()">
<span class="glyphicon glyphicon-map-marker"/> #{bundle['file.map']}
</button>

</ui:composition>
102 changes: 63 additions & 39 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,57 @@
</div>
<!-- END: Metrics -->

<div class="button-block pull-right">
<!-- Explore/Map Data/Download/Request Button Block -->
<div class="button-container btn-group pull-right" jsf:rendered="#{(!FilePage.fileMetadata.datasetVersion.deaccessioned or
<div class="button-block pull-right" >

<!-- TO-DO fix float issue with Edit/Map style="background:gold;" -->

<!-- Email/Share Button Group -->
<div class="btn-group" id="datasetButtonBar" role="group">
<p:commandLink class="text-button bootstrap-button-tooltip" title="#{bundle['dataset.email.datasetContactBtn']}"
update=":contactDialog" oncomplete="PF('contactForm').show()" actionListener="#{sendFeedbackDialog.initUserInput}">
<f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{FilePage.fileMetadata.datasetVersion.dataset}"/>
<span class="glyphicon glyphicon-envelope"/> Contact
</p:commandLink>
<p:commandLink styleClass="text-button bootstrap-button-tooltip" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}"
title="#{bundle['dataset.share.datasetShare']}"
oncomplete="PF('shareDialog').show();sharrre();">
<span class="glyphicon glyphicon-share"/> Share
</p:commandLink>
</div>
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}">
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.share.datasetShare.tip']}</p>

<div id="sharrre-widget" data-url="#{systemConfig.dataverseSiteUrl}/dataset.xhtml?persistentId=#{FilePage.fileMetadata.datasetVersion.dataset.globalId}" data-text="#{bundle['dataset.share.datasetShare.shareText']}"></div>

<div class="button-block">
<button type="button" onclick="PF('shareDialog').hide()" class="btn btn-default" value="#{bundle.close}">
#{bundle.close}
</button>
</div>
</p:dialog>
<!-- END: Email/Share Button Group -->


<!-- TO-DO BTN-GROUP RENDER LOGIC -->

<div class="button-container btn-group">

<!-- Map Data/Set Up Button Block -->
<div class="" jsf:rendered="#{(worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata))
or (!FilePage.fileMetadata.datasetVersion.deaccessioned or
(FilePage.fileMetadata.datasetVersion.deaccessioned and FilePage.canUpdateDataset()))}">
<ui:include src="file-download-button-fragment.xhtml">
<ui:include src="file-setup-button.xhtml">
<ui:param name="fileMetadata" value="#{FilePage.fileMetadata}"/>
<ui:param name="canUpdateDataset" value="#{FilePage.canUpdateDataset()}"/>
<ui:param name="downloadPopupRequired" value="#{FilePage.downloadPopupRequired}"/>
<ui:param name="guestbookResponse" value="#{FilePage.guestbookResponse}"/>
<ui:param name="guestbookResponseService" value="#{FilePage.guestbookResponseService}"/>
<ui:param name="fileDownloadService" value="#{FilePage.fileDownloadService}"/>
<ui:param name="isFilePg" value="true"/>
</ui:include>
</div>
<!-- END: Explore/Map Data/Download/Request Button Block -->
<!-- END: Map Data/Set Up Button Block -->

<!-- Edit Button Group -->
<div class="btn-group pull-right" jsf:rendered="#{dataverseSession.user.authenticated
<div class="btn-group" jsf:rendered="#{dataverseSession.user.authenticated
and permissionsWrapper.canIssueUpdateDatasetCommand(FilePage.fileMetadata.datasetVersion.dataset)
and (dataFileServiceBean.hasReplacement(FilePage.fileMetadata.dataFile) or dataFileServiceBean.hasBeenDeleted(FilePage.fileMetadata.dataFile))}">
<p:commandLink styleClass="btn btn-default btn-access" onclick="PF('fileAlreadyReplacedPrevious').show()">
Expand Down Expand Up @@ -115,35 +148,26 @@
</ul>
</div>
<!-- END: Edit Button Group -->

<!-- Email/Share Button Group -->
<div class="btn-group pull-right" id="datasetButtonBar" role="group">
<p:commandLink class="text-button bootstrap-button-tooltip" title="#{bundle['dataset.email.datasetContactBtn']}"
update=":contactDialog" oncomplete="PF('contactForm').show()" actionListener="#{sendFeedbackDialog.initUserInput}">
<f:setPropertyActionListener target="#{sendFeedbackDialog.userMessage}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.userEmail}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.messageSubject}" value=""/>
<f:setPropertyActionListener target="#{sendFeedbackDialog.recipient}" value="#{FilePage.fileMetadata.datasetVersion.dataset}"/>
<span class="glyphicon glyphicon-envelope"/> Contact
</p:commandLink>
<p:commandLink styleClass="text-button bootstrap-button-tooltip" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}"
title="#{bundle['dataset.share.datasetShare']}"
oncomplete="PF('shareDialog').show();sharrre();">
<span class="glyphicon glyphicon-share"/> Share
</p:commandLink>


</div>
<p:dialog id="shareDialog" header="#{bundle['dataset.share.datasetShare']}" widgetVar="shareDialog" modal="true" rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}">
<p class="help-block"><span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.share.datasetShare.tip']}</p>

<div id="sharrre-widget" data-url="#{systemConfig.dataverseSiteUrl}/dataset.xhtml?persistentId=#{FilePage.fileMetadata.datasetVersion.dataset.globalId}" data-text="#{bundle['dataset.share.datasetShare.shareText']}"></div>

<div class="button-block">
<button type="button" onclick="PF('shareDialog').hide()" class="btn btn-default" value="#{bundle.close}">
#{bundle.close}
</button>
</div>
</p:dialog>
<!-- END: Email/Share Button Group -->
<!-- END: TO-DO BTN-GROUP RENDER LOGIC -->

<!-- Explore/Download/Request Button Block -->
<div class="button-container btn-group" jsf:rendered="#{(!FilePage.fileMetadata.datasetVersion.deaccessioned or
(FilePage.fileMetadata.datasetVersion.deaccessioned and FilePage.canUpdateDataset()))}">
<ui:include src="file-download-button-fragment.xhtml">
<ui:param name="fileMetadata" value="#{FilePage.fileMetadata}"/>
<ui:param name="canUpdateDataset" value="#{FilePage.canUpdateDataset()}"/>
<ui:param name="downloadPopupRequired" value="#{FilePage.downloadPopupRequired}"/>
<ui:param name="guestbookResponse" value="#{FilePage.guestbookResponse}"/>
<ui:param name="guestbookResponseService" value="#{FilePage.guestbookResponseService}"/>
<ui:param name="fileDownloadService" value="#{FilePage.fileDownloadService}"/>
<ui:param name="isFilePg" value="true"/>
</ui:include>
</div>
<!-- END: Explore/Download/Request Button Block -->

</div>
</div>
</div>
Expand Down
16 changes: 11 additions & 5 deletions src/main/webapp/filesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#{bundle['file.cloudStorageAccess']}
</span>
</label>
<div class="col-sm-3 input-group">
<div class="col-md-4 col-sm-5 col-xs-6 input-group">
<p:inputText class="form-control" value="#{DatasetPage.getSwiftContainerName()}" id="copy-input" style="font-weight:normal;" type="text"/>

<span class="input-group-btn">
Expand Down Expand Up @@ -323,16 +323,22 @@
disabled="#{DatasetPage.locked}">
<span class="glyphicon glyphicon-bullhorn"/> #{bundle['file.requestAccess']}
</p:commandLink>

</f:facet>



<!-- Ingest in progress... -->
<div id="txtInprogess" class="bg-info text-info text-center margin-bottom-half" jsf:rendered="#{fileMetadata.dataFile.ingestInProgress}">
#{bundle['file.ingestInProgress']}
</div>

<div class="btn-group" jsf:rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}">

<ui:include src="file-setup-button.xhtml">
<ui:param name="fileMetadata" value="#{fileMetadata}"/>
<ui:param name="canUpdateDataset" value="#{DatasetPage.canUpdateDataset()}"/>
</ui:include>
</div>

<div class="button-blockXX btn-group">
<div class="btn-group">
<ui:include src="file-download-button-fragment.xhtml">
<ui:param name="fileMetadata" value="#{fileMetadata}"/>
<ui:param name="canUpdateDataset" value="#{DatasetPage.canUpdateDataset()}"/>
Expand Down

0 comments on commit 431784a

Please sign in to comment.