diff --git a/assets/javascripts/discourse/components/docs-topic-list-item.js b/assets/javascripts/discourse/components/docs-topic-list-item.js new file mode 100644 index 0000000..b19b6f3 --- /dev/null +++ b/assets/javascripts/discourse/components/docs-topic-list-item.js @@ -0,0 +1,24 @@ +import Component from "@ember/component"; +import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers"; +import { findRawTemplate } from "discourse-common/lib/raw-templates"; +import { htmlSafe } from "@ember/template"; + +export default Component.extend({ + tagName: "tr", + classNameBindings: [":topic-list-item"], + + didInsertElement() { + this._super(...arguments); + this.renderTopicListItem(); + }, + + renderTopicListItem() { + const template = findRawTemplate("list/topic-list-item"); + if (template) { + this.set( + "topicListItemContents", + htmlSafe(template(this, RUNTIME_OPTIONS)) + ); + } + }, +}); diff --git a/assets/javascripts/discourse/templates/components/docs-topic-list-item.hbs b/assets/javascripts/discourse/templates/components/docs-topic-list-item.hbs new file mode 100644 index 0000000..87721b9 --- /dev/null +++ b/assets/javascripts/discourse/templates/components/docs-topic-list-item.hbs @@ -0,0 +1 @@ +{{this.topicListItemContents}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/docs-topic-list.hbs b/assets/javascripts/discourse/templates/components/docs-topic-list.hbs index 4b50238..aaf2db8 100644 --- a/assets/javascripts/discourse/templates/components/docs-topic-list.hbs +++ b/assets/javascripts/discourse/templates/components/docs-topic-list.hbs @@ -28,7 +28,7 @@ {{#each topics as |topic|}} - {{raw "docs-topic-list-item" topic=topic urlPath=urlPath}} + {{docs-topic-list-item topic=topic urlPath=urlPath}} {{/each}} diff --git a/assets/javascripts/discourse/templates/docs-topic-list-item.hbr b/assets/javascripts/discourse/templates/docs-topic-list-item.hbr index c8f2a8c..13ada34 100644 --- a/assets/javascripts/discourse/templates/docs-topic-list-item.hbr +++ b/assets/javascripts/discourse/templates/docs-topic-list-item.hbr @@ -1,15 +1,16 @@ - - - - {{~raw "topic-status" topic=topic}} - {{~raw "docs-topic-link" topic=topic urlPath=urlPath}} - - - {{category-link topic.category}} - {{discourse-tags topic mode="list"}} - - - - {{format-date topic.bumped_at format="tiny" noTitle="true"}} - - +{{~raw-plugin-outlet name="topic-list-before-columns"}} + + + {{~raw-plugin-outlet name="topic-list-before-link"}} + + {{~raw "topic-status" topic=topic}} + {{~raw "docs-topic-link" topic=topic urlPath=urlPath}} + + + {{category-link topic.category}} + {{discourse-tags topic mode="list"}} + + + + {{format-date topic.bumped_at format="tiny" noTitle="true"}} + \ No newline at end of file