信任等级头像边框

此主题组件允许管理员根据用户的信任级别为用户头像添加装饰。信任级别装饰会显示在网站上任何通常显示群组装饰的位置。有一些主题设置可以调整装饰相对于头像的位置。

基本示例(已包含群组装饰)

此外,还有一个右下角位置,根据您如何设置 “群组装饰始终在最上层” 选项,该位置要么会替换群组装饰,要么被群组装饰替换。

主要设置

使用图片作为装饰

您需要将自定义的装饰图片添加到主题组件中。推荐尺寸约为 100×100 像素。我在上述示例中使用的尺寸为 88×88 像素。如果您需要,可以在此处下载透明模板图片以开始操作:此处

上传图片最简单的方法是创建一个单独的本地组件 “信任级别头像装饰资源”(不熟悉者可参考 此处 的说明)。查看资源组件时,在主题组件的 上传 部分下选择 + 添加 按钮,然后选择您的装饰图片文件。对每个要包含的装饰图片重复此操作。上传图片后,右键点击图片链接并复制图片的 URL。最后,将 URL 粘贴到您选择的信任级别字段中。



使用 Font Awesome 作为装饰

您可以使用 Font Awesome 图标代替上传图片。所有可用图标的完整列表可在 此处 找到。您只需 勾选使用 Font Awesome 的设置,然后将图标名称添加到相应的装饰图片字段中:

重要提示:目前无法混合使用 Font Awesome 和图片。如果对此有强烈需求,我可以进一步研究。

设置

您会发现此主题组件中有多个可用设置。它们包含描述,解释了其功能及使用方法。但如果您有任何关于如何改进这些设置以使其更清晰的建议,请告诉我!

将鼠标悬停在信任级别头像装饰上时,会显示信任级别的名称。如果您希望更改信任级别的名称,可以前往 管理 > 自定义 > 文本,搜索以下内容以更改名称:

  • js.trust_levels.names.newuser
  • js.trust_levels.names.basic
  • js.trust_levels.names.member
  • js.trust_levels.names.regular
  • js.trust_levels.names.leader

如有任何问题、困难或建议,欢迎随时发帖!

60 个赞

Is there any chance of this eventually supporting group flair?

2 个赞

I’d like this particular component to remain focused on trust-level, but that doesn’t mean I’m not open to exploring something similar for group flair.

I looked back at your original request.

I’ll need to look into how doable this is with a theme component. I suspect that accessing the full list of groups a user belongs to would require a plugin that adds that info to the appropriate serializer, but I could be wrong. I will let you know if/when I have good news. I have a pretty full plate at the moment, so it could be a while before I have an update.

6 个赞

That’s very kind of you. I’m not familiar enough yet to know what can be done with themes vs plugins.

wow, i love it, i’m using it only for my trust level 4 leaders.

i have so many groups, and they all have different flairs, and so many colored name tags, that this is nice so the community and the new users know who are the leaders and the mods and are there to help them out

2 个赞

Taylor

Whats the chances an admin option, or user option could be added to remove this per individual request?

If that’s a bit much to ask could you provide the css to add that might remove for an individual?

Thank you :slightly_smiling_face:

1 个赞

A new setting for users or admins is a bit more than I am interested in adding at this time, but I have just pushed a update that will add a new class to the trust level avatar flair element so you can target a specific user. Replace USERNAME with the username of the relevant user to hide the flair from their avatar:

tl-flair-USERNAME {
    display: none !important;
}
5 个赞

:warning: 重要提示:如果您之前曾将表情图标(flair)图像文件直接上传到此组件,则在更新前,您需要先将这些图像重新上传到一个独立的组件中。请参阅下文。

我刚推送了一个小型更新,并编辑了本主题的原始帖子(OP)。现在不再支持将图标资源直接添加到该组件中。当远程主题组件更新时,所有手动上传的资源都会被删除,因为系统会尝试与远程 GitHub 仓库同步。这可能会给管理员带来困惑或不便,因此我们现在完全禁止向远程主题添加上传内容。

新的建议如下:

如果您在设置新方案时有任何问题或困难,请随时告知。

3 个赞

@tshenry,感谢你的辛勤工作 :slightly_smiling_face:
我的论坛需要显示来自第二个组的第二个徽章(我已经有了主要显示的组)。这个“信任等级头像徽章”主题组件非常理想,我只需要它能够显示 10 个组(即我 Discourse 的 10 个访问级别)。

我了解到你在 2018 年曾对这一想法持开放态度,请问你现在仍然认为这是可行的吗?:slightly_smiling_face:

2 个赞

我目前使用的是:

2 个赞

是的,我也这么想过,并且尝试过,但这个组件的徽章太小了,很难看清……
我真心希望我们能像主组一样,为副组使用标识和头像 :slightly_smiling_face:

3 个赞

遗憾的是,我认为目前通过主题组件无法实现。我不认为我们在所有三种头像装饰上下文中都序列化所需的群组数据,目前仅针对主群组。现阶段,我认为这需要通过插件来实现。不幸的是,我目前没有时间精力去开发此类功能。如果你需要有人协助为你的站点构建解决方案,不妨尝试在 Marketplace 寻求帮助。

3 个赞

能否在使用此功能的同时,仅当用户属于特定群组时,才显示不同的信任标识?

示例:我希望为某个群组的成员显示标识,而为另一个群组的成员不显示。

你好 Taylor,

感谢这个 TC。我注意到这个弃用警告,它可能会在更新到 Ember CLI 后导致问题。如果您能修复它,我将不胜感激。谢谢你 :slightly_smiling_face:

Screenshot 2021-11-08 at 23.06.17

3 个赞

感谢您的提醒!更新组件后,您应该就一切就绪了:

3 个赞

可以为员工禁用吗?

1 个赞

用户信任度现在显示在用户帖子的左下角,而不是包含在用户的照片/头像装饰中。

有人遇到同样的情况吗?

1 个赞

你好 Alan :wave:

你是在说这个主题组件吗?

2 个赞

就是那个 @ondrej

它没有被放置在图像内——而是放置在左下角。

所以是我上面圈出的地方。

1 个赞

你好 @Arduous:wave:

很高兴 @ondrej 确定了受影响的组件。 :tada:

你是否检查了网页控制台,看看网站上是否有任何错误?是否可以分享一个受影响网站的链接供我们查看? :slight_smile:

3 个赞