Skip to content

Commit

Permalink
Swapped two publish btns for one with new components for dynamic attr…
Browse files Browse the repository at this point in the history
…ibutes [ref #6684]
  • Loading branch information
mheppler committed Jun 5, 2020
1 parent 69e9626 commit f8cdb17
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,24 @@
<!-- PUBLISH DATASET -->
<div class="btn-group btn-group-justified" jsf:rendered="#{showPublishLink or showSubmitForReviewLink}">
<div class="btn-group">
<!-- Publish DROPDOWN btn -->
<button jsf:rendered="#{showSubmitForReviewLink or showReturnToAuthorLink}" type="button" class="btn btn-default btn-access btn-publish dropdown-toggle #{DatasetPage.lockedFromPublishing ? 'disabled' : ''}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
#{bundle['dataset.publishBtn']}<span class="caret"></span>
</button>
<!-- TO-DO...
add render logic to display this single-click btn and hide the dropdown btn
if the only option link displayed is a single publish link... -->
<!-- Publish SINGLE-CLICK btn -->
<button jsf:rendered="#{!(showSubmitForReviewLink or showReturnToAuthorLink)}" type="button" class="btn btn-default btn-access btn-publish #{DatasetPage.lockedFromPublishing ? 'disabled' : ''}"
onclick="$(this).parent().find( 'li > a' ).trigger( 'click' );">
#{bundle['dataset.publishBtn']}
</button>
<!-- Publish BTN -->
<h:outputLink value="#" disabled="#{DatasetPage.lockedFromPublishing}">
<c:if test="#{!(showSubmitForReviewLink or showReturnToAuthorLink)}">
<f:passThroughAttribute name="class" value="btn btn-default btn-access btn-publish #{DatasetPage.lockedFromPublishing ? 'disabled' : ''}"/>
<f:passThroughAttribute name="onclick" value="$(this).parent().find( 'li > a' ).trigger( 'click' );"/>
</c:if>
<c:if test="#{showSubmitForReviewLink or showReturnToAuthorLink}">
<f:passThroughAttribute name="class" value="btn btn-default btn-access btn-publish dropdown-toggle #{DatasetPage.lockedFromPublishing ? 'disabled' : ''}"/>
<f:passThroughAttribute name="data-toggle" value="dropdown"/>
<f:passThroughAttribute name="aria-haspopup" value="true"/>
<f:passThroughAttribute name="aria-expanded" value="false"/>
</c:if>
#{bundle['dataset.publishBtn']} <span jsf:rendered="#{showSubmitForReviewLink or showReturnToAuthorLink}" class="caret"></span>
</h:outputLink>
<!-- Publish BTN DROPDOWN-MENU OPTIONS -->
<ul class="dropdown-menu pull-right text-left">
<li jsf:rendered="#{showPublishLink}" class="#{DatasetPage.locked and !DatasetPage.dataset.latestVersion.inReview ? 'disabled' : ''}">
<!-- Publish LINK -->
<!-- Publish LINK -->
<p:commandLink styleClass="#{DatasetPage.locked and !DatasetPage.dataset.latestVersion.inReview ? 'disabled' : ''}"
disabled="#{DatasetPage.locked and !DatasetPage.dataset.latestVersion.inReview}"
action="#{DatasetPage.processPublishButton()}">
Expand Down

0 comments on commit f8cdb17

Please sign in to comment.