From c207f34dbbe00a257e562c3fc3992c6ca3c2282a Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 8 Feb 2022 23:11:56 -0600 Subject: [PATCH] artists: unify `show` and `show_or_new` templates. --- app/views/artists/_show.html.erb | 24 ------------------------ app/views/artists/_summary.html.erb | 3 ++- app/views/artists/show.html.erb | 26 ++++++++++++++++++++++---- app/views/artists/show_or_new.html.erb | 6 +----- 4 files changed, 25 insertions(+), 34 deletions(-) delete mode 100644 app/views/artists/_show.html.erb mode change 100644 => 120000 app/views/artists/show_or_new.html.erb diff --git a/app/views/artists/_show.html.erb b/app/views/artists/_show.html.erb deleted file mode 100644 index 95fd6b581..000000000 --- a/app/views/artists/_show.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<% page_title "#{@artist.pretty_name.titleize} | Artist Profile" %> -<%= render "secondary_links" %> - -
-
- <% if @artist.is_banned? && !policy(@artist).can_view_banned? %> -

The artist requested removal of this page.

- <% else %> - <%= yield %> - - <% if @artist.tag.present? && @artist.tag.post_count > 0 %> -
-

- <%= link_to "Posts", posts_path(tags: @artist.name) %> -

- - <%= render "posts/partials/common/inline_blacklist" %> - - <%= render_post_gallery(@artist.tag.posts.limit(8), tags: @artist.name) %> -
- <% end %> - <% end%> -
-
diff --git a/app/views/artists/_summary.html.erb b/app/views/artists/_summary.html.erb index b3a65cff5..0b5dcc233 100644 --- a/app/views/artists/_summary.html.erb +++ b/app/views/artists/_summary.html.erb @@ -16,8 +16,9 @@ <% if artist.is_banned? && !policy(artist).can_view_banned? %>

The artist requested removal of this page.

+<% elsif artist.new_record? %> +

This artist entry does not exist. <%= link_to "Create new artist entry", new_artist_path(artist: { name: artist.name }), rel: "nofollow" %>.

<% else %> - <% if artist.other_names.present? %>
<% artist.other_names.map do |other_name| %> diff --git a/app/views/artists/show.html.erb b/app/views/artists/show.html.erb index 870c3febc..69930bd79 100644 --- a/app/views/artists/show.html.erb +++ b/app/views/artists/show.html.erb @@ -1,7 +1,25 @@ +<% page_title "#{@artist.pretty_name.titleize} | Artist Profile" %> <% noindex if @artist.is_banned? %> +<%= render "secondary_links" %> -<%= render layout: "show" do %> -
- <%= render "summary", artist: @artist %> +
+
+ <% if @artist.is_banned? && !policy(@artist).can_view_banned? %> +

The artist requested removal of this page.

+ <% else %> + <%= render "artists/summary", artist: @artist %> + + <% if @artist.tag.present? && @artist.tag.post_count > 0 %> +
+

+ <%= link_to "Posts", posts_path(tags: @artist.name) %> +

+ + <%= render "posts/partials/common/inline_blacklist" %> + + <%= render_post_gallery(@artist.tag.posts.limit(8), tags: @artist.name) %> +
+ <% end %> + <% end%>
-<% end %> +
diff --git a/app/views/artists/show_or_new.html.erb b/app/views/artists/show_or_new.html.erb deleted file mode 100644 index 73e8265e3..000000000 --- a/app/views/artists/show_or_new.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= render layout: "show" do %> -
-

This artist entry does not exist. <%= link_to "Create new artist entry", new_artist_path(artist: { name: params[:name] }), rel: "nofollow" %>.

-
-<% end %> diff --git a/app/views/artists/show_or_new.html.erb b/app/views/artists/show_or_new.html.erb new file mode 120000 index 000000000..29c05d04f --- /dev/null +++ b/app/views/artists/show_or_new.html.erb @@ -0,0 +1 @@ +show.html.erb \ No newline at end of file