mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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 Component from "@glimmer/component";
|
||||||
|
import { hash } from "@ember/helper";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
import { gt } from "truth-helpers";
|
import { gt } from "truth-helpers";
|
||||||
|
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||||
import UserAvatarFlair from "discourse/components/user-avatar-flair";
|
import UserAvatarFlair from "discourse/components/user-avatar-flair";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
import { avatarImg } from "discourse-common/lib/avatar-utils";
|
import { avatarImg } from "discourse-common/lib/avatar-utils";
|
||||||
@ -52,19 +54,24 @@ export default class TopicParticipant extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class={{this.participantClasses}}>
|
<PluginOutlet
|
||||||
<a
|
@name="topic-participant"
|
||||||
class={{this.linkClasses}}
|
@outletArgs={{hash participant=@participant}}
|
||||||
data-user-card={{@participant.username}}
|
>
|
||||||
title={{@participant.username}}
|
<div class={{this.participantClasses}}>
|
||||||
href={{this.userUrl}}
|
<a
|
||||||
>
|
class={{this.linkClasses}}
|
||||||
{{this.avatarImage}}
|
data-user-card={{@participant.username}}
|
||||||
{{#if (gt @participant.post_count 1)}}
|
title={{@participant.username}}
|
||||||
<span class="post-count">{{@participant.post_count}}</span>
|
href={{this.userUrl}}
|
||||||
{{/if}}
|
>
|
||||||
<UserAvatarFlair @user={{@participant}} />
|
{{this.avatarImage}}
|
||||||
</a>
|
{{#if (gt @participant.post_count 1)}}
|
||||||
</div>
|
<span class="post-count">{{@participant.post_count}}</span>
|
||||||
|
{{/if}}
|
||||||
|
<UserAvatarFlair @user={{@participant}} />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</PluginOutlet>
|
||||||
</template>
|
</template>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user