<%
  raw_model = content.is_a?(ContentSerializer) ? content.raw_model : content
%>

<div class="tags-container">
  <% value.each do |tag| %>
    <% if user_signed_in? && content.user == current_user %>
      <%=
        # TODO: deprecate this route and send to content_type#index?tag=tag instead
        link_to send(
          "page_tag_#{raw_model.class.name.downcase.pluralize}_path",
          slug: PageTagService.slug_for(tag)
        ) do
      %>
        <span class="new badge <%= raw_model.class.color %> left" data-badge-caption="<%= tag %>"></span>
      <% end %>
    <% else %>
      <span class="new badge <%= raw_model.class.color %> left" data-badge-caption="<%= tag %>"></span>
    <% end %>
  <% end %>
</div>
