From 52ff12dffb68af07fbeccd76f43a044892b525ff Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 5 Jul 2022 15:19:41 -0500 Subject: [PATCH] dtext: fix wiki links not showing tag type for empty tags. --- app/logical/d_text.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/logical/d_text.rb b/app/logical/d_text.rb index e59509c38..9cc2b1b62 100644 --- a/app/logical/d_text.rb +++ b/app/logical/d_text.rb @@ -62,6 +62,10 @@ class DText tag = tags.find { |tag| tag.name == name } artist = artists.find { |artist| artist.name == name } + if tag.present? + node["class"] += " tag-type-#{tag.category}" + end + if tag.present? && tag.artist? node["href"] = "/artists/show_or_new?name=#{CGI.escape(name)}" @@ -69,8 +73,6 @@ class DText node["class"] += " dtext-artist-does-not-exist" node["title"] = "This artist page does not exist" end - - node["class"] += " tag-type-#{tag.category}" else if wiki.blank? node["class"] += " dtext-wiki-does-not-exist" @@ -85,8 +87,6 @@ class DText elsif tag.empty? node["class"] += " dtext-tag-empty" node["title"] = "This wiki page does not have a tag" - else - node["class"] += " tag-type-#{tag.category}" end end end