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" %>).

diff --git a/app/views/artist_commentaries/_secondary_links.html.erb b/app/views/artist_commentaries/_secondary_links.html.erb index 5c4c6faa6..fe6c95385 100644 --- a/app/views/artist_commentaries/_secondary_links.html.erb +++ b/app/views/artist_commentaries/_secondary_links.html.erb @@ -4,5 +4,5 @@ <%= subnav_link_to "Listing", artist_commentaries_path %> <%= subnav_link_to "Recent changes", artist_commentary_versions_path %> <%= subnav_link_to "Translation requests", artist_commentaries_path(:search => {:post_tags_match => "commentary_request"}) %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:artist_commentary") %> + <%= subnav_link_to "Help", wiki_page_path("help:artist_commentary") %> <% end %> diff --git a/app/views/comments/_index_by_post.html.erb b/app/views/comments/_index_by_post.html.erb index 78a51234c..c2253bbec 100644 --- a/app/views/comments/_index_by_post.html.erb +++ b/app/views/comments/_index_by_post.html.erb @@ -1,7 +1,7 @@
<% if !CurrentUser.user.is_builder? %>
-

Before commenting, read the <%= link_to "how to comment guide", wiki_pages_path(:search => {:title => "howto:comment"}) %>.

+

Before commenting, read the <%= link_to_wiki "how to comment guide", "howto:comment" %>.

