Skip to content

Commit

Permalink
UI clean up for the Download, Request Access buttons, as well as othe…
Browse files Browse the repository at this point in the history
…r general clean up on the dataset pg. [ref #1665 #2503]
  • Loading branch information
mheppler committed Sep 16, 2015
1 parent 855383b commit 75b4194
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 95 deletions.
168 changes: 75 additions & 93 deletions src/main/webapp/filesFragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,103 +30,87 @@
</p:ajax>
<f:facet name="header">
<h:inputHidden id="showAccessPopup" value="#{DatasetPage.showAccessPopup}"/>
<div id="filesHeaderBlock" class="clearfix margin-bottom" style="margin-bottom:0;">

<div id="filesHeaderBlock" class="clearfix">
<!-- Button Panels -->
<div jsf:id="zipDownloadPanel" class="button-block pull-right text-right"
jsf:rendered="#{!(DatasetPage.editMode == 'FILE' or DatasetPage.editMode == 'CREATE')
and (permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)
or (!(empty DatasetPage.workingVersion.fileMetadatas) and DatasetPage.workingVersion.fileMetadatas.size() > 1))}">



<h:outputLink value="/editdatafiles.xhtml?datasetId=#{DatasetPage.dataset.id}&#38;mode=UPLOAD"
type="button" styleClass="btn btn-default"
disabled="#{DatasetPage.locked}" rendered="#{dataverseSession.user.authenticated and permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)}">
<span class="glyphicon #{DatasetPage.locked ? 'glyphicon-ban-circle' : 'glyphicon-plus'}"/> <h:outputText id="uploadFile-s-Link" value="#{bundle['file.uploadFiles']}"/>
</h:outputLink>

<ui:fragment rendered="#{dataverseSession.user.authenticated
and permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)}" >
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
disabled="#{DatasetPage.locked or empty DatasetPage.selectedFiles ? 'disabled' : ''}">
<span class="glyphicon glyphicon-pencil"/> <!-- # {bundle['file.bulkUpdate']} --> Edit Files <span class="caret"></span>
</button>
<ul class="dropdown-menu multi-level pull-right text-left" role="menu">
<li>
<p:commandLink

disabled="#{empty DatasetPage.selectedFiles}"
onclick="deleteSelectedFileConfirmation.show()">
<h:outputText value="#{bundle['file.delete']}"/>
</p:commandLink>
</li>
<li>
<h:outputLink value="/editdatafiles.xhtml?selectedFileIds=#{DatasetPage.selectedFilesIdsString}&#38;datasetId=#{DatasetPage.dataset.id}"
disabled="#{DatasetPage.locked or empty DatasetPage.selectedFiles}" >
<h:outputText id="editFile-Multi-Link" value="Metadata"/>
</h:outputLink>
</li>
<li class="#{empty DatasetPage.selectedUnrestrictedFiles ? 'disabled' : ''}">
<p:commandLink oncomplete="toggle_dropdown();"
onclick="accessPopup.show()"
disabled="#{empty DatasetPage.selectedUnrestrictedFiles}">
<h:outputText value="#{bundle['file.restrict']}"/>
</p:commandLink>
</li>
<li class="#{empty DatasetPage.selectedRestrictedFiles ? 'disabled' : ''}">
<p:commandLink update="filesTable,:messagePanel" oncomplete="toggle_dropdown();" actionListener="#{DatasetPage.restrictSelectedFiles(false)}"
disabled="#{empty DatasetPage.selectedRestrictedFiles}">
<h:outputText value="#{bundle['file.unrestrict']}"/>
</p:commandLink>
</li>
<li>
<p:commandLink id="fileCategoriesLink"
disabled="#{empty DatasetPage.selectedFiles}"
actionListener="#{DatasetPage.refreshCategoriesByName()}"
update=":datasetForm:fileTagsPopup"
oncomplete="fileTagsPopup.show();bind_bsui_components();">
Tags
</p:commandLink>
</li>
</ul>
</div>
</ui:fragment>




<ui:fragment rendered="#{(!(empty DatasetPage.workingVersion.fileMetadatas) and DatasetPage.workingVersion.fileMetadatas.size() > 1)}" >
<div class="btn-group" jsf:rendered="#{(!(empty DatasetPage.workingVersion.fileMetadatas) and DatasetPage.workingVersion.fileMetadatas.size() > 1) and DatasetPage.downloadButtonAvailable }">
<p:commandLink rendered="#{ !(DatasetPage.downloadPopupRequired) }"
type="button" styleClass="btn btn-default"
disabled="#{!DatasetPage.downloadSelectedButtonEnabled}"
actionListener="#{DatasetPage.startMultipleFileDownload()}">
<span class="glyphicon glyphicon-download-alt"/> #{bundle.download}
</p:commandLink>
<!-- guest book or terms of use, etc. enabled - open "download popup" first: -->
<p:commandLink rendered="#{DatasetPage.downloadPopupRequired }"
type="button" styleClass="btn btn-default"
disabled="#{!DatasetPage.downloadSelectedButtonEnabled}"
action="#{DatasetPage.initGuestbookMultipleResponse()}"
update="@form" oncomplete="downloadPopup.show();handleResizeDialog('downloadPopup');">
<span class="glyphicon glyphicon-download-alt"/> #{bundle.download}
</p:commandLink>
</div>
</ui:fragment>

