tags: add general?, character?, copyright?, artist?, meta?, empty? helper methods.

This commit is contained in:
evazion
2020-05-10 23:28:07 -05:00
parent 49383d393a
commit e3187e0bd0
11 changed files with 37 additions and 34 deletions

View File

@@ -37,7 +37,7 @@ class DText
tag = tags.find { |tag| tag.name == name }
artist = artists.find { |artist| artist.name == name }
if tag.present? && tag.category == Tag.categories.artist
if tag.present? && tag.artist?
node["href"] = "/artists/show_or_new?name=#{CGI.escape(name)}"
if artist.blank?
@@ -45,7 +45,7 @@ class DText
node["title"] = "This artist page does not exist"
end
node["class"] += " tag-type-#{Tag.categories.artist}"
node["class"] += " tag-type-#{tag.category}"
else
if wiki.blank?
node["class"] += " dtext-wiki-does-not-exist"
@@ -57,7 +57,7 @@ class DText
elsif tag.blank?
node["class"] += " dtext-tag-does-not-exist"
node["title"] = "This wiki page does not have a tag"
elsif tag.post_count <= 0
elsif tag.empty?
node["class"] += " dtext-tag-empty"
node["title"] = "This wiki page does not have a tag"
else