diff --git a/app/components/source_data_component.rb b/app/components/source_data_component.rb index 0926db5ea..c5e4a5bdb 100644 --- a/app/components/source_data_component.rb +++ b/app/components/source_data_component.rb @@ -11,8 +11,6 @@ class SourceDataComponent < ApplicationComponent end def profile_urls(artist) - artist.urls.active.reject(&:secondary_url?).sort_by do |artist_url| - [artist_url.priority, artist_url.domain, artist_url.url] - end + artist.sorted_urls.select(&:is_active?).reject(&:secondary_url?) end end diff --git a/app/javascript/src/styles/base/030_links.scss b/app/javascript/src/styles/base/030_links.scss index 2dd55f010..5da4ac139 100644 --- a/app/javascript/src/styles/base/030_links.scss +++ b/app/javascript/src/styles/base/030_links.scss @@ -1,23 +1,20 @@ @import "./000_vars"; -a:link { +a { color: var(--link-color); text-decoration: none; } a:visited { color: var(--link-color); - text-decoration: none; } a:hover { color: var(--link-hover-color); - text-decoration: none; } a:active { color: var(--link-color); - text-decoration: none; } a.active { diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css index 2e9b74e04..cfc700211 100644 --- a/app/javascript/src/styles/base/040_colors.css +++ b/app/javascript/src/styles/base/040_colors.css @@ -310,6 +310,11 @@ html { --related-tags-container-background: var(--grey-0); --selected-related-tag-background-color: var(--link-color); --selected-related-tag-color: var(--inverse-text-color); + + --inactive-artist-url-color: var(--red-6); + --inactive-artist-url-hover-color: var(--red-5); + --banned-artist-label-color: var(--red-5); + --deleted-artist-label-color: var(--grey-6); } /* variables that aren't defined in the dark theme fall back to the :root theme */ @@ -506,4 +511,9 @@ body[data-current-user-theme="dark"] { --related-tags-container-background: var(--grey-8); --selected-related-tag-background-color: var(--link-color); --selected-related-tag-color: var(--inverse-text-color); + + --inactive-artist-url-color: var(--red-4); + --inactive-artist-url-hover-color: var(--red-3); + --banned-artist-label-color: var(--red-5); + --deleted-artist-label-color: var(--grey-6); } diff --git a/app/javascript/src/styles/common/utilities.scss b/app/javascript/src/styles/common/utilities.scss index 8aaa0b5be..eb3caba8a 100644 --- a/app/javascript/src/styles/common/utilities.scss +++ b/app/javascript/src/styles/common/utilities.scss @@ -28,6 +28,12 @@ $spacer: 0.25rem; /* 4px */ .text-xxs { font-size: var(--text-xxs); } .text-xs { font-size: var(--text-xs); } .text-sm { font-size: var(--text-sm); } +.text-lg { font-size: var(--text-lg); } +.text-xl { font-size: var(--text-xl); } +.text-xxl { font-size: var(--text-xxl); } + +.underline { text-decoration-line: underline; } +.decoration-dotted { text-decoration-style: dotted; } .truncate { overflow: hidden; @@ -90,9 +96,13 @@ $spacer: 0.25rem; /* 4px */ .p-1 { padding: 1 * $spacer; } .p-4 { padding: 4 * $spacer; } +.px-1 { padding-left: 1 * $spacer; padding-right: 1 * $spacer; } +.px-2 { padding-left: 2 * $spacer; padding-right: 2 * $spacer; } .px-4 { padding-left: 4 * $spacer; padding-right: 4 * $spacer; } .px-8 { padding-left: 8 * $spacer; padding-right: 8 * $spacer; } +.py-1 { padding-top: 1 * $spacer; padding-bottom: 1 * $spacer; } +.py-2 { padding-top: 2 * $spacer; padding-bottom: 2 * $spacer; } .py-4 { padding-top: 4 * $spacer; padding-bottom: 4 * $spacer; } .py-8 { padding-top: 8 * $spacer; padding-bottom: 8 * $spacer; } @@ -113,6 +123,7 @@ $spacer: 0.25rem; /* 4px */ .h-auto { height: auto; } .h-1 { height: 1 * $spacer; } .h-3 { height: 3 * $spacer; } +.h-4 { height: 4 * $spacer; } .h-8 { height: 8 * $spacer; } .h-10 { height: 10 * $spacer; } .h-12 { height: 12 * $spacer; } diff --git a/app/javascript/src/styles/specific/artists.scss b/app/javascript/src/styles/specific/artists.scss new file mode 100644 index 000000000..2281c1836 --- /dev/null +++ b/app/javascript/src/styles/specific/artists.scss @@ -0,0 +1,19 @@ +.inactive-artist-url { + &:link, &:visited { + color: var(--inactive-artist-url-color); + } + + &:hover { + color: var(--inactive-artist-url-hover-color); + } +} + +.banned-artist-label { + background-color: var(--banned-artist-label-color); + color: var(--inverse-text-color); +} + +.deleted-artist-label { + background-color: var(--deleted-artist-label-color); + color: var(--inverse-text-color); +} diff --git a/app/models/artist.rb b/app/models/artist.rb index b32a97c72..4a80cd493 100644 --- a/app/models/artist.rb +++ b/app/models/artist.rb @@ -34,7 +34,9 @@ class Artist < ApplicationRecord extend ActiveSupport::Concern def sorted_urls - urls.sort {|a, b| a.priority <=> b.priority} + urls.sort_by do |url| + [url.is_active? ? 0 : 1, url.priority, url.domain, url.secondary_url? ? 1 : 0, url.url] + end end def url_array diff --git a/app/views/artists/_show.html.erb b/app/views/artists/_show.html.erb index 7851ff52f..95fd6b581 100644 --- a/app/views/artists/_show.html.erb +++ b/app/views/artists/_show.html.erb @@ -3,21 +3,9 @@
The artist requested removal of this page.
<% else %> - <% if @artist.wiki_page.present? && !@artist.wiki_page.is_deleted? %> -<%= link_to "View wiki page", @artist.wiki_page %>
-The artist requested removal of this page.
+<% else %> + <% if artist.other_names.present? %> -+
+ <% 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" %> +
+ + <%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %> +<% end %> diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb index bdf1c4bfe..49509abb2 100644 --- a/app/views/posts/index.html.erb +++ b/app/views/posts/index.html.erb @@ -157,25 +157,7 @@ <% if @post_set.artist.present? && @post_set.artist.is_banned? && !policy(@post_set.artist).can_view_banned? %>The artist requested removal of this page.
<% elsif @post_set.artist.present? %> - <% @post_set.artist.tap do |artist| %> - <% unless artist.wiki_page.blank? %> -- <% if artist.wiki_page.present? %> - <%= link_to "View wiki", artist.wiki_page, id: "view-wiki-link" %> | - <% end %> - <%= link_to "View artist", artist, id: "view-artist-link" %> -
-