Skip to content

Commit

Permalink
Added navigation and render logic for widgets to the file pg. [ref #3578
Browse files Browse the repository at this point in the history
]
  • Loading branch information
mheppler committed Jun 16, 2017
1 parent e903302 commit fda67b2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@
rendered="#{(!DatasetPage.workingVersion.deaccessioned or (DatasetPage.workingVersion.deaccessioned and DatasetPage.canUpdateDataset()))
and (empty DatasetPage.editMode or DatasetPage.editMode == 'METADATA')}">

<div class="button-block tab-header margin-bottom text-right" jsf:rendered="#{empty DatasetPage.editMode and !widgetWrapper.widgetView}">
<div class="button-block tab-header margin-bottom text-right" jsf:rendered="#{empty DatasetPage.editMode}">
<p:commandLink type="button" styleClass="btn btn-default btn-access" actionListener="#{DatasetPage.edit('METADATA')}" update="@form,:messagePanel" oncomplete="javascript:post_edit_metadata()"
disabled="#{DatasetPage.locked}" rendered="#{DatasetPage.sessionUserAuthenticated and empty DatasetPage.editMode and !widgetWrapper.widgetView
and DatasetPage.canUpdateDataset() and !DatasetPage.dataset.deaccessioned }">
disabled="#{DatasetPage.locked}" rendered="#{!widgetWrapper.widgetView and (DatasetPage.sessionUserAuthenticated and empty DatasetPage.editMode and !widgetWrapper.widgetView
and DatasetPage.canUpdateDataset() and !DatasetPage.dataset.deaccessioned)}">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<span class="glyphicon glyphicon-pencil"/> #{bundle['file.dataFilesTab.metadata.addBtn']}
</p:commandLink>
Expand Down
13 changes: 13 additions & 0 deletions src/main/webapp/file-versions.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
xmlns:o="http://omnifaces.org/ui"
xmlns:jsf="http://xmlns.jcp.org/jsf">

<ui:fragment rendered="#{widgetWrapper.widgetView}">
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/>
<h:outputFormat value=" #{bundle['file.dataFilesTab.versions.widget.viewMoreInfo']}" escape="false">
<f:param value="#{FilePage.fileMetadata.datasetVersion.dataset.globalId}"/>
<f:param value="#{FilePage.fileMetadata.datasetVersion.dataset.displayName}"/>
<f:param value="#{dataverseServiceBean.findRootDataverse().displayName}"/>
</h:outputFormat>
</p>
</ui:fragment>

<ui:fragment rendered="#{!widgetWrapper.widgetView}">
<!-- VERSIONS -->
<script type="text/javascript">
/* Version tab: Retrieve data after page load */
Expand Down Expand Up @@ -128,4 +140,5 @@
<!-- end: date column -->
</p:dataTable>
<!-- / VERSIONS -->
</ui:fragment>
</ui:composition>
14 changes: 7 additions & 7 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div id="topDatasetBlock" class="row">
<div id="actionButtonBlock" class="col-xs-12">
<!-- Metrics -->
<div id="metrics-block" class="col-xs-3" jsf:rendered="#{!FilePage.fileMetadata.datasetVersion.deaccessioned}">
<div id="metrics-block" class="col-xs-3" jsf:rendered="#{!widgetWrapper.widgetView and !FilePage.fileMetadata.datasetVersion.deaccessioned}">
<div id="metrics-label" class="col-xs-4 small text-center">
<span class="glyphicon glyphicon-stats"/> #{bundle['metrics.title']}
</div>
Expand All @@ -43,7 +43,7 @@

<div class="button-block pull-right">
<!-- Email/Share Button Group -->
<div class="btn-group" id="datasetButtonBar" role="group">
<div class="btn-group" id="datasetButtonBar" role="group" jsf:rendered="#{!widgetWrapper.widgetView}">
<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=""/>
Expand Down Expand Up @@ -71,7 +71,7 @@
</p:dialog>
<!-- END: Email/Share Button Group -->