<div class="btn-group" jsf:rendered="#{dataverseSession.user.authenticated
and permissionsWrapper.canIssueUpdateDatasetCommand(DatasetPage.dataset)}">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
disabled="#{DatasetPage.locked or empty DatasetPage.selectedFiles ? 'disabled' : ''}">
<span class="glyphicon glyphicon-pencil"/> #{bundle['file.editFiles']} <span class="caret"></span>
</button>
<ul class="dropdown-menu multi-level pull-right text-left" role="menu">
<li>
<p:commandLink onclick="deleteSelectedFileConfirmation.show()"
disabled="#{empty DatasetPage.selectedFiles}">
<h:outputText value="#{bundle['file.delete']}"/>
</p:commandLink>
</li>
<li class="#{DatasetPage.locked or empty DatasetPage.selectedFiles ? 'disabled' : ''}">
<h:outputLink value="/editdatafiles.xhtml?selectedFileIds=#{DatasetPage.selectedFilesIdsString}&#38;datasetId=#{DatasetPage.dataset.id}"
disabled="#{DatasetPage.locked or empty DatasetPage.selectedFiles}">
<h:outputText id="editFile-Multi-Link" value="Metadata"/>
</h:outputLink>
</li>
<li class="#{empty DatasetPage.selectedUnrestrictedFiles ? 'disabled' : ''}">
<p:commandLink oncomplete="toggle_dropdown();" onclick="accessPopup.show()"
disabled="#{empty DatasetPage.selectedUnrestrictedFiles}">
<h:outputText value="#{bundle['file.restrict']}"/>
</p:commandLink>
</li>
<li class="#{empty DatasetPage.selectedRestrictedFiles ? 'disabled' : ''}">
<p:commandLink update="filesTable,:messagePanel" oncomplete="toggle_dropdown();" actionListener="#{DatasetPage.restrictSelectedFiles(false)}"
disabled="#{empty DatasetPage.selectedRestrictedFiles}">
<h:outputText value="#{bundle['file.unrestrict']}"/>
</p:commandLink>
</li>
<li class="#{empty DatasetPage.selectedFiles ? 'disabled' : ''}">
<p:commandLink id="fileCategoriesLink"
disabled="#{empty DatasetPage.selectedFiles}"
actionListener="#{DatasetPage.refreshCategoriesByName()}"
update=":datasetForm:fileTagsPopup"
oncomplete="fileTagsPopup.show();bind_bsui_components();">
#{bundle['file.tags']}
</p:commandLink>
</li>
</ul>
</div>
<div class="btn-group" jsf:rendered="#{(!(empty DatasetPage.workingVersion.fileMetadatas)
and DatasetPage.workingVersion.fileMetadatas.size() > 1) and DatasetPage.downloadButtonAvailable}">
<p:commandLink rendered="#{!(DatasetPage.downloadPopupRequired)}"
type="button" styleClass="btn btn-default"
disabled="#{!DatasetPage.downloadSelectedButtonEnabled}"
actionListener="#{DatasetPage.startMultipleFileDownload()}">
<span class="glyphicon glyphicon-download-alt"/> #{bundle.download}
</p:commandLink>
<!-- guest book or terms of use, etc. enabled - open "download popup" first: -->
<p:commandLink rendered="#{DatasetPage.downloadPopupRequired}"
type="button" styleClass="btn btn-default"
disabled="#{!DatasetPage.downloadSelectedButtonEnabled}"
action="#{DatasetPage.initGuestbookMultipleResponse()}"
update="@form" oncomplete="downloadPopup.show();handleResizeDialog('downloadPopup');">
<span class="glyphicon glyphicon-download-alt"/> #{bundle.download}
</p:commandLink>
</div>
<p:commandLink rendered="#{DatasetPage.fileAccessRequestMultiButtonRequired}"
type="button" styleClass="btn btn-default" value="Request Access"
actionListener="#{DatasetPage.requestAccessMultipleFiles(DatasetPage.selectedFilesIdsString)}"
disabled="#{DatasetPage.locked or !DatasetPage.fileAccessRequestMultiButtonEnabled}"
update="filesTable">
type="button" styleClass="btn btn-default"
update="filesTable" actionListener="#{DatasetPage.requestAccessMultipleFiles(DatasetPage.selectedFilesIdsString)}"
disabled="#{DatasetPage.locked or !DatasetPage.fileAccessRequestMultiButtonEnabled}">
<span class="glyphicon glyphicon-bullhorn"/> #{bundle['file.requestAccess']}
</p:commandLink>

