<% page_title "#{@artist.pretty_name.titleize} | Artist Profile" %>
<%= render "secondary_links" %>

<div id="c-artists">
  <div id="a-show">
    <h1>Artist: <%= link_to @artist.pretty_name, posts_path(tags: @artist.name), class: tag_class(@artist.tag) %></h1>

    <% if @artist.is_banned? && !policy(@artist).can_view_banned? %>
      <p>The artist requested removal of this page.</p>
    <% else %>
      <% if @artist.wiki_page.present? && !@artist.wiki_page.is_deleted? %>
        <div class="artist-wiki">
          <div class="prose">
            <%= format_text(@artist.wiki_page.body, :disable_mentions => true) %>
          </div>

          <p><%= link_to "View wiki page", @artist.wiki_page %></p>
        </div>
      <% end %>

      <%= yield %>

      <% if @artist.tag.present? && @artist.tag.post_count > 0 %>
        <div class="recent-posts">
          <h2 class="recent-posts-header">
            <%= link_to "Posts", posts_path(tags: @artist.name) %>
          </h2>

          <%= render "posts/partials/common/inline_blacklist" %>

          <div class="recent-posts-previews">
            <%= post_previews_html(@artist.tag.posts.limit(8), tags: @artist.name) %>
          </div>
        </div>
      <% end %>
    <% end%>
  </div>
</div>
