Skip to content

Commit

Permalink
Display taggables a labels
Browse files Browse the repository at this point in the history
Looks nicer than the comma separated list.
  • Loading branch information
tvdeyen committed Feb 21, 2024
1 parent ecfb7c1 commit 5d9023b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions app/assets/stylesheets/alchemy/labels.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.label {
@include label-base(
$margin: $default-margin/2 0,
$padding: $default-padding 2*$default-padding $default-padding
);
@include label-base($margin: 0, $padding: 0 2 * $default-padding);
}
6 changes: 5 additions & 1 deletion app/views/alchemy/admin/tags/_tag.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
<td class="icon"><%= render_icon(:tag, size: "xl") %></td>
<td class="name"><%= tag.name %></td>
<td>
<%= tag.taggings.collect(&:taggable).compact.map { |t| t.class.model_name.human }.uniq.join(', ') %>
<% tag.taggings.collect(&:taggable).compact.uniq.each do |taggable| %>
<span class="label">
<%= taggable.class.model_name.human %>
</span>
<% end %>
</td>
<td class="count"><%= tag.taggings.count %></td>
<td class="tools">
Expand Down

0 comments on commit 5d9023b

Please sign in to comment.