Factor out artists/show view into artists/_show layout.

This commit is contained in:
evazion
2017-07-06 18:15:12 -05:00
parent 68bf355542
commit e5598be20e
2 changed files with 35 additions and 33 deletions

View File

@@ -0,0 +1,28 @@
<div id="c-artists">
<div id="a-show">
<h1>Artist: <%= link_to @artist.pretty_name, posts_path(:tags => @artist.name), :class => "tag-type-#{@artist.category_name}" %></h1>
<% if @artist.notes.present? && @artist.visible? %>
<div class="prose">
<%= format_text(@artist.notes, :ragel => true, :disable_mentions => true) %>
</div>
<p><%= link_to "View wiki page", @artist.wiki_page %></p>
<% end %>
<%= yield %>
<div class="recent-posts">
<h1>Recent Posts</h1>
<div style="margin: 1em 0;">
<%= @post_set.presenter.post_previews_html(self) %>
</div>
</div>
<%= render "secondary_links" %>
</div>
</div>
<% content_for(:page_title) do %>
Artist - <%= @artist.name %> - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -1,35 +1,9 @@
<div id="c-artists">
<div id="a-show">
<h1>Artist: <%= link_to @artist.pretty_name, posts_path(:tags => @artist.name), :class => "tag-type-#{@artist.category_name}" %></h1>
<% if @artist.notes.present? && @artist.visible? %>
<div class="prose">
<%= format_text(@artist.notes, :ragel => true, :disable_mentions => true) %>
</div>
<p><%= link_to "View wiki page", @artist.wiki_page %></p>
<% end %>
<% if @artist.visible? %>
<div>
<%= render "summary", artist: @artist %>
</div>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
<div class="recent-posts">
<h1>Recent Posts</h1>
<div style="margin: 1em 0;">
<%= @post_set.presenter.post_previews_html(self) %>
</div>
<%= render layout: "show" do %>
<% if @artist.visible? %>
<div>
<%= render "summary", artist: @artist %>
</div>
<%= render "secondary_links" %>
</div>
</div>
<% content_for(:page_title) do %>
Artist - <%= @artist.name %> - <%= Danbooru.config.app_name %>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
<% end %>