<p:commandLink rendered="#{DatasetPage.fileAccessRequestMultiSignUpButtonRequired}"
type="button" styleClass="btn btn-default" value="Sign up for Request Access"
type="button" styleClass="btn btn-default"
onclick="accessSignUpLogIn_popup.show()"
disabled="#{DatasetPage.locked or !DatasetPage.fileAccessRequestMultiSignUpButtonEnabled}">
disabled="#{DatasetPage.locked or !DatasetPage.fileAccessRequestMultiSignUpButtonEnabled}">
<span class="glyphicon glyphicon-bullhorn"/> #{bundle['file.requestAccess']}
</p:commandLink>
</div>
<!--SORT BUTTON-->
Expand Down Expand Up @@ -191,21 +175,19 @@
</p:commandLink>
</div>
</div>
<div class="" style="overflow:hidden;">
<div style="width:36px;padding:4px 10px;float:left;">
<span class="bootstrap-button-tooltip" style="display:inline-block;" title="Select All">
<p:selectBooleanCheckbox value="#{DatasetPage.selectAllFiles}" style="margin:0 0 2px 0;">
<div class="clearfix">
<div id="filesHeaderSelectAll" class="pull-left">
<span class="bootstrap-button-tooltip" title="Select All">
<p:selectBooleanCheckbox value="#{DatasetPage.selectAllFiles}">
<p:ajax update="filesTable" listener="#{DatasetPage.toggleSelectedFiles}" oncomplete="bind_bsui_components();" />
</p:selectBooleanCheckbox>
</span>
</div>
<div style="float:left;padding:4px 10px;">
<div id="filesHeaderCount" class="pull-left text-left">
<!-- Files Count -->
<div id="filesHeaderCount" class="text-left">
<h:outputFormat value="#{bundle['file.count']}" styleClass="highlightBold" style="padding:0;line-height:1.65;">
<f:param value="#{DatasetPage.workingVersion.fileMetadatas.size()}"/>
</h:outputFormat>
</div>
<h:outputFormat value="#{bundle['file.count']}" styleClass="highlightBold">
<f:param value="#{DatasetPage.workingVersion.fileMetadatas.size()}"/>
</h:outputFormat>
</div>
</div>
</f:facet>
Expand Down
9 changes: 7 additions & 2 deletions src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ td.col-file-action > .button-block, td.col-manage-action > .button-block,
div.ui-datatable-header > .button-block, #filesHeaderBlock > .button-block {margin-top:0;}
form.btn-form {display:inline-block;}
.button-block button, .button-block a.btn, .button-block input.btn, .button-block div.btn-group {margin-right:1em;}
.button-block span.ingest-warning {margin-right:.5em;}
.button-block div.btn-group div.btn-group {margin-right:0;}
.button-block button.pull-right:first-child, .button-block a.btn.pull-right:first-child, .button-block div.btn-group.pull-right:first-child,
.button-block div.btn-group button, .button-block div.btn-group a.btn {margin-right:0;}
Expand Down Expand Up @@ -613,7 +614,10 @@ div[id$="filesTable"] .ui-datatable-tablewrapper thead {display:none;}
div[id$="versionsTable"] .ui-datatable-tablewrapper thead {display:none;}

div[id$="filesTable"] div.ui-datatable-header.ui-widget-header {padding:0; background:none; border:0;}
div[id$="filesTable"] #filesHeaderCount span.highlightBold {display:block; padding: 8px 0;}
div[id$="filesTable"] #filesHeaderSelectAll {width:36px; padding:4px 10px;}
div[id$="filesTable"] #filesHeaderSelectAll .ui-chkbox.ui-widget {margin:0 0 2px 0;}
div[id$="filesTable"] #filesHeaderCount {padding:4px 10px;}
div[id$="filesTable"] #filesHeaderCount span.highlightBold {display:block; padding:0; line-height:1.65;}
div[id$="filesTable"] td.col-file-thumb {width:64px; border-right:0;}
div[id$="filesTable"] td.col-file-thumb div.thumbnail-block {position:relative;width:64px;height:64px;margin:0 auto;}
div[id$="filesTable"] td.col-file-thumb div.thumbnail-block span.file-thumbnail-icon {font-size:62px;line-height:1.05;}
Expand Down Expand Up @@ -663,4 +667,5 @@ button.btn-default.ui-button-text-only .ui-button-text {padding:0; font-size:14p
.ui-widget-content a.btn-default {color:#333;}
.ui-messages-info-detail, .ui-messages-warn-detail, .ui-messages-error-detail, .ui-messages-fatal-detail, .ui-message-info-detail, .ui-message-warn-detail, .ui-message-error-detail, .ui-message-fatal-detail {
margin-left: 0px;
}
}
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled {background: #e0e0e0; border-color: #ccc; opacity: 0.65;}

0 comments on commit 75b4194

Please sign in to comment.