From 3ef4d9c7ac86faf365bc7d3abeafd9888518da96 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 8 Feb 2020 18:35:16 -0600 Subject: [PATCH] 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. --- app/helpers/artists_helper.rb | 17 ----------------- app/javascript/src/styles/base/040_colors.css | 3 --- .../src/styles/specific/artists.scss | 5 ----- app/views/artists/_summary.html.erb | 19 ++++++++++++++++--- 4 files changed, 16 insertions(+), 28 deletions(-) delete mode 100644 app/helpers/artists_helper.rb diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb deleted file mode 100644 index cc236a4b9..000000000 --- a/app/helpers/artists_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -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 diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css index 9c8bf226a..d64d22c04 100644 --- a/app/javascript/src/styles/base/040_colors.css +++ b/app/javascript/src/styles/base/040_colors.css @@ -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); diff --git a/app/javascript/src/styles/specific/artists.scss b/app/javascript/src/styles/specific/artists.scss index ce112bc04..6d8545599 100644 --- a/app/javascript/src/styles/specific/artists.scss +++ b/app/javascript/src/styles/specific/artists.scss @@ -1,9 +1,4 @@ div#c-artists, div#excerpt { - span.new-artist { - font-weight: bold; - color: var(--new-artist-color); - } - .recent-posts h2 { margin: 1em 0 0.5em; } diff --git a/app/views/artists/_summary.html.erb b/app/views/artists/_summary.html.erb index 7c13f0f1c..c75ca3aba 100644 --- a/app/views/artists/_summary.html.erb +++ b/app/views/artists/_summary.html.erb @@ -3,13 +3,26 @@
  • Status <%= artist.status %>
  • <% if artist.other_names.present? %> -
  • Other Names <%= link_to_artists(artist.other_names) %>
  • +
  • + Other Names + <% artist.other_names.map do |other_name| %> + <%= link_to other_name, artists_path(search: { any_name_matches: other_name }), class: "artist-other-name" %> + <% end %> +
  • <% end %> <% if artist.group_name.present? %> -
  • Group <%= link_to_artist(artist.group_name) %>
  • +
  • + Group + <%= link_to artist.group_name, artists_path(search: { group_name: artist.group_name }) %> +
  • <% end %> <% if artist.members.present? %> -
  • Members <%= link_to_artists(artist.members.map(&:name)) %>
  • +
  • + Members + <% artist.members.each do |member_name| %> + <%= link_to member_name, artists_path(search: { name: member_name }) %> + <% end %> +
  • <% end %> <% if artist.domains.any? %>
  • Domains