<div class="button-container btn-group">
<div class="button-container btn-group" jsf:rendered="#{!widgetWrapper.widgetView}">
<!-- Map Data/Set Up Button Block -->
<ui:fragment rendered="#{(worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata))
or (!FilePage.fileMetadata.datasetVersion.deaccessioned or
Expand Down Expand Up @@ -278,14 +278,14 @@
<!-- Add + Edit Metadata Button -->
<div class="button-block tab-header margin-bottom text-right">
<h:outputLink class="btn btn-default btn-access" value="/editdatafiles.xhtml?selectedFileIds=#{FilePage.fileMetadata.dataFile.id}&#38;datasetId=#{FilePage.fileMetadata.datasetVersion.dataset.id}&#38;mode=SINGLE"
rendered="#{dataverseSession.user.authenticated
rendered="#{!widgetWrapper.widgetView and (dataverseSession.user.authenticated
and permissionsWrapper.canIssueUpdateDatasetCommand(FilePage.fileMetadata.datasetVersion.dataset)
and !(dataFileServiceBean.hasReplacement(FilePage.fileMetadata.dataFile) or dataFileServiceBean.hasBeenDeleted(FilePage.fileMetadata.dataFile))}">
and !(dataFileServiceBean.hasReplacement(FilePage.fileMetadata.dataFile) or dataFileServiceBean.hasBeenDeleted(FilePage.fileMetadata.dataFile)))}">
<span class="glyphicon glyphicon-pencil"/> #{bundle['file.dataFilesTab.metadata.addBtn']}
</h:outputLink>
<div class="btn-group" jsf:rendered="#{dataverseSession.user.authenticated
<div class="btn-group" jsf:rendered="#{!widgetWrapper.widgetView and (dataverseSession.user.authenticated
and permissionsWrapper.canIssueUpdateDatasetCommand(FilePage.fileMetadata.datasetVersion.dataset)
and (dataFileServiceBean.hasReplacement(FilePage.fileMetadata.dataFile) or dataFileServiceBean.hasBeenDeleted(FilePage.fileMetadata.dataFile)) }">
and (dataFileServiceBean.hasReplacement(FilePage.fileMetadata.dataFile) or dataFileServiceBean.hasBeenDeleted(FilePage.fileMetadata.dataFile)))}">
<p:commandLink styleClass="btn btn-default btn-access" onclick="PF('fileAlreadyReplacedPrevious').show()">
<span class="glyphicon glyphicon-pencil"/> #{bundle['dataset.editBtn']}
</p:commandLink>
Expand Down
19 changes: 8 additions & 11 deletions src/main/webapp/filesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,13 @@

<ui:fragment rendered="#{fileMetadata.datasetVersion.released or ((fileMetadata.datasetVersion.deaccessioned or fileMetadata.datasetVersion.draft)
and permissionServiceBean.on(DatasetPage.dataset).has('ViewUnpublishedDataset'))}">
<ui:fragment rendered="#{!(fileMetadata.datasetVersion.released or fileMetadata.datasetVersion.deaccessioned)}">
<a id="fileNameLink" href="/file.xhtml?fileId=#{fileMetadata.dataFile.id}&#38;version=#{fileMetadata.datasetVersion.versionState}" class="ui-commandlink ui-widget">
<h:outputText value="#{fileMetadata.label}" /></a>
</ui:fragment>
<ui:fragment rendered="#{(fileMetadata.datasetVersion.released or fileMetadata.datasetVersion.deaccessioned)}">
<a id="fileNameLink" href="/file.xhtml?fileId=#{fileMetadata.dataFile.id}&#38;version=#{fileMetadata.datasetVersion.versionNumber}.#{fileMetadata.datasetVersion.minorVersionNumber}" class="ui-commandlink ui-widget">
<h:outputText value="#{fileMetadata.label}" /></a>
</ui:fragment>
<!-- rendered="# {!(fileMetadata.datasetVersion.released or fileMetadata.datasetVersion.deaccessioned)}" -->
<h:outputLink id="fileNameLink" value="#{widgetWrapper.wrapURL('/file.xhtml')}">
<f:param name="fileId" value="#{fileMetadata.dataFile.id}" />
<f:param name="version" value="#{fileMetadata.datasetVersion.versionState}" />
<f:param name="version" rendered="#{(fileMetadata.datasetVersion.released or fileMetadata.datasetVersion.deaccessioned)}" value=".#{fileMetadata.datasetVersion.minorVersionNumber}" />
<h:outputText value="#{fileMetadata.label}" />
</h:outputLink>
</ui:fragment>

<!-- TYPE + SIZE + DATE + CHECKSUM -->
Expand Down Expand Up @@ -263,8 +262,6 @@

</p:column>
<p:column class="col-file-action text-right" rendered="#{!(DatasetPage.editMode == 'FILE' or DatasetPage.editMode == 'CREATE')}">


<f:facet name="header" class="col-file-action text-right">
<!-- EDIT -->
<div style="margin-right:14px;" class="btn-group" jsf:rendered="#{DatasetPage.sessionUserAuthenticated
Expand Down Expand Up @@ -345,7 +342,7 @@
#{bundle['file.ingestInProgress']}
</div>

<ui:fragment rendered="#{worldMapPermissionHelper.canUserSeeMapDataButtonFromPage(fileMetadata) or worldMapPermissionHelper.canSeeMapButtonReminderToPublishFromPage(fileMetadata)}">
<ui:fragment rendered="#{!widgetWrapper.widgetView and (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()}"/>
Expand Down

0 comments on commit fda67b2

Please sign in to comment.