Skip to content

Commit

Permalink
Cleaned up the layout a bit, and added some info block messaging back…
Browse files Browse the repository at this point in the history
…. Changed the "Edit Metadata" and "Upload + Edit Files" buttons from commandButtons to Bootstrap styled commandLinks.
  • Loading branch information
mheppler committed Mar 17, 2014
1 parent c9c1eec commit 0e08cb8
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 66 deletions.
6 changes: 3 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void init() {
editVersion.setVersionNumber(new Long(1));
datasetVersionUI = new DatasetVersionUI(editVersion);
dataset.getVersions().add(editVersion);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Add New Dataset", " - Enter metadata to create the dataset's citation. You can add more metadata about this dataset after it's created."));
} else {
throw new RuntimeException("On Dataset page without id or ownerid."); // improve error handling
}
Expand All @@ -164,13 +165,12 @@ public void edit(EditMode editMode) {
this.editMode = editMode;
if (editMode == EditMode.INFO) {
editVersion = dataset.getEditVersion();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Edit Dataset Info", " - Edit your dataset info."));
} else if (editMode == EditMode.FILE) {
editVersion = dataset.getEditVersion();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Edit Dataset Files", " - Edit your dataset files. Tip: You can drag and drop your files from your desktop, directly into the upload widget."));
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Upload + Edit Dataset Files", " - You can drag and drop your files from your desktop, directly into the upload widget."));
} else if (editMode == EditMode.METADATA) {
editVersion = dataset.getEditVersion();
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Edit Dataset Metadata", " - Edit your dataset metadata."));
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Edit Dataset Metadata", " - Add more metadata about your dataset to help others easily find it."));
}
}

Expand Down
129 changes: 67 additions & 62 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ui:param name="dataverse" value="#{DatasetPage.dataset.owner}"/>
<ui:param name="dataset" value="#{DatasetPage.dataset}"/>
<ui:param name="showBreadcrumbs" value="#{empty DatasetPage.editMode}"/>
<ui:param name="showMessagePanel" value="#{true}"/>
<ui:define name="body">

<f:metadata>
Expand All @@ -27,66 +28,68 @@

<!-- Header / Button Panel -->
<ui:fragment>
<div style="float:right; padding-bottom:1em;">
<ui:fragment rendered="#{permissionServiceBean.on(DatasetPage.dataset.owner).canIssueCommand('DatasetCreateCommand') and empty DatasetPage.editMode}">
<div style="float:right; margin-left:1em;">
<div class="btn-group">
<button type="button" id="editDataSet" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-pencil" style="margin-right:.3em;"/> Edit Dataset <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu" style="text-align:left;">
<li>
<p:commandLink id="editFiles" actionListener="#{DatasetPage.edit('FILE')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<h:outputText value="Files (Upload + Edit)" />
</p:commandLink>
</li>
<li>
<p:commandLink id="editMetadata" actionListener="#{DatasetPage.edit('METADATA')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<h:outputText value="Metadata" />
</p:commandLink>
</li>
<li><a href="#" class="ui-commandlink ui-widget" style="pointer-events: none; color: grey;">Permissions</a></li>
</ul>
</div>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty DatasetPage.editMode}">
<div style="float:right;">
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-envelope" style="margin-right:.3em;"/> Contact Dataset Curator
</button>
</div>
</ui:fragment>
</div>


