# 信任等级头像边框

**URL:** https://meta.discourse.org/t/trust-level-avatar-flair/82656
**Category:** Theme component
**Created:** [2018年三月9日 22:44 UTC](https://meta.discourse.org/t/trust-level-avatar-flair/82656 "2018-03-09T22:44:44Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [2018年三月9日 22:44 UTC](https://meta.discourse.org/t/trust-level-avatar-flair/82656/1 "2018-03-09T22:44:45Z")

</div>

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

#### 基本示例（已包含群组装饰）

 ![examples](https://global.discourse-cdn.com/meta/original/3X/4/4/443da278ff5866d184100baad7432a63a43aea7d.png)

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

### 主要设置

**使用图片作为装饰**

您需要将自定义的装饰图片添加到主题组件中。推荐尺寸约为 100×100 像素。我在上述示例中使用的尺寸为 88×88 像素。如果您需要，可以在此处下载透明模板图片以开始操作：[此处](https://github.com/tshenry/discourse-trust-level-avatar-flair/blob/master/assets/template.png)：

 ![Screen Shot 2021-02-19 at 1.45.21 PM](https://global.discourse-cdn.com/meta/original/3X/d/1/d191cc2b4f0e036ff2e442397a32fabd8a3717e6.png)

上传图片最简单的方法是创建一个单独的本地组件 **“信任级别头像装饰资源”** （不熟悉者可参考 [此处](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966#heading--2-3) 的说明）。查看资源组件时，在主题组件的 **上传** 部分下选择 + 添加 按钮，然后选择您的装饰图片文件。对每个要包含的装饰图片重复此操作。上传图片后，右键点击图片链接并复制图片的 URL。最后，将 URL 粘贴到您选择的信任级别字段中。

 ![Screen Shot 2021-02-19 at 1.56.46 PM](https://global.discourse-cdn.com/meta/original/3X/7/b/7bcf4c6ff571631841a0311459577a24f1b69f3e.png)

 ![30%20AM](https://global.discourse-cdn.com/meta/original/3X/8/2/82f3fa3ea5f6e3841ece1c0ac7857fd35c3601e6.png)  
  

**使用 Font Awesome 作为装饰**

您可以使用 Font Awesome 图标代替上传图片。所有可用图标的完整列表可在 [此处](https://fontawesome.com/v4.7.0/icons/) 找到。您只需 **勾选使用 Font Awesome 的设置** ，然后将图标名称添加到相应的装饰图片字段中：

 ![16%20AM](https://global.discourse-cdn.com/meta/original/3X/7/5/755e2a8c225e967c34db01cb04f147816abc4cd8.png)

 ![24%20AM](https://global.discourse-cdn.com/meta/original/3X/5/4/5449dfe93888edfd72e9793c962ab57762c232f3.png)

_重要提示：目前无法混合使用 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`

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

| | | |
| --- | --- | --- |
| 🛠 | **仓库** | [信任级别头像装饰](https://github.com/tshenry/discourse-trust-level-avatar-flair) |
| ❓ | **安装指南** | [如何安装主题或主题组件](https://meta.discourse.org/t/how-do-i-install-a-theme-or-theme-component/63682) |
| 📖 | **初次接触 Discourse 主题？** | [Discourse 主题使用入门指南](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

---

_[View the full topic](https://meta.discourse.org/t/trust-level-avatar-flair/82656)._
