artists: unify show and show_or_new templates.

This commit is contained in:
evazion
2022-02-08 23:11:56 -06:00
parent 7bbe6e9d22
commit c207f34dbb
4 changed files with 25 additions and 34 deletions

View File

@@ -1,24 +0,0 @@
<% page_title "#{@artist.pretty_name.titleize} | Artist Profile" %>
<%= render "secondary_links" %>
<div id="c-artists">
<div id="a-show">
<% if @artist.is_banned? && !policy(@artist).can_view_banned? %>
<p>The artist requested removal of this page.</p>
<% else %>
<%= 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" %>
<%= render_post_gallery(@artist.tag.posts.limit(8), tags: @artist.name) %>
</div>
<% end %>
<% end%>
</div>
</div>

View File

@@ -16,8 +16,9 @@
<% if artist.is_banned? && !policy(artist).can_view_banned? %>
<p>The artist requested removal of this page.</p>
<% elsif artist.new_record? %>
<p>This artist entry does not exist. <%= link_to "Create new artist entry", new_artist_path(artist: { name: artist.name }), rel: "nofollow" %>.</p>
<% else %>
<% if artist.other_names.present? %>
<div>
<% artist.other_names.map do |other_name| %>

View File

@@ -1,7 +1,25 @@
<% page_title "#{@artist.pretty_name.titleize} | Artist Profile" %>
<% noindex if @artist.is_banned? %>
<%= render "secondary_links" %>
<%= render layout: "show" do %>
<div>
<%= render "summary", artist: @artist %>
<div id="c-artists">
<div id="a-show">
<% if @artist.is_banned? && !policy(@artist).can_view_banned? %>
<p>The artist requested removal of this page.</p>
<% else %>
<%= render "artists/summary", artist: @artist %>
<% 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" %>
<%= render_post_gallery(@artist.tag.posts.limit(8), tags: @artist.name) %>
</div>
<% end %>
<% end%>
</div>
<% end %>
</div>

View File

@@ -1,5 +0,0 @@
<%= render layout: "show" do %>
<div>
<p>This artist entry does not exist. <%= link_to "Create new artist entry", new_artist_path(artist: { name: params[:name] }), rel: "nofollow" %>.</p>
</div>
<% end %>

View File

@@ -0,0 +1 @@
show.html.erb