DEV:Add plugin outlet for liked posts (#29899)

* DEV:Add plugin outlet for liked posts

* sort imports
This commit is contained in:
Amanda Alves Branquinho 2024-11-27 20:02:15 -03:00 committed by GitHub
parent 996f993651
commit 397ebea25c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
import DButton from "discourse/components/d-button";
import PluginOutlet from "discourse/components/plugin-outlet";
import TopicMapLink from "discourse/components/topic-map/topic-map-link";
import TopicParticipants from "discourse/components/topic-map/topic-participants";
import TopicViews from "discourse/components/topic-map/topic-views";
@ -294,28 +295,33 @@ export default class TopicMapSummary extends Component {
"topic_map.menu_titles.replies"
}}</h3>
<ConditionalLoadingSpinner @condition={{this.loading}}>
<ul>
{{#each this.top3LikedPosts as |post|}}
<li>
<a href={{this.postUrl post}}>
<span class="like-section__user">
{{avatar
post.avatar_template
"tiny"
(hash title=post.username)
}}
{{post.username}}
</span>
<span class="like-section__likes">
{{post.like_count}}
{{dIcon "heart"}}</span>
<p>
{{htmlSafe (emojiUnescape post.blurb)}}
</p>
</a>
</li>
{{/each}}
</ul>
<PluginOutlet
@name="most-liked-replies"
@outletArgs={{hash posts=this.top3LikedPosts}}
>
<ul>
{{#each this.top3LikedPosts as |post|}}
<li>
<a href={{this.postUrl post}}>
<span class="like-section__user">
{{avatar
post.avatar_template
"tiny"
(hash title=post.username)
}}
{{post.username}}
</span>
<span class="like-section__likes">
{{post.like_count}}
{{dIcon "heart"}}</span>
<p>
{{htmlSafe (emojiUnescape post.blurb)}}
</p>
</a>
</li>
{{/each}}
</ul>
</PluginOutlet>
</ConditionalLoadingSpinner>
</:content>
</DMenu>