Add header-topic-info:after-tags extension point

This commit is contained in:
Sam 2017-02-17 15:59:40 -05:00
parent bcbe474856
commit 7d8a11f636
1 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { topicFeaturedLinkNode } from 'discourse/lib/render-topic-featured-link'
export default createWidget('header-topic-info', {
tagName: 'div.extra-info-wrapper',
html(attrs) {
html(attrs, state) {
const topic = attrs.topic;
const heading = [];
@ -45,13 +45,16 @@ export default createWidget('header-topic-info', {
title.push(this.attach('category-link', { category }));
}
const extra = [];
let extra = [];
if (this.siteSettings.tagging_enabled) {
const tags = topic.get('tags') || [];
if (tags.length) {
extra.push(h('div.list-tags', tags.map(tagNode)));
}
}
extra = extra.concat(applyDecorators(this, 'after-tags', attrs, state));
if (this.siteSettings.topic_featured_link_enabled) {
const featured = topicFeaturedLinkNode(attrs.topic);
if (featured) {