Hiding trust level

Hello!

I couldn’t find how can I hidding the trust level 0 for the new members.

I want that new members don’t know that they are basic, just know the when they are in the next level.

Or, if not’s possible, hide notification.

1 个赞

I could be wrong, but I do not think that trust level 0 is displayed anywhere that users can see. When a user is granted trust level 1, Discourse sends a notification telling the user that they have been promoted to trust level 1. You can disable this notification by deselecting the send tl1 welcome message site setting.

You can also customize the message by going to your Admin / Customize / Text section and searching for welcome_tl1_user . This search will return three text templates. You would need to customize the system_messages.welcome_tl1_user.title to change the “Welcome TL1 User” text. You might also want to change the system_messages.welcome_tl1_user.text_body_template text.

When users achieve trust level 1, they are also granted the “Basic” badge. You can disable this badge on your Admin / Badges page. To disable the badge, scroll to the bottom of the Admin Basic badge form and deselect the “Enable badge” checkbox.

If you would like to keep the Basic badge enabled, but remove “Trust Level 1” from the badge description, you can customize the badge description by going to Admin / Customize / Text and searching for basic_user. This search will return three text strings. The one you will want to change is badges.basic_user.long_description.

When you visit a user’s profile page and see something like this, the user has trust level 1 (basic), not trust level 0:

The easiest way to remove this would be to hide this trust level field for all trust levels with CSS. Adding the following CSS to your theme should work:

.user-main .about .secondary dd.trust-level,
.user-main .about .secondary dt.trust-level {
    display: none;
}

This would hide the trust level field on the profile page for all trust levels. If you would like to display higher trust levels, but not display trust level 1 (basic), this could be accomplished with a theme component. Let us know if you only want to hide the trust level of basic users and we will try to help with that.

8 个赞

谢谢,这基本达到了我想要的效果。(我当然希望保留信任级别,只是不希望用户知道它们是什么,以避免竞争和攀比。)唯一的问题是,作为管理员,我希望在用户配置文件中看到信任级别。能否将其添加为一个配置选项,以便显示或隐藏不同用户组的信任级别?

据我所知,上面的 CSS 仍然有效,你只需要将其包装在下面即可,这样它就不会应用于员工:

body:not(.staff) {
    .user-main .about .secondary dd.trust-level, .user-main .about .secondary dt.trust-level {
    display: none;
    }
}
1 个赞

是的,我可以确认 CSS 有效,之前的和您为我调整的都有效。非常感谢您的帮助。我想如果有人真的想这么做,他们仍然可以检查 HTML 并看到那些隐藏的元素,对吧?这就是为什么我认为禁用它的配置选项可能更好,但这真的不是什么大问题。