FEATURE: Display oneboxed content in knowledge explorer topic view
This commit is contained in:
parent
a6ac97e69f
commit
89ef7c8133
|
|
@ -2,6 +2,6 @@ export default Ember.Component.extend({
|
||||||
classNames: "knowledge-explorer-topic",
|
classNames: "knowledge-explorer-topic",
|
||||||
|
|
||||||
originalPostContent: Ember.computed.readOnly(
|
originalPostContent: Ember.computed.readOnly(
|
||||||
"topic.post_stream.posts.firstObject.cooked"
|
"topic.post_stream.posts.firstObject"
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<div class="topic-content">
|
<div class="topic-content">
|
||||||
<h1>{{topic.title}}</h1>
|
<h1>{{topic.title}}</h1>
|
||||||
{{{originalPostContent}}}
|
{{mount-widget widget="knowledge-explorer-post" args=(hash post=originalPostContent)}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="knowledge-explorer-nav-link more" href="/t/{{topic.id}}">
|
<a class="knowledge-explorer-nav-link more" href="/t/{{topic.id}}">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import PostCooked from "discourse/widgets/post-cooked";
|
||||||
|
import DecoratorHelper from "discourse/widgets/decorator-helper";
|
||||||
|
import { createWidget } from "discourse/widgets/widget";
|
||||||
|
|
||||||
|
export default createWidget("knowledge-explorer-post", {
|
||||||
|
html(attrs, state) {
|
||||||
|
return new PostCooked(
|
||||||
|
attrs.post,
|
||||||
|
new DecoratorHelper(this),
|
||||||
|
this.currentUser
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue