Files
nairobi/app/views/comments/_responses_count.html.erb
Javi Martín a8a79fe97f Extract mixin to add font awesome icons
This way we can simplify the HTML and easily apply font awesome icons to
any element.

Note the mixin uses `extend`, which we generally try to avoid. It's OK
in this case, since `fa-` classes only have one rule, affecting the
content of its `::before` pseudo-element. Unfortunately we can't use
`include fa-content($fa-var-#{$icon})` because it's not valid SCSS. We
could make the mixin accept an icon instead of an icon name, and call it
using `has-fa-icon(r, $fa-var-plus-square)`. However, IMHO that would
make the code a bit more complex with no real benefit.
2020-09-08 13:32:08 +02:00

9 lines
357 B
Plaintext

<% if count > 0 %>
<%= link_to "", class: "js-toggle-children" do %>
<span class="show-children"><%= t("comments.comment.responses_show", count: count) %></span>
<span class="collapse-children"><%= t("comments.comment.responses_collapse", count: count) %></span>
<% end %>
<% else %>
<%= t("comments.comment.responses", count: 0) %>
<% end %>