-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: add outlet above-main-container & additional settings (#17)
Adds settings for above-main-container outlet, to work with site's with sidebar. And setting to show alongside category banners, which allows further customization if wanted to hide category banners for instance.
- Loading branch information
Showing
8 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
javascripts/discourse/connectors/above-main-container/tag-header-widget.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{#if (theme-setting "show_above_main_container")}} | ||
{{#if | ||
(or | ||
(not this.categoryBannerPresence.isPresent) | ||
(theme-setting "show_with_category_banners") | ||
) | ||
}} | ||
<DiscourseTagBanners /> | ||
{{/if}} | ||
{{/if}} |
16 changes: 16 additions & 0 deletions
16
javascripts/discourse/connectors/above-main-container/tag-header-widget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Component from "@ember/component"; | ||
import { tracked } from "@glimmer/tracking"; | ||
import { getOwner } from "@ember/application"; | ||
|
||
export default class extends Component { | ||
@tracked categoryBannerPresence = null; | ||
|
||
constructor() { | ||
super(...arguments); | ||
|
||
// this prevents a failure if the category banner component is not installed | ||
this.categoryBannerPresence = getOwner(this).lookup( | ||
"service:categoryBannerPresence" | ||
); | ||
} | ||
} |
9 changes: 7 additions & 2 deletions
9
javascripts/discourse/connectors/above-site-header/tag-header-widget.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{{#if (theme-setting "show_above_site_header")}} | ||
{{#unless this.categoryBannerPresence.isPresent}} | ||
{{#if | ||
(or | ||
(not this.categoryBannerPresence.isPresent) | ||
(theme-setting "show_with_category_banners") | ||
) | ||
}} | ||
<DiscourseTagBanners /> | ||
{{/unless}} | ||
{{/if}} | ||
{{/if}} |
9 changes: 7 additions & 2 deletions
9
javascripts/discourse/connectors/below-site-header/tag-header-widget.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
{{#if (theme-setting "show_below_site_header")}} | ||
{{#unless this.categoryBannerPresence.isPresent}} | ||
{{#if | ||
(or | ||
(not this.categoryBannerPresence.isPresent) | ||
(theme-setting "show_with_category_banners") | ||
) | ||
}} | ||
<DiscourseTagBanners /> | ||
{{/unless}} | ||
{{/if}} | ||
{{/if}} |
4 changes: 3 additions & 1 deletion
4
...ripts/discourse/connectors/category-banners-after-title/category-banner-tag-connector.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
<DiscourseTagBanners /> | ||
{{#if (not (theme-setting "show_with_category_banners"))}} | ||
<DiscourseTagBanners /> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters