diff --git a/README.md b/README.md index cfe9009..51898d6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# DEPRECATED: This theme is now included as a core Discourse theme in https://github.com/discourse/discourse, +# if you have this theme installed, please remove it. + Horizon is a simple, beautiful theme that improves the out-of-the-box experience for Discourse sites. https://meta.discourse.org/t/horizon-theme/360486 diff --git a/about.json b/about.json index d24a599..11c5b37 100644 --- a/about.json +++ b/about.json @@ -1,5 +1,5 @@ { - "name": "Horizon", + "name": "Horizon (beta)", "authors": "Design Team", "about_url": "https://meta.discourse.org/t/horizon-theme/360486", "license_url": "https://github.com/discourse/horizon/blob/main/LICENSE", diff --git a/javascripts/discourse/api-initializers/horizon.gjs b/javascripts/discourse/api-initializers/horizon.gjs index 36342d8..5ce8b29 100644 --- a/javascripts/discourse/api-initializers/horizon.gjs +++ b/javascripts/discourse/api-initializers/horizon.gjs @@ -1,8 +1,26 @@ +import { addGlobalNotice } from "discourse/components/global-notice"; import { apiInitializer } from "discourse/lib/api"; +import getURL from "discourse/lib/get-url"; +import { currentThemeId } from "discourse/lib/theme-selector"; import ExperimentalScreen from "../components/experimental-screen"; import UserColorPaletteSelector from "../components/user-color-palette-selector"; export default apiInitializer("1.8.0", (api) => { + if (api.getCurrentUser()?.admin) { + const themeId = currentThemeId(); + const themeURL = getURL(`/admin/customize/themes/${themeId}`); + const horizonThemeUrl = getURL(`/admin/customize/themes/-2`); + addGlobalNotice( + `Admin notice: you are using the Horizon (beta) theme. This theme is now installed automatically in Discourse core. You should uninstall this theme, and reconfigure the preinstalled Horizon theme.`, + "loading-slider-theme", + { + dismissable: true, + level: "warn", + dismissDuration: moment.duration("1", "hour"), + } + ); + } + api.renderInOutlet("above-main-container", ExperimentalScreen); api.renderInOutlet("sidebar-footer-actions", UserColorPaletteSelector); diff --git a/locales/en.yml b/locales/en.yml index a9e52b1..de9e9dd 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -1,6 +1,6 @@ en: theme_metadata: - description: "A simple, beautiful theme that improves the out of the box experience for Discourse sites." + description: "(DEPRECATED: Use the Horizon theme that is now preinstalled on your Discourse site). A simple, beautiful theme that improves the out of the box experience for Discourse sites." topic_pinned: "Pinned" topic_hot: "Hot" user_replied: "replied"