Como mostrar topic-map em posts sem comentários?

Olá,

Agora que vi este tópico, lembrei-me de que já tinha visto um commit sobre isso antes. :slightly_smiling_face:

Acho que isso deve funcionar agora :arrow_down_small:

Cabeçalho

<script type="text/discourse-plugin" version="0.8">
  api.includePostAttributes('topicMap');
</script>


Também adicionei um pouco de CSS para ocultar estatísticas desnecessárias quando não há outras postagens.

Comum / CSS

body:not(.archetype-private_message) {
  .topic-post.regular {
    // if last-of-type is the #post_1
    &:last-of-type {
      article#post_1 {
        .topic-map {
          width: max-content;
          nav.buttons {
            display: none;
          }
          ul li {
            // hide all statistics but views
            &:not(.secondary.views) {
              display: none;
            }
          }
          // show views on mobile view
          .secondary.views {
            .mobile-view & {
              display: list-item;
              text-align: center;
            }
          }
        }
      }
    }
  }
}

Desktop (sem resposta)

Mobile (sem resposta)

Quando alguém responde, volta ao padrão.

14 curtidas