From 9376a2e755dd3c1c384b5ce752f471f9d00a79ee Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 14 Mar 2024 10:30:12 -0400 Subject: [PATCH] FEATURE: optionally show "Powered by Discourse" link to discourse.org (#26162) --- .../app/components/powered-by-discourse.gjs | 15 ++++ .../discourse/app/controllers/application.js | 5 ++ .../discourse/app/templates/application.hbs | 4 + .../stylesheets/common/components/_index.scss | 1 + .../components/powered-by-discourse.scss | 73 +++++++++++++++++++ config/locales/client.en.yml | 1 + config/locales/server.en.yml | 2 + config/site_settings.yml | 4 + spec/system/powered_by_discourse_spec.rb | 32 ++++++++ 9 files changed, 137 insertions(+) create mode 100644 app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs create mode 100644 app/assets/stylesheets/common/components/powered-by-discourse.scss create mode 100644 spec/system/powered_by_discourse_spec.rb diff --git a/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs b/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs new file mode 100644 index 00000000000..ee20e6151f7 --- /dev/null +++ b/app/assets/javascripts/discourse/app/components/powered-by-discourse.gjs @@ -0,0 +1,15 @@ +import icon from "discourse-common/helpers/d-icon"; +import i18n from "discourse-common/helpers/i18n"; + +const PoweredByDiscourse = ; + +export default PoweredByDiscourse; diff --git a/app/assets/javascripts/discourse/app/controllers/application.js b/app/assets/javascripts/discourse/app/controllers/application.js index 5d35d7776e6..4f94116e354 100644 --- a/app/assets/javascripts/discourse/app/controllers/application.js +++ b/app/assets/javascripts/discourse/app/controllers/application.js @@ -59,6 +59,11 @@ export default Controller.extend({ return this.capabilities.isAppWebview || this.capabilities.isiOSPWA; }, + @discourseComputed + showPoweredBy() { + return this.showFooter && this.siteSettings.enable_powered_by_discourse; + }, + _mainOutletAnimate() { document.body.classList.remove("sidebar-animate"); }, diff --git a/app/assets/javascripts/discourse/app/templates/application.hbs b/app/assets/javascripts/discourse/app/templates/application.hbs index 765aba5d480..222cee64d60 100644 --- a/app/assets/javascripts/discourse/app/templates/application.hbs +++ b/app/assets/javascripts/discourse/app/templates/application.hbs @@ -87,6 +87,10 @@ + + {{#if this.showPoweredBy}} + + {{/if}}