Files
danbooru/app/views/artists/_summary.html.erb
evazion 7bbe6e9d22 artists: make artist pages less shit.
* Group URLs by site.
* List most important URLs first and dead URLs last.
* Add site icons next to URLs.
* Put other names and group name beneath the artist name, instead of beneath the wiki.
2022-02-08 22:20:01 -06:00

80 lines
2.4 KiB
Plaintext

<%# artist %>
<div class="flex items-center gap-2">
<% if artist.is_banned? %>
<span class="banned-artist-label text-xxs px-2 rounded">BANNED</span>
<% end %>
<% if artist.is_deleted? %>
<span class="deleted-artist-label text-xxs px-2 rounded">DELETED</span>
<% end %>
<%= link_to artist.pretty_name, posts_path(tags: artist.name), class: [tag_class(artist.tag), "heading text-xl"] %>
<span class="text-sm post-count"><%= artist.tag.post_count %></span>
</div>
<% if artist.is_banned? && !policy(artist).can_view_banned? %>
<p>The artist requested removal of this page.</p>
<% else %>
<% if artist.other_names.present? %>
<div>
<% artist.other_names.map do |other_name| %>
<%= link_to other_name, artists_path(search: { any_name_matches: other_name }), class: "artist-other-name" %>
<% end %>
</div>
<% end %>
<% if artist.group_name.present? %>
<div>
<strong>Group</strong>
<%= link_to artist.group_name, artists_path(search: { group_name: artist.group_name }), class: "artist-other-name" %>
</div>
<% end %>
<% if artist.members.present? %>
<div>
<strong>Members</strong>
<% artist.members.each do |member| %>
<%= link_to member.name, artists_path(search: { name: member.name }), class: "artist-other-name" %>
<% end %>
</div>
<% end %>
<% if artist.wiki_page.present? && !artist.wiki_page.is_deleted? %>
<div class="artist-wiki prose mt-4">
<%= format_text(artist.wiki_page.body, disable_mentions: true) %>
</div>
<% end %>
<% if artist.urls.present? %>
<p>
<h6>URLs</h6>
<ul>
<% artist.sorted_urls.each do |url| %>
<li>
<%= external_link_to url.url, external_site_icon(url.site_name, class: "h-4") %>
<% if url.is_active? %>
<%= external_link_to url.url %>
<% else %>
<%= external_link_to url.url, class: "inactive-artist-url underline decoration-dotted" %>
<% end %>
</li>
<% end %>
</ul>
</p>
<% end %>
<p>
<% if artist.wiki_page.present? %>
<%= link_to "Edit wiki", edit_wiki_page_path(artist.wiki_page), id: "view-wiki-link" %> |
<% end %>
<%= link_to "Edit artist", edit_artist_path(artist), id: "view-artist-link" %>
</p>
<%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %>
<% end %>