From 21284e24191f7b9a6639c1b55602050a91abd760 Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 6 Jul 2023 16:42:00 -0400 Subject: [PATCH] UX: add more plugin outlet options (#33) --- common/common.scss | 7 +++++++ .../category-header-banner.hbs | 3 +++ .../category-header-banner.hbs | 2 +- .../category-header-banner.hbs | 2 +- .../category-header-banner.hbs | 3 +++ settings.yml | 18 +++++++++--------- 6 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 javascripts/discourse/connectors/above-main-container/category-header-banner.hbs create mode 100644 javascripts/discourse/connectors/header-list-container-bottom/category-header-banner.hbs diff --git a/common/common.scss b/common/common.scss index 271d480..8dadf13 100644 --- a/common/common.scss +++ b/common/common.scss @@ -50,3 +50,10 @@ div[class^="category-title-header"] { } } } + +@if $plugin_outlet == "header-list-container-bottom" { + #header-list-area { + display: flex; + flex-direction: column-reverse; + } +} diff --git a/javascripts/discourse/connectors/above-main-container/category-header-banner.hbs b/javascripts/discourse/connectors/above-main-container/category-header-banner.hbs new file mode 100644 index 0000000..6b5284e --- /dev/null +++ b/javascripts/discourse/connectors/above-main-container/category-header-banner.hbs @@ -0,0 +1,3 @@ +{{#if (eq (theme-setting "plugin_outlet") "above-main-container")}} + +{{/if}} \ No newline at end of file diff --git a/javascripts/discourse/connectors/above-site-header/category-header-banner.hbs b/javascripts/discourse/connectors/above-site-header/category-header-banner.hbs index 0fe604a..aff0013 100644 --- a/javascripts/discourse/connectors/above-site-header/category-header-banner.hbs +++ b/javascripts/discourse/connectors/above-site-header/category-header-banner.hbs @@ -1,3 +1,3 @@ -{{#if (theme-setting "show_above_site_header")}} +{{#if (eq (theme-setting "plugin_outlet") "above-site-header")}} {{/if}} \ No newline at end of file diff --git a/javascripts/discourse/connectors/below-site-header/category-header-banner.hbs b/javascripts/discourse/connectors/below-site-header/category-header-banner.hbs index 5a59382..bd1a661 100644 --- a/javascripts/discourse/connectors/below-site-header/category-header-banner.hbs +++ b/javascripts/discourse/connectors/below-site-header/category-header-banner.hbs @@ -1,3 +1,3 @@ -{{#if (theme-setting "show_below_site_header")}} +{{#if (eq (theme-setting "plugin_outlet") "below-site-header")}} {{/if}} \ No newline at end of file diff --git a/javascripts/discourse/connectors/header-list-container-bottom/category-header-banner.hbs b/javascripts/discourse/connectors/header-list-container-bottom/category-header-banner.hbs new file mode 100644 index 0000000..c535532 --- /dev/null +++ b/javascripts/discourse/connectors/header-list-container-bottom/category-header-banner.hbs @@ -0,0 +1,3 @@ +{{#if (eq (theme-setting "plugin_outlet") "header-list-container-bottom")}} + +{{/if}} \ No newline at end of file diff --git a/settings.yml b/settings.yml index ae1cc6f..aee6e4e 100644 --- a/settings.yml +++ b/settings.yml @@ -32,15 +32,15 @@ categories:
  • only_sub - only subcategories of the named category. -show_above_site_header: - default: false - type: bool - description: "Display the banner in the above site header connector." - -show_below_site_header: - default: true - type: bool - description: "Display the banner in the below site header connector." +plugin_outlet: + default: "below-site-header" + type: "enum" + choices: + - "below-site-header" + - "above-site-header" + - "above-main-container" + - "header-list-container-bottom" + description: "Changes the position of the banner on the page." show_category_icon: default: false