diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 90db8d55afb..6c3335bc414 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -385,6 +385,13 @@ Once you have the location of your custom header HTML file, run this curl comman ``curl -X PUT -d '/var/www/dataverse/branding/custom-header.html' http://localhost:8080/api/admin/settings/:HeaderCustomizationFile`` +If you have enabled a custom header or navbar logo, you might prefer to disable the theme of the root dataverse. You can do so by setting ``:DisableRootDataverseTheme`` to ``true`` like this: + +``curl -X PUT -d 'true' http://localhost:8080/api/admin/settings/:DisableRootDataverseTheme`` + +Please note: Disabling the display of the root dataverse theme also disables your ability to edit it. Remember that dataverse owners can set their dataverses to "inherit theme" from the root. Those dataverses will continue to inherit the root dataverse theme (even though it no longer displays on the root). If you would like to edit the root dataverse theme in the future, you will have to re-enable it first. + + Custom Footer +++++++++++++ @@ -679,6 +686,11 @@ See :ref:`Branding Your Installation` above. See :ref:`Branding Your Installation` above. +:DisableRootDataverseTheme +++++++++++++++++++++++++++ + +See :ref:`Branding Your Installation` above. + :FooterCustomizationFile ++++++++++++++++++++++++ diff --git a/doc/sphinx-guides/source/user/dataverse-management.rst b/doc/sphinx-guides/source/user/dataverse-management.rst index be12c3b32aa..233a2fa0b0c 100755 --- a/doc/sphinx-guides/source/user/dataverse-management.rst +++ b/doc/sphinx-guides/source/user/dataverse-management.rst @@ -61,7 +61,7 @@ Tip: The metadata fields you select as required will appear on the Create Datase Theme ==================================================== -The Theme feature provides you with a way to customize the look of your dataverse. You can decide either to use the customization from the dataverse above yours or upload your own image file. Supported image types are JPEG, TIFF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high. Additionally, you can select the colors for the header of your dataverse and the text that appears in your dataverse. You can also add a link to your personal website, the website for your organization or institution, your department, journal, etc. +The Theme feature provides you with a way to customize the look of your dataverse. You can decide either to use the theme from the dataverse containing your dataverse (even up to the root dataverse, AKA the homepage), or upload your own image file. Supported image types are JPEG, TIFF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high. Additionally, you can select the colors for the header of your dataverse and the text that appears in your dataverse. You can also add a link to your personal website, the website for your organization or institution, your department, journal, etc. .. _dataverse-widgets: diff --git a/src/main/java/Bundle.properties b/src/main/java/Bundle.properties index fae4237f8ad..9d3acd52dea 100755 --- a/src/main/java/Bundle.properties +++ b/src/main/java/Bundle.properties @@ -749,9 +749,9 @@ dataverse.results.cards.foundInMetadata=Found in Metadata Fields: dataverse.results.cards.files.tabularData=Tabular Data dataverse.results.solrIsDown=Please note: Due to an internal error, browsing and searching is not available. dataverse.theme.title=Theme -dataverse.theme.inheritCustomization.title=Check this to use the existing theme. -dataverse.theme.inheritCustomization.label=Inherit Customization -dataverse.theme.inheritCustomization.checkbox=Inherit customization from {0} +dataverse.theme.inheritCustomization.title=For this dataverse, use the same theme as the root dataverse. +dataverse.theme.inheritCustomization.label=Inherit Theme +dataverse.theme.inheritCustomization.checkbox=Inherit theme from {0} dataverse.theme.logo=Logo dataverse.theme.logo.tip=Supported image types are JPG, TIF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high. dataverse.theme.logo.format=Logo Format @@ -794,6 +794,7 @@ dataverse.theme.website.title=URL for your personal website, institution, or any dataverse.theme.website.tip=The website will be linked behind the tagline. To have a website listed, you must also provide a tagline. dataverse.theme.website.watermark=Your personal site, http://... dataverse.theme.website.invalidMsg=Invalid URL. +dataverse.theme.disabled=The theme for the root dataverse has been administratively disabled with the :DisableRootDataverseTheme database setting. dataverse.widgets.title=Widgets dataverse.widgets.notPublished.why.header=Why Use Widgets? dataverse.widgets.notPublished.why.reason1=Increases the web visibility of your data by allowing you to embed your dataverse and datasets into your personal or project website. diff --git a/src/main/java/edu/harvard/iq/dataverse/DataverseHeaderFragment.java b/src/main/java/edu/harvard/iq/dataverse/DataverseHeaderFragment.java index d3607a27093..dfe6e5e70c9 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DataverseHeaderFragment.java +++ b/src/main/java/edu/harvard/iq/dataverse/DataverseHeaderFragment.java @@ -249,6 +249,18 @@ public boolean isSignupAllowed() { return signupAllowed; } + public boolean isRootDataverseThemeDisabled(Dataverse dataverse) { + if (dataverse == null) { + return false; + } + if (dataverse.getOwner() == null) { + // We're operating on the root dataverse. + return settingsWrapper.isRootDataverseThemeDisabled(); + } else { + return false; + } + } + public String getSignupUrl(String loginRedirect) { String nonNullDefaultIfKeyNotFound = ""; String signUpUrl = settingsWrapper.getValueForKey(SettingsServiceBean.Key.SignUpUrl, nonNullDefaultIfKeyNotFound); diff --git a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java index 75ae1e00b96..0dfa2d67885 100644 --- a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java +++ b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java @@ -155,5 +155,9 @@ public String getSupportTeamName() { return BrandingUtil.getSupportTeamName(systemAddress, dataverseService.findRootDataverse().getName()); } + public boolean isRootDataverseThemeDisabled() { + return isTrueForKey(Key.DisableRootDataverseTheme, false); + } + } diff --git a/src/main/java/edu/harvard/iq/dataverse/ThemeWidgetFragment.java b/src/main/java/edu/harvard/iq/dataverse/ThemeWidgetFragment.java index 17b59eb27fd..d9cecd71343 100644 --- a/src/main/java/edu/harvard/iq/dataverse/ThemeWidgetFragment.java +++ b/src/main/java/edu/harvard/iq/dataverse/ThemeWidgetFragment.java @@ -44,8 +44,8 @@ @ViewScoped @Named public class ThemeWidgetFragment implements java.io.Serializable { - static final String DEFAULT_LOGO_BACKGROUND_COLOR = "F5F5F5"; - static final String DEFAULT_BACKGROUND_COLOR = "F5F5F5"; + static final String DEFAULT_LOGO_BACKGROUND_COLOR = "FFFFFF"; + static final String DEFAULT_BACKGROUND_COLOR = "FFFFFF"; static final String DEFAULT_LINK_COLOR = "428BCA"; static final String DEFAULT_TEXT_COLOR = "888888"; private static final Logger logger = Logger.getLogger(ThemeWidgetFragment.class.getCanonicalName()); diff --git a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java index 97f3925b5ec..b75f8ae4f19 100644 --- a/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java +++ b/src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java @@ -97,10 +97,6 @@ public class Dataverses extends AbstractApiBean { @Deprecated private static final Logger LOGGER = Logger.getLogger(Dataverses.class.getName()); private static final Logger logger = Logger.getLogger(Dataverses.class.getCanonicalName()); -// static final String DEFAULT_LOGO_BACKGROUND_COLOR = "F5F5F5"; -// static final String DEFAULT_BACKGROUND_COLOR = "F5F5F5"; -// static final String DEFAULT_LINK_COLOR = "428BCA"; -// static final String DEFAULT_TEXT_COLOR = "888888"; @EJB ExplicitGroupServiceBean explicitGroupSvc; 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 94024bf5949..f163bcaea0f 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -309,6 +309,12 @@ Whether Harvesting (OAI) service is enabled // Option to override multiple guides with a single url NavbarGuidesUrl, + /** + * The theme for the root dataverse can get in the way when you try make + * use of HeaderCustomizationFile and LogoCustomizationFile so this is a + * way to disable it. + */ + DisableRootDataverseTheme, // Limit on how many guestbook entries to display on the guestbook-responses page: GuestbookResponsesPageDisplayLimit, diff --git a/src/main/webapp/dataverse_header.xhtml b/src/main/webapp/dataverse_header.xhtml index 8ec2ced172f..1582d7acbf6 100644 --- a/src/main/webapp/dataverse_header.xhtml +++ b/src/main/webapp/dataverse_header.xhtml @@ -154,11 +154,13 @@ +
+ style="background:##{!empty dataverse.dataverseTheme.backgroundColor ? dataverse.dataverseTheme.backgroundColor : 'FFFFFF'};" + jsf:rendered="#{showDataverseHeader and !widgetWrapper.widgetView and !dataverseHeaderFragment.isRootDataverseThemeDisabled(dataverse)}"> -