Nível de Confiança - Avatar Flair

Este componente de tema permite que um administrador adicione destaque aos avatares dos usuários com base no nível de confiança do usuário. O destaque do nível de confiança é exibido em qualquer lugar do site onde normalmente você veria o destaque de grupo. Existem algumas configurações de tema para ajustar a posição do destaque em relação ao avatar.

Exemplos básicos (com destaque de grupo em vigor)

Também há uma posição inferior-direita que substituirá o destaque de grupo ou será substituída por ele, dependendo de como você configurar a opção “destaque de grupo sempre no topo”.

Configuração principal

Usando imagens como destaque

Você precisará adicionar suas próprias imagens de destaque ao componente do tema. Um bom tamanho é de aproximadamente 100×100px. A que usei no exemplo acima tem 88×88px. Você pode baixar uma imagem modelo transparente aqui para começar, se for útil:

A maneira mais fácil de fazer o upload de uma imagem é criar um componente local separado chamado “Ativos de Destaque de Avatar por Nível de Confiança” (instruções aqui para quem não está familiarizado). Ao visualizar o componente de ativos, selecione o botão + Adicionar na seção Uploads do componente do tema e escolha o arquivo de imagem do seu destaque. Repita isso para cada imagem de destaque que você deseja incluir. Depois de fazer o upload das imagens, clique com o botão direito no link da imagem e copie a URL da imagem. Por fim, cole a URL no campo de nível de confiança de sua escolha.



Usando Font Awesome para o seu destaque

Você pode usar ícones do Font Awesome em vez de imagens carregadas. Uma lista completa dos ícones disponíveis pode ser encontrada aqui. Tudo o que você precisa fazer é marcar a configuração para usar Font Awesome e depois adicionar o nome do ícone ao campo de imagem de destaque apropriado:

NOTA IMPORTANTE: Atualmente, você não pode misturar Font Awesome e imagens. Se houver um forte interesse em fazer isso, posso investigar mais.

Configurações

Você verá que há várias configurações disponíveis neste componente de tema. Elas possuem descrições explicando o que fazem e como usá-las, mas se alguém tiver sugestões sobre como melhorá-las para tornar tudo mais claro, por favor, me avise!

Passar o mouse sobre o destaque de avatar por nível de confiança exibirá o nome do nível de confiança. Se você deseja alterar o nome do nível de confiança, pode ir para Admin > Personalizar > Texto e pesquisar o seguinte para alterar os nomes:

  • 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

Sinta-se à vontade para postar se houver dúvidas, problemas ou sugestões!

60 curtidas

Is there any chance of this eventually supporting group flair?

2 curtidas

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 curtidas

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 curtidas

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 curtida

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 curtidas

:warning: IMPORTANT: if you had previously uploaded flair image files directly to this component you will need to re-upload your flair images to a separate component before updating. Please see below.

I’ve just pushed a small update and edited the OP of this topic. Adding the icon assets directly to this component is no longer supported. When a remote theme component is updated all of the manually uploaded assets are deleted as it tries to sync with the remote GitHub repository. This can create a confusing/annoying situation for admins so we now block adding uploads to remote themes altogether.

The new reccomendaation is as follows:

Please let me know if you have any question or trouble figuring out the new setup.

3 curtidas

Hi @tshenry and thanks for all the work :slightly_smiling_face:
I need for my forum to display a second flair (I already have the primararly displayed group) from a second group.
This Trust-Level Avatar Flair theme component would be perfect, I just need it to be able to display 10 groups (levels of access of my Discourse).

I read you were opened to that idea in 2018, do you still think it is possible ? :slightly_smiling_face:

2 curtidas

I’m currently using this:

2 curtidas

Yes, I thought so and I tried but the badges with this component are so small they are hard to see…
I trully wish we could use flairs and avatars with second groups :slightly_smiling_face:

3 curtidas

Sadly, I don’t think it is possible with a theme component at the moment. I don’t believe we serialize the required group data in all three of of the avatar flair contexts, only the primary group. At this point I think it would need to be done as a plugin. Unfortunately, I don’t have the bandwidth to work on something like that at the moment. You could always try the marketplace if you need someone to help you build a solution for your site.

3 curtidas

Is it possible to use this feature but have different trust flairs ONLY if someone ALSO belongs to a particular group?

Example: I want flair for people in one group and not another.

Olá Taylor,

Obrigado por este TC. Notei este aviso de Deprecation que pode causar problemas após a atualização para o Ember CLI. Agradeceria se você pudesse corrigi-lo. Obrigado :slightly_smiling_face:

Screenshot 2021-11-08 at 23.06.17

3 curtidas

Obrigado pelo aviso! Você deve estar pronto assim que atualizar o componente:

3 curtidas

Pode ser desativado para membros da equipe?

1 curtida

Os níveis de confiança dos usuários agora são exibidos no canto inferior esquerdo de uma postagem do usuário em vez de serem incluídos no distintivo da foto/avatar do usuário.

Alguém está passando pela mesma coisa?

1 curtida

Olá Alan :wave:

Você está falando sobre este componente de tema?

2 curtidas

É esse mesmo, @ondrej

Em vez de ser colocado dentro da imagem, ele é colocado no canto inferior esquerdo.

Então, onde eu circulei acima.

1 curtida

Oi @Arduous! :wave:

Fico feliz que @ondrej tenha identificado o componente afetado. :tada:

Você verificou o console da web para ver se há algum erro no site? É possível compartilhar um link para o site afetado para que possamos dar uma olhada? :slight_smile:

3 curtidas