<% end %> diff --git a/app/views/comments/_secondary_links.html.erb b/app/views/comments/_secondary_links.html.erb index 15c2e0281..977536cf4 100644 --- a/app/views/comments/_secondary_links.html.erb +++ b/app/views/comments/_secondary_links.html.erb @@ -2,5 +2,5 @@ <%= quick_search_form_for(:body_matches, comments_path, "comments") %> <%= subnav_link_to "Listing", comments_path(:group_by => "post") %> <%= subnav_link_to "Search", search_comments_path %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:comments") %> + <%= subnav_link_to "Help", wiki_page_path("help:comments") %> <% end %> diff --git a/app/views/dmails/_secondary_links.html.erb b/app/views/dmails/_secondary_links.html.erb index d18fca000..bd73cf9c6 100644 --- a/app/views/dmails/_secondary_links.html.erb +++ b/app/views/dmails/_secondary_links.html.erb @@ -8,5 +8,5 @@ <%= subnav_link_to "New", new_dmail_path %> <%= subnav_link_to "Mark all as read", {:controller => "dmails", :action => "mark_all_as_read"}, :method => :post, :remote => true %>
  • |
  • - <%= subnav_link_to "Help", wiki_pages_path(title: "help:dmail") %> + <%= subnav_link_to "Help", wiki_page_path("help:dmail") %> <% end %> diff --git a/app/views/dtext/_form.html.erb b/app/views/dtext/_form.html.erb index 2fd129d4d..9ec8894ca 100644 --- a/app/views/dtext/_form.html.erb +++ b/app/views/dtext/_form.html.erb @@ -10,5 +10,5 @@ <% end %>
    - All text is formatted using <%= link_to "DText", wiki_pages_path(:title => "help:dtext"), :target => "_blank" %> + All text is formatted using <%= link_to_wiki "DText", "help:dtext" %>
    diff --git a/app/views/favorite_groups/_secondary_links.html.erb b/app/views/favorite_groups/_secondary_links.html.erb index d840809ba..f7c167189 100644 --- a/app/views/favorite_groups/_secondary_links.html.erb +++ b/app/views/favorite_groups/_secondary_links.html.erb @@ -3,7 +3,7 @@ <% if CurrentUser.is_member? %> <%= subnav_link_to "New", new_favorite_group_path %> <% end %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:favorite_groups") %> + <%= subnav_link_to "Help", wiki_page_path("help:favorite_groups") %> <% if @favorite_group && !@favorite_group.new_record? %>
  • |
  • diff --git a/app/views/forum_topics/_secondary_links.html.erb b/app/views/forum_topics/_secondary_links.html.erb index 0a995fd62..d2aacbd89 100644 --- a/app/views/forum_topics/_secondary_links.html.erb +++ b/app/views/forum_topics/_secondary_links.html.erb @@ -14,7 +14,7 @@ <% end %> <%= subnav_link_to "Search", search_forum_posts_path %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:forum") %> + <%= subnav_link_to "Help", wiki_page_path("help:forum") %> <% if CurrentUser.is_member? && @forum_topic && !@forum_topic.new_record? %>
  • |
  • <%= subnav_link_to "Reply", new_forum_post_path(:topic_id => @forum_topic.id) %> diff --git a/app/views/moderator/post/queues/_desc.html.erb b/app/views/moderator/post/queues/_desc.html.erb index 8a2acf543..a9838e3dc 100644 --- a/app/views/moderator/post/queues/_desc.html.erb +++ b/app/views/moderator/post/queues/_desc.html.erb @@ -6,5 +6,5 @@ Posts with score -3 or lower are marked red. Posts with score 3 or higher are marked green.

    -

    Posts with the <%= link_to_wiki(*Danbooru.config.modqueue_quality_warning_tags, last_word_connector: ", or ") %> tags are marked in yellow.

    -

    Posts with the <%= link_to_wiki(*Danbooru.config.modqueue_sample_warning_tags, last_word_connector: ", or ") %> tags are marked in light red.

    +

    Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_quality_warning_tags) %> tags are marked in yellow.

    +

    Posts with the <%= link_to_wikis(*Danbooru.config.modqueue_sample_warning_tags) %> tags are marked in light red.

    diff --git a/app/views/notes/_secondary_links.html.erb b/app/views/notes/_secondary_links.html.erb index e091d2e7d..c3497b7ff 100644 --- a/app/views/notes/_secondary_links.html.erb +++ b/app/views/notes/_secondary_links.html.erb @@ -5,5 +5,5 @@ <%= subnav_link_to "Search", search_notes_path %> <%= subnav_link_to "History", note_versions_path %> <%= subnav_link_to "Requests", posts_path(:tags => "translation_request") %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:notes") %> + <%= subnav_link_to "Help", wiki_page_path("help:notes") %> <% end %> diff --git a/app/views/pools/_secondary_links.html.erb b/app/views/pools/_secondary_links.html.erb index 2ac2dee3e..1ae571893 100644 --- a/app/views/pools/_secondary_links.html.erb +++ b/app/views/pools/_secondary_links.html.erb @@ -3,7 +3,7 @@ <%= subnav_link_to "Gallery", gallery_pools_path %> <%= subnav_link_to "Listing", pools_path %> <%= subnav_link_to "New", new_pool_path %> - <%= subnav_link_to "Help", wiki_pages_path(:search => {:title => "help:pools"}) %> + <%= subnav_link_to "Help", wiki_page_path("help:pools") %> <% if @pool && !@pool.new_record? %>
  • |
  • <%= subnav_link_to "Show", pool_path(@pool) %> diff --git a/app/views/posts/partials/common/_secondary_links.html.erb b/app/views/posts/partials/common/_secondary_links.html.erb index ee3ba3fa2..9c9eda2de 100644 --- a/app/views/posts/partials/common/_secondary_links.html.erb +++ b/app/views/posts/partials/common/_secondary_links.html.erb @@ -14,5 +14,5 @@ <% if CurrentUser.can_approve_posts? %> <%= subnav_link_to "Moderate", moderator_post_queue_path %> <% end %> - <%= subnav_link_to "Help", wiki_pages_path(:title => "help:posts") %> + <%= subnav_link_to "Help", wiki_page_path("help:posts") %> <% end %> diff --git a/app/views/posts/partials/index/_blacklist.html.erb b/app/views/posts/partials/index/_blacklist.html.erb index c3e31625e..0f606cad5 100644 --- a/app/views/posts/partials/index/_blacklist.html.erb +++ b/app/views/posts/partials/index/_blacklist.html.erb @@ -1,5 +1,5 @@