diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e19ce5f1b..32e64f6a4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -103,9 +103,13 @@ module ApplicationHelper link_to search, posts_path(tags: search) end - def link_to_wiki(*wiki_titles, **options) + def link_to_wiki(text, title) + link_to text, wiki_page_path(title) + end + + def link_to_wikis(*wiki_titles, last_word_connector: ", or", **options) links = wiki_titles.map do |title| - link_to title.tr("_", " "), wiki_pages_path(title: title) + link_to title.tr("_", " "), wiki_page_path(title) end to_sentence(links, **options) diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index 2ce2f0143..3bde965c6 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -85,7 +85,7 @@ module PostsHelper html << link_to(text, posts_path(:tags => "parent:#{post.parent_id}")) end - html << " (#{link_to("learn more", wiki_pages_path(:title => "help:post_relationships"))}) " + html << " (#{link_to_wiki "learn more", "help:post_relationships"}) " html << link_to("« hide".html_safe, "#", :id => "has-parent-relationship-preview-link") @@ -99,7 +99,7 @@ module PostsHelper text = children_post_set.children.count == 1 ? "a child" : "#{children_post_set.children.count} children" html << link_to(text, posts_path(:tags => "parent:#{post.id}")) - html << " (#{link_to("learn more", wiki_pages_path(:title => "help:post_relationships"))}) " + html << " (#{link_to_wiki "learn more", "help:post_relationships"}) " html << link_to("« hide".html_safe, "#", :id => "has-children-relationship-preview-link") diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index d0d754482..35fe58b86 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -7,32 +7,32 @@ module TagsHelper if tag.antecedent_alias html << "
This tag has been aliased to " html << link_to(tag.antecedent_alias.consequent_name, show_or_new_wiki_pages_path(:title => tag.antecedent_alias.consequent_name)) - html << " (#{link_to "learn more", wiki_pages_path(title: "help:tag_aliases")}).
" + 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(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name))}.join(", ")) - html << " (#{link_to "learn more", wiki_pages_path(title: "help:tag_aliases")}).
" + 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(x, show_or_new_wiki_pages_path(:title => x))}.join(", ")) - html << " (#{link_to "learn more", wiki_pages_path(title: "help:autotags")}).
" + 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(x.consequent_name, show_or_new_wiki_pages_path(:title => x.consequent_name))}.join(", ")) - html << " (#{link_to "learn more", wiki_pages_path(title: "help:tag_implications")}).
" + 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(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name))}.join(", ")) - html << " (#{link_to "learn more", wiki_pages_path(title: "help:tag_implications")}).
" + html << " (#{link_to_wiki "learn more", "help:tag_implications"})." end html.html_safe diff --git a/app/views/artist_commentaries/_form.html.erb b/app/views/artist_commentaries/_form.html.erb index dee5c5a0a..249962a9e 100644 --- a/app/views/artist_commentaries/_form.html.erb +++ b/app/views/artist_commentaries/_form.html.erb @@ -1,4 +1,4 @@ -If the artist of this image posted some interesting additional information about this work, you can copy it here. <%= link_to "View help.", wiki_pages_path(:search => {:title => "help:artist_commentary"}) %>
+If the artist of this image posted some interesting additional information about this work, you can copy it here (<%= link_to_wiki "learn more", "help:artist_commentary" %>).