discourse-category-banners/javascripts/discourse/components/discourse-category-banners.hbs

33 lines
1.0 KiB
Handlebars
Raw Normal View History

{{#if this.shouldRender}}
<div
{{did-insert this.getCategory}}
{{did-update this.getCategory this.isVisible}}
class="category-title-header
{{if this.category (concat 'category-banner-' this.category.slug)}}"
style={{if this.category this.safeStyle}}
>
<div class="category-title-contents">
<h1 class="category-title">
{{#if (and (theme-setting "show_category_icon") this.category)}}
{{#if this.hasIconComponent}}
{{! For compatibility with https://meta.discourse.org/t/category-icons/104683}}
<CategoryIcon @category={{this.category}} />
{{else}}
{{this.consoleWarn}}
{{/if}}
{{/if}}
{{#if this.category.read_restricted}}
{{d-icon "lock"}}
{{/if}}
{{this.category.name}}
</h1>
{{#if (theme-setting "show_description")}}
<div class="category-title-description">
<div class="cooked" innerHTML={{this.category.description}}></div>
</div>
{{/if}}
</div>
</div>
{{/if}}