Estilo de Categoria de Votação Alternativa

Este componente de tema oferece estilização alternativa para quaisquer categorias especificadas que utilizem o plugin Discourse Voting.

Instalação

Link do Repositório
https://github.com/discourse/discourse-alternative-voting-category-style

Se você não está familiarizado com componentes de tema e como instalá-los, consulte o guia de instalação de tema. E se quiser aprender mais sobre temas do Discourse, dê uma olhada neste guia.

Pré-visualização

A ideia geral é baseada neste mockup criado por @erlend_sh.

Recursos Notáveis

  • Visual compacto
  • Contagem de votos mais proeminente
  • Ícone colorido para indicar que você votou no tópico

Configurações

Atualmente, há uma configuração usada para especificar quais categorias aplicar o estilo:

Customizações Extras

Se você deseja personalizar a aparência de tags específicas dentro do seu tópico de votação (veja a tag “EM ANDAMENTO” na imagem de pré-visualização acima), você pode criar um componente adicional e modificar o seguinte CSS para atender às suas necessidades:

.voting-category.list-container {
    .topic-list-item:not(.about-topic) {
        // Estilização comum para todas as tags listadas
        [data-tag-name="in-progress"],
        [data-tag-name="my-tag-one"],
        [data-tag-name="my-tag-two"] {
            font-weight: bold;
            text-transform: uppercase;
            font-family: Trebuchet MS;
        }
        // Estilização específica para tags individuais
        [data-tag-name="in-progress"] {
            color: #9e63d0;
        }
        [data-tag-name="my-tag-one"] {
            color: #5bd04a;
        }
        [data-tag-name="my-tag-two"] {
            color: #5f5dd0;
        }
    }
}

Futuro

A única coisa que você pode notar ausente no mockup original é um resumo do tópico abaixo do título do tópico. Esse recurso exigiria alterações no núcleo ou no plugin de votação, que precisarão aguardar por enquanto.

Como sempre, por favor, me avise se você encontrar algum problema.

Muito obrigado @simon e @erlend_sh por trabalharem comigo nisso :heart_eyes:

38 curtidas

Great theme component! One thing I found was that the unlisted icon is not fitting into your design. The topic title is overlapping it.

03%20AM

8 curtidas

Thanks for the quick feedback! I will try to get that fixed a little later today :slightly_smiling_face:

Edit: @Sean_R I just pushed a quick fix. I may try to tinker with it a little more to get it even better, but there shouldn’t be any more overlap!

6 curtidas

Looks good now

image

I also had to change the CSS to make the topic list wider.

Was

.voting-category.list-container {
  max-width: $small-width;

Changed to

.voting-category.list-container {
  max-width: $large-width;
6 curtidas

Thanks for confirming that is fixed!

The smaller width was based on the original design. The rationale was that there was so little information displayed on each topic row that it would look odd at full width. I can imagine some people might feel the opposite - that the smaller width looks odd. A width option to toggle via a theme setting would be an easy addition. I’ll add that to my to-do list with this.

5 curtidas

This component has been updated! The changes include:

  • Support for font awesome changes
  • Additional setting to toggle between small-width and large-width
6 curtidas

Does this component still work?

I use an instance of free.discourse.group and am looking for an alternative for the Discourse Vote Plugin

The component still works, but it is meant to be used alongside the voting plugin, not instead. It only provides an alternative style option for the voting plugin.

3 curtidas

Ah, now I get it, thanks for your attention :hugs:

3 curtidas

Is somebody still actively using this? Tried it with the current Version of the voting Plugin (0.5), looks pretty good, but doesn’t seem to be functional anymore - at least in our instance.

Can you elaborate on what isn’t functioning? I just tested it out and everything seems to be working. Noting that this component is purely styling right now. You aren’t able to vote directly from the topic list.

2 curtidas

thanks for the immediate reply!!!

First

Noting that this component is purely styling right now. You aren’t able to vote directly from the topic list.

Ok, I did not realise that. I thought it would actually allow exactly that: Voting from the topic list. Good to know. Need to reevaluate then.

Second
It does not seem to show the actual data/votes. Two pictures here: one with the style activated and one deactivated.


I suspected a conflict with the theme used, but even using another one, it does not seem to solve the issue.

1 curtida

Hmm I just tested it on an up-to-date site and I’m not having any issues with the vote count or “I voted” indicator:

Can you check to see if there are any errors in your browser’s console? Have you tried with a brand new default theme with no other components or customizations added?

2 curtidas

Você deve ser capaz de adicionar uma regra CSS a um tema/componente para corrigir isso. Não tenho o plugin Ratings instalado para testar, mas acho que deve ser algo assim:

.rating-list {
  margin-left: 65px;
}

Na verdade, estou trabalhando nesse componente agora (não era tocado há muito tempo!), então vou ver se consigo fazer com que qualquer conteúdo personalizado da lista de tópicos seja posicionado corretamente por padrão.

3 curtidas

Perfeito, obrigado :ok_hand:

1 curtida

Instalei este componente de tema e o ativei em duas categorias. Uma parece apresentar um bug, a outra parece boa. A diferença é que o nome da categoria está aparecendo na lista, sobrepondo-se à contagem de votos. A única diferença que consigo pensar é que a categoria com o bug tem subcategorias, enquanto a outra não tem.

Com bug, tem subcategorias:

Boa, sem subcategorias:

Caso ajude, este é o tema Padrão com a paleta de cores Grey Amber.

1 curtida

Obrigado pelo relatório! Se você atualizar o componente, deverá obter a seguinte correção:

4 curtidas

Muito obrigado por esta reação hiper-rápida! A correção funciona.

PS: por favor, adicione a tag #voting, este componente é bom demais para escondê-lo. :slight_smile:

3 curtidas

Existe um componente de tema que faz com que o indicador de voto em tópicos individuais tenha a mesma aparência?

1 curtida

Este componente também oculta as colunas que mostram participantes, visualizações e tempo de atividade. Seria bom ter isso separado, para que se pudesse facilmente habilitar apenas a mudança de estilo de votação sem também ocultar essas?

Ou — mover

  .posters,
  .views,
  .activity {
    display: none;
  }

para dentro de @if $use_compact_width == "true" {
?

2 curtidas