Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,20 @@ Set ``GeoconnectViewMaps`` to true to allow a user to view existing maps. This b

``curl -X PUT -d true http://localhost:8080/api/admin/settings/:GeoconnectViewMaps``

:DatasetPublishPopupCustomText
++++++++++++++++++++++++++++++

Set custom text a user will view when publishing a dataset.

``curl -X PUT -d "Deposit License Requirements" http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomText``

:DatasetPublishPopupCustomTextOnAllVersions
+++++++++++++++++++++++++++++++++++++++++++

Set whether a user will see the custom text when publishing all versions of a dataset

``curl -X PUT -d true http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions``

:SearchHighlightFragmentSize
++++++++++++++++++++++++++++

Expand Down
8 changes: 8 additions & 0 deletions scripts/api/setup-optional-publish-terms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash


SERVER=http://localhost:8080/api

echo "- Enabling Publish Popup Custom Text"
curl -s -X PUT -d true "$SERVER/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions"
curl -s -X PUT -d "Deposit License Requirements" "$SERVER/admin/settings/:DatasetPublishPopupCustomText"
13 changes: 13 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3132,6 +3132,19 @@ public void downloadCitationRIS(FileMetadata fileMetadata) {

}
}

public String getDatasetPublishCustomText(){
String datasetPublishCustomText = settingsService.getValueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomText);
if( datasetPublishCustomText!= null && !datasetPublishCustomText.isEmpty()){
return datasetPublishCustomText;

}
return "";
}

public Boolean isDatasetPublishPopupCustomTextOnAllVersions(){
return settingsService.isTrueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomTextOnAllVersions, false);
}

public String getDataExploreURL() {
String TwoRavensUrl = settingsService.getValueForKey(SettingsServiceBean.Key.TwoRavensUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,17 @@ public enum Key {
Explore World Map Button
Default is false;
*/
GeoconnectViewMaps;
GeoconnectViewMaps,
/**
The message added to a popup upon dataset publish
*
*/
DatasetPublishPopupCustomText,
/*
Whether to display the publish text for every published version
*/
DatasetPublishPopupCustomTextOnAllVersions;

@Override
public String toString() {
return ":" + name();
Expand Down
15 changes: 12 additions & 3 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@
</p:dialog>

<!-- Publish/Submit for Review Dialogs -->
<p:dialog header="#{bundle['dataset.publish.header']}" widgetVar="publishConfirm" modal="true">
<p:dialog width="70%" header="#{bundle['dataset.publish.header']}" widgetVar="publishConfirm" modal="true">
<ui:fragment rendered="#{DatasetPage.dataset.globalIdCreateTime == null}">
<p class="text-danger">
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.unregistered.tip']}
Expand All @@ -1265,13 +1265,16 @@
<p class="text-danger">
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.publish.tip']}
</p>
<div id="terms-agreement-block" class="well" jsf:rendered="#{DatasetPage.datasetPublishCustomText.length() > 0}">
<h:outputText value="#{DatasetPage.datasetPublishCustomText}" escape="false"/>
</div>
<div class="button-block">
<p:commandButton value="#{bundle.continue}" onclick="PF('publishConfirm').hide();PF('blockDatasetForm').hide();" action="#{DatasetPage.releaseDataset}" />
<p:commandButton value="#{bundle.cancel}" onclick="PF('publishConfirm').hide();PF('blockDatasetForm').hide();" type="button" />
</div>
</p:dialog>

<p:dialog header="#{bundle['dataset.publish.header']}" widgetVar="publishParent" modal="true">
<p:dialog width="70%" header="#{bundle['dataset.publish.header']}" widgetVar="publishParent" modal="true">
<ui:fragment rendered="#{DatasetPage.dataset.globalIdCreateTime == null}">
<p class="text-danger">
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.unregistered.tip']}
Expand All @@ -1284,6 +1287,9 @@
<f:param value="#{DatasetPage.dataset.owner.displayName}"/>
</h:outputFormat>
</p>
<div id="terms-agreement-block" class="well" jsf:rendered="#{DatasetPage.datasetPublishCustomText.length() > 0}">
<h:outputText value="#{DatasetPage.datasetPublishCustomText}" escape="false"/>
</div>
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.publishBoth.tip']}
</p>
Expand All @@ -1293,10 +1299,13 @@
</div>
</p:dialog>

<p:dialog header="#{bundle['dataset.publish.header']}" widgetVar="releaseDraft" modal="true">
<p:dialog width="70%" header="#{bundle['dataset.publish.header']}" widgetVar="releaseDraft" modal="true">
<p class="text-danger">
<span class="glyphicon glyphicon-warning-sign"/> #{bundle['dataset.republish.tip']}
</p>
<div id="terms-agreement-block" class="well" jsf:rendered="#{DatasetPage.datasetPublishCustomText.length() > 0 and DatasetPage.isDatasetPublishPopupCustomTextOnAllVersions()}">
<h:outputText value="#{DatasetPage.datasetPublishCustomText}" escape="false"/>
</div>
<ui:fragment rendered="#{DatasetPage.dataset.latestVersion.minorUpdate}">
<p class="help-block">
<span class="glyphicon glyphicon-info-sign"/> #{bundle['dataset.selectVersionNumber']}
Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/resources/css/structure.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ ul.IdPSelectDropDown > .disabled > a:hover, ul.IdPSelectDropDown > .disabled > a

/* -------- USER -------- */
#terms-agreement-block {max-height:200px; margin-bottom: .5em; padding: 12px; overflow-y:scroll; box-shadow:none; background-image: none; background-color: #f5f5f5;}
#terms-agreement-block h1, #terms-agreement-block h2, #terms-agreement-block h3,
#terms-agreement-block h4, #terms-agreement-block h5, #terms-agreement-block h6 {margin-top:0;}
div[id$='notifications'].ui-tabs-panel div.table-container {display:table;}
div[id$='notifications'].ui-tabs-panel div.notification-item {display:table-row;}
div[id$='notifications'].ui-tabs-panel div.notification-item-cell {display:table-cell; border-bottom:1px solid #DDDDDD; padding:5px;}
Expand Down