mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 10:42:45 +08:00
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:
parent
019ba099c8
commit
02ad1f9cd5
|
@ -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>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user