<!-- View mode -->
<ui:fragment rendered="#{empty DatasetPage.editMode}">
<div>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.title.strValue}">
<span id="title">#{DatasetPage.datasetVersionUI.title.strValue}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.citation}">
<div id="citation">
<span>#{DatasetPage.datasetVersionUI.citation}</span>
</div>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.description.strValue}">
<span id="description">#{DatasetPage.datasetVersionUI.description.strValue}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.keywordsStr}">
<span id="keywords">Keyword(s): #{DatasetPage.datasetVersionUI.keywordsStr}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.subjectStr}">
<span id="subject">Subject(s): #{DatasetPage.datasetVersionUI.subjectStr}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.relPublicationCitation}">
<span id="publication">Related Publication: #{DatasetPage.datasetVersionUI.relPublicationCitation} <a href="##{DatasetPage.datasetVersionUI.relPublicationUrl}" onclick="return false;">relPublicationUrl</a></span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.notesText}">
<span id="note">Notes: #{DatasetPage.datasetVersionUI.notesText}</span>
</ui:fragment>
<div id="topDatasetBlock">
<div id="actionButtonBlock" style="float:right;">
<ui:fragment rendered="#{permissionServiceBean.on(DatasetPage.dataset.owner).canIssueCommand('DatasetCreateCommand') and empty DatasetPage.editMode}">
<div style="float:right; margin-left:1em;">
<div class="btn-group">
<button type="button" id="editDataSet" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-pencil" style="margin-right:.3em;"/> Edit Dataset <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu" style="text-align:left;">
<li>
<p:commandLink id="editFiles" actionListener="#{DatasetPage.edit('FILE')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<h:outputText value="Files (Upload + Edit)" />
</p:commandLink>
</li>
<li>
<p:commandLink id="editMetadata" actionListener="#{DatasetPage.edit('METADATA')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
<h:outputText value="Metadata" />
</p:commandLink>
</li>
<li><a href="#" class="ui-commandlink ui-widget" style="pointer-events: none; color: grey;">Permissions</a></li>
</ul>
</div>
</div>
</ui:fragment>
<ui:fragment rendered="#{empty DatasetPage.editMode}">
<div style="float:right;">
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-envelope" style="margin-right:.3em;"/> Email Dataset Contact
</button>
</div>
</ui:fragment>
</div>
<div id="datasetVersionBlock">
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.title.strValue}">
<span id="title" class="clearfix">#{DatasetPage.datasetVersionUI.title.strValue}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.citation}">
<div id="citation">
<span>#{DatasetPage.datasetVersionUI.citation}</span>
</div>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.description.strValue}">
<span id="description">#{DatasetPage.datasetVersionUI.description.strValue}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.keywordsStr}">
<span id="keywords">Keyword(s): #{DatasetPage.datasetVersionUI.keywordsStr}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.subjectStr}">
<span id="subject">Subject(s): #{DatasetPage.datasetVersionUI.subjectStr}</span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.relPublicationCitation}">
<span id="publication">Related Publication: #{DatasetPage.datasetVersionUI.relPublicationCitation} <a href="#{DatasetPage.datasetVersionUI.relPublicationUrl}" target="_blank">#{DatasetPage.datasetVersionUI.relPublicationUrl}</a></span>
</ui:fragment>
<ui:fragment rendered="#{!empty DatasetPage.datasetVersionUI.notesText}">
<span id="note">Notes: #{DatasetPage.datasetVersionUI.notesText}</span>
</ui:fragment>
</div>
</div>
</ui:fragment>

Expand Down Expand Up @@ -120,9 +123,10 @@
<!-- View -->
<ui:fragment rendered="#{permissionServiceBean.on(DatasetPage.dataset.owner).canIssueCommand('DatasetCreateCommand') and empty DatasetPage.editMode}">
<div class="containder" style="text-align:right; margin-bottom:.5em;">
<p:commandButton title="Upload + Edit Files" value="Upload + Edit Files" escape="false" actionListener="#{DatasetPage.edit('FILE')}" update="@all">
<p:commandLink style="color:black;" styleClass="btn btn-default" title="Upload + Edit Files" actionListener="#{DatasetPage.edit('FILE')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
</p:commandButton>
<span class="glyphicon glyphicon-plus" style="margin-right:.3em;"/> Upload + Edit Files
</p:commandLink>
</div>
<!--<p class="bg-info" style="padding:1em; margin-right:200px;">
<h:outputText value="Use the Edit Dataverse button to edit or add metadata to this dataset." />
Expand Down Expand Up @@ -191,9 +195,10 @@

<ui:fragment rendered="#{permissionServiceBean.on(DatasetPage.dataset.owner).canIssueCommand('DatasetCreateCommand') and empty DatasetPage.editMode}">
<div class="containder" style="text-align:right; margin-bottom:.5em;">
<p:commandButton title="Edit Metadata" value="Edit Metadata" escape="false" actionListener="#{DatasetPage.edit('METADATA')}" update="@all">
<p:commandLink style="color:black;" styleClass="btn btn-default" title="Edit Metadata" actionListener="#{DatasetPage.edit('METADATA')}" update="@all">
<f:setPropertyActionListener target="#{DatasetPage.selectedTabIndex}" value="0" />
</p:commandButton>
<span class="glyphicon glyphicon-pencil" style="margin-right:.3em;"/> Edit Metadata
</p:commandLink>
</div>
<!--<p class="bg-info" style="padding:1em; margin-right:200px;">
<h:outputText value="Use the Edit Dataverse button to edit or add metadata to this dataset." />
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ div[id$="resultsTable"] > .ui-datatable-tablewrapper > table {border-collapse:se

span[id$='editDataSet'] .ui-button-text {white-space: nowrap;}

#title {display:block;font-size:1.25em;font-weight:bold; margin-bottom:.25em;}
#title {display:block;font-size:1.5em;font-weight:bold; margin-bottom:.5em;}
#author, #contact {display:block; margin-bottom:.5em;}
#citation {background-color: #FCFCE2; padding:.5em; margin-bottom:.5em;}
#description {display:block; margin-bottom:.5em;}
Expand All @@ -135,6 +135,7 @@ div.form-group .glyphicon.glyphicon-asterisk {font-size:.5em; vertical-align:tex
.btn-sm.ui-button {padding: 5px 10px;}

div[id$="filesTable"] .ui-datatable-tablewrapper thead {display:none;}
div[id$="versionsTable"] .ui-datatable-tablewrapper thead {display:none;}

/* Overwrite Primefaces */
button.btn-default.ui-button-text-only .ui-button-text {padding:0; font-size:14px;}

0 comments on commit 0e08cb8

Please sign in to comment.