Commit 3ef4d9c7 authored by evazion's avatar evazion

artists/summary: link other names to artist searches.

* Link other names to artist searches instead of to the new artist page.
* Remove the asterisk next to other names indicating the name isn't used
  as the primary name of another artist. This is almost always the case.
parent 4ed716e9
module ArtistsHelper
def link_to_artist(name)
artist = Artist.find_by_name(name)
if artist
link_to(artist.name, artist_path(artist))
else
link_to(name, new_artist_path(artist: {name: name})) + " " + content_tag("span", "*", :class => "new-artist", :title => "No artist with this name currently exists.")
end
end
def link_to_artists(names)
names.map do |name|
link_to_artist(name)
end.join(", ").html_safe
end
end
......@@ -159,8 +159,6 @@
--error-message-color: #A00;
--new-artist-color: #A00;
--bulk-update-request-approved-color: green;
--bulk-update-request-failed-color: red;
......@@ -441,7 +439,6 @@ body[data-current-user-theme="dark"] {
--low-post-count-color: var(--red-1);
--login-link-color: var(--red-1);
--new-artist-color: var(--red-1);
--remove-favorite-button: var(--red-1);
--fetch-source-data-border: 1px solid var(--grey-4);
--quick-search-form-background: var(--grey-1);
......
div#c-artists, div#excerpt {
span.new-artist {
font-weight: bold;
color: var(--new-artist-color);
}
.recent-posts h2 {
margin: 1em 0 0.5em;
}
......
......@@ -3,13 +3,26 @@
<li><strong>Status</strong> <%= artist.status %></li>
<% if artist.other_names.present? %>
<li><strong>Other Names</strong> <%= link_to_artists(artist.other_names) %></li>
<li>
<strong>Other Names</strong>
<% artist.other_names.map do |other_name| %>
<%= link_to other_name, artists_path(search: { any_name_matches: other_name }), class: "artist-other-name" %>
<% end %>
</li>
<% end %>
<% if artist.group_name.present? %>
<li><strong>Group</strong> <%= link_to_artist(artist.group_name) %></li>
<li>
<strong>Group</strong>
<%= link_to artist.group_name, artists_path(search: { group_name: artist.group_name }) %>
</li>
<% end %>
<% if artist.members.present? %>
<li><strong>Members</strong> <%= link_to_artists(artist.members.map(&:name)) %></li>
<li>
<strong>Members</strong>
<% artist.members.each do |member_name| %>
<%= link_to member_name, artists_path(search: { name: member_name }) %>
<% end %>
</li>
<% end %>
<% if artist.domains.any? %>
<li><strong>Domains</strong></li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment