sources: add artist profile links to fetch source data box.
Add site icons linking to all the artist's sites in the fetch source data box. Some artist entries have a large number of URLs. Various heuristics are applied to try to present the most useful URLs first. Dead URLs and redundant URLs (Pixiv stacc and Twitter intent URLs) are filtered out. Remaining URLs are sorted first by site (to put sites like Pixiv and Twitter first), then by URL (to break ties when an artist has multiple accounts on the same site). Some sites have shitty hard-to-read icons. It can't be helped. The icons are the official favicons of each site.
This commit is contained in:
@@ -11,6 +11,11 @@ module IconHelper
|
||||
end
|
||||
end
|
||||
|
||||
def image_icon_tag(filename, class: nil, **options)
|
||||
klass = binding.local_variable_get(:class)
|
||||
tag.img(src: "/images/#{filename}", class: "icon #{klass}", **options)
|
||||
end
|
||||
|
||||
# fontawesome.com/icons/arrow-alt-up
|
||||
def upvote_icon(**options)
|
||||
svg_icon_tag("upvote-icon", "M272 480h-96c-13.3 0-24-10.7-24-24V256H48.2c-21.4 0-32.1-25.8-17-41L207 39c9.4-9.4 24.6-9.4 34 0l175.8 176c15.1 15.1 4.4 41-17 41H296v200c0 13.3-10.7 24-24 24z", **options)
|
||||
@@ -148,4 +153,83 @@ module IconHelper
|
||||
def plus_icon(**options)
|
||||
icon_tag("fas fa-plus", **options)
|
||||
end
|
||||
|
||||
def globe_icon(**options)
|
||||
icon_tag("fas fa-globe", **options)
|
||||
end
|
||||
|
||||
def discord_icon(**options)
|
||||
image_icon_tag("discord-logo.png", **options)
|
||||
end
|
||||
|
||||
def github_icon(**options)
|
||||
image_icon_tag("github-logo.png", **options)
|
||||
end
|
||||
|
||||
def twitter_icon(**options)
|
||||
image_icon_tag("twitter-logo.png", **options)
|
||||
end
|
||||
|
||||
def external_site_icon(site_name, **options)
|
||||
case site_name
|
||||
when "ArtStation"
|
||||
image_icon_tag("artstation-logo.png", **options)
|
||||
when "BCY"
|
||||
image_icon_tag("bcy-logo.png", **options)
|
||||
when "Booth.pm"
|
||||
image_icon_tag("booth-pm-logo.png", **options)
|
||||
when "Circle.ms"
|
||||
image_icon_tag("circle-ms-logo.png", **options)
|
||||
when "DLSite"
|
||||
image_icon_tag("dlsite-logo.png", **options)
|
||||
when "Deviant Art"
|
||||
image_icon_tag("deviantart-logo.png", **options)
|
||||
when "Facebook"
|
||||
image_icon_tag("facebook-logo.png", **options)
|
||||
when "Fantia"
|
||||
image_icon_tag("fantia-logo.png", **options)
|
||||
when "FC2"
|
||||
image_icon_tag("fc2-logo.png", **options)
|
||||
when "Gumroad"
|
||||
image_icon_tag("gumroad-logo.png", **options)
|
||||
when "Instagram"
|
||||
image_icon_tag("instagram-logo.png", **options)
|
||||
when "Lofter"
|
||||
image_icon_tag("lofter-logo.png", **options)
|
||||
when "Melonbooks"
|
||||
image_icon_tag("melonbooks-logo.png", **options)
|
||||
when "Nico Seiga"
|
||||
image_icon_tag("nicoseiga-logo.png", **options)
|
||||
when "Nijie"
|
||||
image_icon_tag("nijie-logo.png", **options)
|
||||
when "Patreon"
|
||||
image_icon_tag("patreon-logo.png", **options)
|
||||
when "pawoo.net"
|
||||
image_icon_tag("pawoo-logo.png", **options)
|
||||
when "Pixiv"
|
||||
image_icon_tag("pixiv-logo.png", **options)
|
||||
when "Pixiv Fanbox"
|
||||
image_icon_tag("pixiv-fanbox-logo.png", **options)
|
||||
when "Pixiv Sketch"
|
||||
image_icon_tag("pixiv-sketch-logo.png", **options)
|
||||
when "Privatter"
|
||||
image_icon_tag("privatter-logo.png", **options)
|
||||
when "Skeb"
|
||||
image_icon_tag("skeb-logo.png", **options)
|
||||
when "Tinami"
|
||||
image_icon_tag("tinami-logo.png", **options)
|
||||
when "Tumblr"
|
||||
image_icon_tag("tumblr-logo.png", **options)
|
||||
when "Twitter"
|
||||
image_icon_tag("twitter-logo.png", **options)
|
||||
when "Toranoana"
|
||||
image_icon_tag("toranoana-logo.png", **options)
|
||||
when "Weibo"
|
||||
image_icon_tag("weibo-logo.png", **options)
|
||||
when "Youtube"
|
||||
image_icon_tag("youtube-logo.png", **options)
|
||||
else
|
||||
globe_icon(**options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user