FEATURE: add plugin outlets for topic title suffix (#24215)
This commit is contained in:
parent
65759c126b
commit
a38b80a0ea
|
@ -12,6 +12,10 @@
|
|||
{{else}}
|
||||
<SearchMenu::HighlightedSearch @string={{@result.topic.fancyTitle}} />
|
||||
{{/if}}
|
||||
<PluginOutlet
|
||||
@name="search-menu-results-topic-title-suffix"
|
||||
@outletArgs={{hash topic=@result.topic}}
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<span class="second-line">
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
</HighlightSearch>
|
||||
{{/if}}
|
||||
</span>
|
||||
<PluginOutlet
|
||||
@name="search-results-topic-title-suffix"
|
||||
@outletArgs={{hash topic=this.post.topic}}
|
||||
/>
|
||||
</a>
|
||||
|
||||
<div class="search-category">
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import { hbs } from "ember-cli-htmlbars";
|
||||
import { h } from "virtual-dom";
|
||||
import renderTags from "discourse/lib/render-tags";
|
||||
import { topicFeaturedLinkNode } from "discourse/lib/render-topic-featured-link";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { avatarImg } from "discourse/widgets/post";
|
||||
import RawHtml from "discourse/widgets/raw-html";
|
||||
import RenderGlimmer from "discourse/widgets/render-glimmer";
|
||||
import { applyDecorators, createWidget } from "discourse/widgets/widget";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { iconNode } from "discourse-common/lib/icon-library";
|
||||
|
@ -111,6 +113,19 @@ export default createWidget("header-topic-info", {
|
|||
contents: () => titleHTML,
|
||||
})
|
||||
);
|
||||
|
||||
heading.push(
|
||||
new RenderGlimmer(
|
||||
this,
|
||||
"div",
|
||||
hbs`<PluginOutlet @name="header-topic-title-suffix" @outletArgs={{@data.outletArgs}}/>`,
|
||||
{
|
||||
outletArgs: {
|
||||
topic,
|
||||
},
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this.headerElements = [h("h1.header-title", heading)];
|
||||
|
|
Loading…
Reference in New Issue