mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
DEV: add outlet wrapper for categories boxes (#28860)
* DEV: add outlet wrapper for category boxes * Put plugin outlet after categories boxes
This commit is contained in:
parent
4406bbb020
commit
c459d4b76c
@ -1,100 +1,110 @@
|
||||
{{#each this.categories as |c|}}
|
||||
<PluginOutlet
|
||||
@name="category-box-before-each-box"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{category-color-variable c.color}}
|
||||
data-category-id={{c.id}}
|
||||
data-notification-level={{c.notificationLevelString}}
|
||||
data-url={{c.url}}
|
||||
class="category category-box category-box-{{c.slug}}
|
||||
{{if c.isMuted 'muted'}}"
|
||||
>
|
||||
<div class="category-box-inner">
|
||||
{{#unless c.isMuted}}
|
||||
<div class="category-logo">
|
||||
{{#if c.uploaded_logo.url}}
|
||||
<CategoryLogo @category={{c}} />
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
<div class="category-details">
|
||||
<div class="category-box-heading">
|
||||
<a class="parent-box-link" href={{c.url}}>
|
||||
<h3>
|
||||
<CategoryTitleBefore @category={{c}} />
|
||||
{{#if c.read_restricted}}
|
||||
{{d-icon this.lockIcon}}
|
||||
{{/if}}
|
||||
{{c.displayName}}
|
||||
</h3>
|
||||
</a>
|
||||
</div>
|
||||
<PluginOutlet
|
||||
@name="categories-boxes-wrapper"
|
||||
@outletArgs={{hash categories=this.categories}}
|
||||
>
|
||||
{{#each this.categories as |c|}}
|
||||
<PluginOutlet
|
||||
@name="category-box-before-each-box"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{category-color-variable c.color}}
|
||||
data-category-id={{c.id}}
|
||||
data-notification-level={{c.notificationLevelString}}
|
||||
data-url={{c.url}}
|
||||
class="category category-box category-box-{{c.slug}}
|
||||
{{if c.isMuted 'muted'}}"
|
||||
>
|
||||
<div class="category-box-inner">
|
||||
{{#unless c.isMuted}}
|
||||
<div class="description">
|
||||
{{html-safe c.description_excerpt}}
|
||||
<div class="category-logo">
|
||||
{{#if c.uploaded_logo.url}}
|
||||
<CategoryLogo @category={{c}} />
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
<div class="category-details">
|
||||
<div class="category-box-heading">
|
||||
<a class="parent-box-link" href={{c.url}}>
|
||||
<h3>
|
||||
<CategoryTitleBefore @category={{c}} />
|
||||
{{#if c.read_restricted}}
|
||||
{{d-icon this.lockIcon}}
|
||||
{{/if}}
|
||||
{{c.displayName}}
|
||||
</h3>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{#if c.isGrandParent}}
|
||||
{{#each c.subcategories as |subcategory|}}
|
||||
<div
|
||||
data-category-id={{subcategory.id}}
|
||||
data-notification-level={{subcategory.notificationLevelString}}
|
||||
style={{border-color subcategory.color}}
|
||||
class="subcategory with-subcategories
|
||||
{{if subcategory.uploaded_logo.url 'has-logo' 'no-logo'}}"
|
||||
>
|
||||
<div class="subcategory-box-inner">
|
||||
<CategoryTitleLink @tagName="h4" @category={{subcategory}} />
|
||||
{{#if subcategory.subcategories}}
|
||||
<div class="subcategories">
|
||||
{{#each subcategory.subcategories as |subsubcategory|}}
|
||||
{{#unless subsubcategory.isMuted}}
|
||||
<span class="subcategory">
|
||||
<CategoryTitleBefore @category={{subsubcategory}} />
|
||||
{{category-link subsubcategory hideParent="true"}}
|
||||
</span>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else if c.subcategories}}
|
||||
<div class="subcategories">
|
||||
{{#each c.subcategories as |sc|}}
|
||||
<a class="subcategory" href={{sc.url}}>
|
||||
<span class="subcategory-image-placeholder">
|
||||
{{#if sc.uploaded_logo.url}}
|
||||
<CategoryLogo @category={{sc}} />
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
{{category-link sc hideParent="true"}}
|
||||
</a>
|
||||
{{/each}}
|
||||
{{#unless c.isMuted}}
|
||||
<div class="description">
|
||||
{{html-safe c.description_excerpt}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
||||
{{#if c.isGrandParent}}
|
||||
{{#each c.subcategories as |subcategory|}}
|
||||
<div
|
||||
data-category-id={{subcategory.id}}
|
||||
data-notification-level={{subcategory.notificationLevelString}}
|
||||
style={{border-color subcategory.color}}
|
||||
class="subcategory with-subcategories
|
||||
{{if subcategory.uploaded_logo.url 'has-logo' 'no-logo'}}"
|
||||
>
|
||||
<div class="subcategory-box-inner">
|
||||
<CategoryTitleLink
|
||||
@tagName="h4"
|
||||
@category={{subcategory}}
|
||||
/>
|
||||
{{#if subcategory.subcategories}}
|
||||
<div class="subcategories">
|
||||
{{#each subcategory.subcategories as |subsubcategory|}}
|
||||
{{#unless subsubcategory.isMuted}}
|
||||
<span class="subcategory">
|
||||
<CategoryTitleBefore
|
||||
@category={{subsubcategory}}
|
||||
/>
|
||||
{{category-link subsubcategory hideParent="true"}}
|
||||
</span>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else if c.subcategories}}
|
||||
<div class="subcategories">
|
||||
{{#each c.subcategories as |sc|}}
|
||||
<a class="subcategory" href={{sc.url}}>
|
||||
<span class="subcategory-image-placeholder">
|
||||
{{#if sc.uploaded_logo.url}}
|
||||
<CategoryLogo @category={{sc}} />
|
||||
{{/if}}
|
||||
</span>
|
||||
|
||||
{{category-link sc hideParent="true"}}
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
|
||||
<PluginOutlet
|
||||
@name="category-box-below-each-category"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<PluginOutlet
|
||||
@name="category-box-below-each-category"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PluginOutlet
|
||||
@name="category-box-after-each-box"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
{{/each}}
|
||||
<PluginOutlet
|
||||
@name="category-box-after-each-box"
|
||||
@outletArgs={{hash category=c}}
|
||||
/>
|
||||
{{/each}}
|
||||
</PluginOutlet>
|
||||
|
||||
<PluginOutlet
|
||||
@name="category-boxes-after-boxes"
|
||||
|
Loading…
Reference in New Issue
Block a user