diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 98d7e89fd9e..31722d92085 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -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 ++++++++++++++++++++++++++++ diff --git a/scripts/api/setup-optional-publish-terms.sh b/scripts/api/setup-optional-publish-terms.sh new file mode 100644 index 00000000000..dc1e879ba68 --- /dev/null +++ b/scripts/api/setup-optional-publish-terms.sh @@ -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" \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index c631f0f63fb..f7fd21735f1 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -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); diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java index 219b7e5ec31..9b8470754b4 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -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(); diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 3dd81184cf7..3491e516531 100755 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1256,7 +1256,7 @@ - +

#{bundle['dataset.unregistered.tip']} @@ -1265,13 +1265,16 @@

#{bundle['dataset.publish.tip']}

+
+ +
- +

#{bundle['dataset.unregistered.tip']} @@ -1284,6 +1287,9 @@

+
+ +

#{bundle['dataset.publishBoth.tip']}

@@ -1293,10 +1299,13 @@
- +

#{bundle['dataset.republish.tip']}

+
+ +

#{bundle['dataset.selectVersionNumber']} diff --git a/src/main/webapp/resources/css/structure.css b/src/main/webapp/resources/css/structure.css index f7b525ab863..66d33dfd77e 100644 --- a/src/main/webapp/resources/css/structure.css +++ b/src/main/webapp/resources/css/structure.css @@ -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;}