diff --git a/app/helpers/artists_helper.rb b/app/helpers/artists_helper.rb index b50241d3a..cc236a4b9 100644 --- a/app/helpers/artists_helper.rb +++ b/app/helpers/artists_helper.rb @@ -1,8 +1,4 @@ module ArtistsHelper - def artist_alias_and_implication_list(artist) - alias_and_implication_list(artist.tag) - end - def link_to_artist(name) artist = Artist.find_by_name(name) diff --git a/app/helpers/forum_post_votes_controller_helper.rb b/app/helpers/forum_post_votes_controller_helper.rb deleted file mode 100644 index e39878914..000000000 --- a/app/helpers/forum_post_votes_controller_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ForumPostVotesControllerHelper -end diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb deleted file mode 100644 index cf2ecc9c7..000000000 --- a/app/helpers/tags_helper.rb +++ /dev/null @@ -1,40 +0,0 @@ -module TagsHelper - def alias_and_implication_list(tag) - return "" if tag.nil? - - html = "" - - if tag.antecedent_alias - html << "
This tag has been aliased to " - html << link_to_wiki(tag.antecedent_alias.consequent_name) - html << " (#{link_to_wiki "learn more", "help:tag_aliases"}).
" - end - - if tag.consequent_aliases.present? - html << "The following tags are aliased to this tag: " - html << raw(tag.consequent_aliases.map {|x| link_to_wiki x.antecedent_name }.join(", ")) - html << " (#{link_to_wiki "learn more", "help:tag_aliases"}).
" - end - - automatic_tags = TagImplication.automatic_tags_for([tag.name]) - if automatic_tags.present? - html << "This tag automatically adds " - html << raw(automatic_tags.map {|x| link_to_wiki x, x }.join(", ")) - html << " (#{link_to_wiki "learn more", "help:autotags"}).
" - end - - if tag.antecedent_implications.present? - html << "This tag implicates " - html << raw(tag.antecedent_implications.map {|x| link_to_wiki x.consequent_name }.join(", ")) - html << " (#{link_to_wiki "learn more", "help:tag_implications"}).
" - end - - if tag.consequent_implications.present? - html << "The following tags implicate this tag: " - html << raw(tag.consequent_implications.map {|x| link_to_wiki x.antecedent_name }.join(", ")) - html << " (#{link_to_wiki "learn more", "help:tag_implications"}).
" - end - - html.html_safe - end -end diff --git a/app/helpers/upload_tags_report_helper.rb b/app/helpers/upload_tags_report_helper.rb deleted file mode 100644 index 76ef3f3b2..000000000 --- a/app/helpers/upload_tags_report_helper.rb +++ /dev/null @@ -1,15 +0,0 @@ -module UploadTagsReportHelper - def diff_to_current(report) - html = '' - - report.added_tags_array.each do |tag| - html << '+' + link_to(wordbreakify(tag), posts_path(:tags => tag)) + '' - end - report.removed_tags_array.each do |tag| - html << '<%= link_to "View wiki", artist.wiki_page %> | @@ -29,7 +29,7 @@ <% end %> <%= format_text(wiki_page.presenter.excerpt) %> - <%= wiki_page_alias_and_implication_list(wiki_page) %> + <%= render "tag_relationships/alias_and_implication_list", tag: wiki_page.tag %>
<%= link_to_wiki "View wiki", wiki_page.title %> @@ -64,7 +64,7 @@ <% if post_set.tag_string.present? %>
There is currently no wiki page for the tag "<%= post_set.tag_string %>". You can <%= link_to "create one", new_wiki_page_path(:wiki_page => {:title => post_set.tag_string}) %>.
- <%= alias_and_implication_list(post_set.tag) %> + <%= render "tag_relationships/alias_and_implication_list", tag: post_set.tag %> <% end %> <% end %>+ This tag has been aliased to <%= link_to_wiki(tag.antecedent_alias.consequent_name) %> + (<%= link_to_wiki "learn more", "help:tag_aliases" %>). +
+<% end %> + +<% if tag.consequent_aliases.present? %> ++ The following tags are aliased to this tag: + <%= to_sentence(tag.consequent_aliases.map { |ta| link_to_wiki ta.antecedent_name }) %> + (<%= link_to_wiki "learn more", "help:tag_aliases" %>). +
+<% end %> + +<% TagImplication.automatic_tags_for([tag.name]).tap do |automatic_tags| %> + <% if automatic_tags.present? %> ++ This tag automatically adds + <%= to_sentence(automatic_tags.map { |tag| link_to_wiki tag }) %> + (<%= link_to_wiki "learn more", "help:autotags" %>). +
+ <% end %> +<% end %> + +<% if tag.antecedent_implications.present? %> ++ This tag implicates + <%= to_sentence(tag.antecedent_implications.map { |ti| link_to_wiki ti.consequent_name }) %> + (<%= link_to_wiki "learn more", "help:tag_implications" %>). +
+<% end %> + +<% if tag.consequent_implications.present? %> ++ The following tags implicate this tag: + <%= to_sentence(tag.consequent_implications.map { |ti| link_to_wiki ti.antecedent_name }) %> + (<%= link_to_wiki "learn more", "help:tag_implications" %>). +
+<% end %> diff --git a/app/views/wiki_pages/_posts.html.erb b/app/views/wiki_pages/_posts.html.erb new file mode 100644 index 000000000..9ff4512c9 --- /dev/null +++ b/app/views/wiki_pages/_posts.html.erb @@ -0,0 +1,7 @@ +<% if wiki_page.tag.present? && wiki_page.tag.post_count > 0 %> +<%= link_to "View artist", @wiki_page.artist %>
<% end %> - <%= wiki_page_alias_and_implication_list(@wiki_page) %> + <%= render "tag_relationships/alias_and_implication_list", tag: @wiki_page.tag %> <% else %>This artist has requested removal of their information.
<% end %> - <%= wiki_page_post_previews(@wiki_page) %> + <%= render "wiki_pages/posts", wiki_page: @wiki_page %> <% end %> <% content_for(:page_title) do %>