Dev/add outlet for participant (#29864)

* DEV: add outlet for topic participant

* format topic participant file

* Update app/assets/javascripts/discourse/app/components/topic-map/topic-participant.gjs

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
Amanda Alves Branquinho 2024-11-21 14:41:03 -03:00 committed by GitHub
parent 019ba099c8
commit 02ad1f9cd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,8 @@
import Component from "@glimmer/component";
import { hash } from "@ember/helper";
import { htmlSafe } from "@ember/template";
import { gt } from "truth-helpers";
import PluginOutlet from "discourse/components/plugin-outlet";
import UserAvatarFlair from "discourse/components/user-avatar-flair";
import { userPath } from "discourse/lib/url";
import { avatarImg } from "discourse-common/lib/avatar-utils";
@ -52,19 +54,24 @@ export default class TopicParticipant extends Component {
}
<template>
<div class={{this.participantClasses}}>
<a
class={{this.linkClasses}}
data-user-card={{@participant.username}}
title={{@participant.username}}
href={{this.userUrl}}
>
{{this.avatarImage}}
{{#if (gt @participant.post_count 1)}}
<span class="post-count">{{@participant.post_count}}</span>
{{/if}}
<UserAvatarFlair @user={{@participant}} />
</a>
</div>
<PluginOutlet
@name="topic-participant"
@outletArgs={{hash participant=@participant}}
>
<div class={{this.participantClasses}}>
<a
class={{this.linkClasses}}
data-user-card={{@participant.username}}
title={{@participant.username}}
href={{this.userUrl}}
>
{{this.avatarImage}}
{{#if (gt @participant.post_count 1)}}
<span class="post-count">{{@participant.post_count}}</span>
{{/if}}
<UserAvatarFlair @user={{@participant}} />
</a>
</div>
</PluginOutlet>
</template>
}