diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6249c8ecd..dc3483426 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,15 +7,24 @@ module ApplicationHelper raw(wordbreaked_string) end - def nav_link_to(text, url, options = nil) + def nav_link_to(text, url, **options) if nav_link_match(params[:controller], url) klass = "current" else klass = nil end - id = "nav-" + text.downcase.gsub(/[^a-z ]/, "").parameterize - tag.li(link_to(text, url, options), class: klass, id: id) + li_link_to(text, url, id_prefix: "nav-", class: klass, **options) + end + + def subnav_link_to(text, url, **options) + li_link_to(text, url, id_prefix: "subnav-", **options) + end + + def li_link_to(text, url, id_prefix: "", **options) + klass = options.delete(:class) + id = id_prefix + text.downcase.gsub(/[^a-z ]/, "").parameterize + tag.li(link_to(text, url, options), id: id, class: klass) end def fast_link_to(text, link_params, options = {}) diff --git a/app/views/artist_commentaries/_secondary_links.html.erb b/app/views/artist_commentaries/_secondary_links.html.erb index b2df444b6..c1fd0226e 100644 --- a/app/views/artist_commentaries/_secondary_links.html.erb +++ b/app/views/artist_commentaries/_secondary_links.html.erb @@ -1,10 +1,10 @@ <% content_for(:secondary_links) do %>
  • <%= render "artist_commentaries/quick_search" %>
  • -
  • <%= link_to "Search", search_artist_commentaries_path %>
  • -
  • <%= link_to "Listing", artist_commentaries_path %>
  • -
  • <%= link_to "Recent changes", artist_commentary_versions_path %>
  • -
  • <%= link_to "Translation requests", artist_commentaries_path(:search => {:post_tags_match => "commentary_request"}) %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:artist_commentary") %>
  • + <%= subnav_link_to "Search", search_artist_commentaries_path %> + <%= 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") %>
    <% end %> diff --git a/app/views/artist_versions/_secondary_links.html.erb b/app/views/artist_versions/_secondary_links.html.erb index ccd6c1fcd..a56a64e7f 100644 --- a/app/views/artist_versions/_secondary_links.html.erb +++ b/app/views/artist_versions/_secondary_links.html.erb @@ -1,7 +1,7 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", artists_path %>
  • -
  • <%= link_to "New", new_artist_path %>
  • -
  • <%= link_to "Search", search_artist_versions_path %>
  • + <%= subnav_link_to "Listing", artists_path %> + <%= subnav_link_to "New", new_artist_path %> + <%= subnav_link_to "Search", search_artist_versions_path %>
    <% end %> diff --git a/app/views/artists/_secondary_links.html.erb b/app/views/artists/_secondary_links.html.erb index f375ff65d..a814d6d02 100644 --- a/app/views/artists/_secondary_links.html.erb +++ b/app/views/artists/_secondary_links.html.erb @@ -1,31 +1,31 @@ <% content_for(:secondary_links) do %>
  • <%= render "artists/quick_search" %>
  • -
  • <%= link_to "Listing", artists_path %>
  • -
  • <%= link_to "Banned", banned_artists_path %>
  • -
  • <%= link_to "New", new_artist_path %>
  • -
  • <%= link_to "Recent changes", artist_versions_path %>
  • + <%= subnav_link_to "Listing", artists_path %> + <%= subnav_link_to "Banned", banned_artists_path %> + <%= subnav_link_to "New", new_artist_path %> + <%= subnav_link_to "Recent changes", artist_versions_path %> <% if @artist && !@artist.new_record? %>
  • |
  • -
  • <%= link_to "Posts (#{Post.fast_count(@artist.name)})", posts_path(:tags => @artist.name) %>
  • -
  • <%= link_to "Show", artist_path(@artist) %>
  • + <%= subnav_link_to "Posts (#{Post.fast_count(@artist.name)})", posts_path(:tags => @artist.name) %> + <%= subnav_link_to "Show", artist_path(@artist) %> <% if CurrentUser.is_member? %> -
  • <%= link_to "Edit", edit_artist_path(@artist), :"data-shortcut" => "e" %>
  • + <%= subnav_link_to "Edit", edit_artist_path(@artist), :"data-shortcut" => "e" %> <% end %> -
  • <%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %>
  • + <%= subnav_link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %> <% if @artist.deletable_by?(CurrentUser.user) %> <% if @artist.is_active? %> -
  • <%= link_to "Delete", artist_path(@artist), method: :delete, "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to delete this artist?" %>
  • + <%= subnav_link_to "Delete", artist_path(@artist), method: :delete, "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to delete this artist?" %> <% else %> -
  • <%= link_to "Undelete", artist_path(@artist, format: "js"), method: :put, data: {confirm: "Are you sure you want to undelete this artist?", params: "artist[is_active]=true"}, remote: true %>
  • + <%= subnav_link_to "Undelete", artist_path(@artist, format: "js"), method: :put, data: {confirm: "Are you sure you want to undelete this artist?", params: "artist[is_active]=true"}, remote: true %> <% end %> <% end %> <% if CurrentUser.is_admin? %> <% if @artist.is_banned? %> -
  • <%= link_to "Unban", unban_artist_path(@artist), :method => :put, :data => {:confirm => "Are you sure you want to unban this artist?"} %>
  • + <%= subnav_link_to "Unban", unban_artist_path(@artist), :method => :put, :data => {:confirm => "Are you sure you want to unban this artist?"} %> <% else %> -
  • <%= link_to "Ban", ban_artist_path(@artist), :method => :put, :data => {:confirm => "Are you sure you want to ban this artist?"} %>
  • + <%= subnav_link_to "Ban", ban_artist_path(@artist), :method => :put, :data => {:confirm => "Are you sure you want to ban this artist?"} %> <% end %> <% end %> <% end %> diff --git a/app/views/bans/_secondary_links.html.erb b/app/views/bans/_secondary_links.html.erb index 1dbfe0946..3650d62af 100644 --- a/app/views/bans/_secondary_links.html.erb +++ b/app/views/bans/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", bans_path %>
  • -
  • <%= link_to "Ban", new_ban_path %>
  • + <%= subnav_link_to "Listing", bans_path %> + <%= subnav_link_to "Ban", new_ban_path %>
    <% end %> diff --git a/app/views/bulk_update_requests/_secondary_links.html.erb b/app/views/bulk_update_requests/_secondary_links.html.erb index daac32ee4..4df23561f 100644 --- a/app/views/bulk_update_requests/_secondary_links.html.erb +++ b/app/views/bulk_update_requests/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", bulk_update_requests_path %>
  • -
  • <%= link_to "New", new_bulk_update_request_path %>
  • + <%= subnav_link_to "Listing", bulk_update_requests_path %> + <%= subnav_link_to "New", new_bulk_update_request_path %>
    <% end %> diff --git a/app/views/comments/_secondary_links.html.erb b/app/views/comments/_secondary_links.html.erb index 05a172767..5c7dd45c5 100644 --- a/app/views/comments/_secondary_links.html.erb +++ b/app/views/comments/_secondary_links.html.erb @@ -1,8 +1,8 @@ <% content_for(:secondary_links) do %>
  • <%= render "comments/quick_search" %>
  • -
  • <%= link_to "Listing", comments_path(:group_by => "post") %>
  • -
  • <%= link_to "Search", search_comments_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help: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") %>
    <% end %> diff --git a/app/views/dmails/_secondary_links.html.erb b/app/views/dmails/_secondary_links.html.erb index c1f3debb5..43a70e0a3 100644 --- a/app/views/dmails/_secondary_links.html.erb +++ b/app/views/dmails/_secondary_links.html.erb @@ -1,14 +1,14 @@ <% content_for(:secondary_links) do %>
  • <%= render "quick_search" %>
  • -
  • <%= link_to "All", all_dmails_path(set_default_folder: true) %>
  • -
  • <%= link_to "Received", received_dmails_path(set_default_folder: true) %>
  • -
  • <%= link_to "Sent", sent_dmails_path(set_default_folder: true) %>
  • -
  • <%= link_to "Spam", spam_dmails_path %>
  • + <%= subnav_link_to "All", all_dmails_path(set_default_folder: true) %> + <%= subnav_link_to "Received", received_dmails_path(set_default_folder: true) %> + <%= subnav_link_to "Sent", sent_dmails_path(set_default_folder: true) %> + <%= subnav_link_to "Spam", spam_dmails_path %>
  • |
  • -
  • <%= link_to "New", new_dmail_path %>
  • -
  • <%= link_to "Mark all as read", {:controller => "dmails", :action => "mark_all_as_read"}, :method => :post, :remote => true %>
  • + <%= 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 %>
  • |
  • -
  • <%= link_to "Help", wiki_pages_path(title: "help:dmail") %>
  • + <%= subnav_link_to "Help", wiki_pages_path(title: "help:dmail") %>
    <% end %> diff --git a/app/views/favorite_groups/_secondary_links.html.erb b/app/views/favorite_groups/_secondary_links.html.erb index 0a835216a..f3df55d68 100644 --- a/app/views/favorite_groups/_secondary_links.html.erb +++ b/app/views/favorite_groups/_secondary_links.html.erb @@ -1,20 +1,20 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", favorite_groups_path %>
  • + <%= subnav_link_to "Listing", favorite_groups_path %> <% if CurrentUser.is_member? %> -
  • <%= link_to "New", new_favorite_group_path %>
  • + <%= subnav_link_to "New", new_favorite_group_path %> <% end %> -
  • <%= link_to "Help", wiki_pages_path(:title => "help:favorite_groups") %>
  • + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:favorite_groups") %> <% if @favorite_group && !@favorite_group.new_record? %>
  • |
  • -
  • <%= link_to "Show", favorite_group_path(@favorite_group) %>
  • -
  • <%= link_to "Posts", posts_path(:tags => "favgroup:#{@favorite_group.id}") %>
  • + <%= subnav_link_to "Show", favorite_group_path(@favorite_group) %> + <%= subnav_link_to "Posts", posts_path(:tags => "favgroup:#{@favorite_group.id}") %> <% if @favorite_group.editable_by?(CurrentUser.user) %> -
  • <%= link_to "Edit", edit_favorite_group_path(@favorite_group) %>
  • -
  • <%= link_to "Delete", favorite_group_path(@favorite_group), :method => :delete, :data => {:confirm => "Are you sure you want to delete this favorite group?"} %>
  • + <%= subnav_link_to "Edit", edit_favorite_group_path(@favorite_group) %> + <%= subnav_link_to "Delete", favorite_group_path(@favorite_group), :method => :delete, :data => {:confirm => "Are you sure you want to delete this favorite group?"} %> <% if @favorite_group.post_count <= 100 %> -
  • <%= link_to "Order", edit_favorite_group_order_path(@favorite_group) %>
  • + <%= subnav_link_to "Order", edit_favorite_group_order_path(@favorite_group) %> <% end %> <% end %> <% end %> diff --git a/app/views/forum_topics/_secondary_links.html.erb b/app/views/forum_topics/_secondary_links.html.erb index 4d727ba64..de0f0399f 100644 --- a/app/views/forum_topics/_secondary_links.html.erb +++ b/app/views/forum_topics/_secondary_links.html.erb @@ -1,44 +1,44 @@ <% content_for(:secondary_links) do %>
  • <%= render "forum_posts/quick_search" %>
  • -
  • <%= link_to "Listing", forum_topics_path %>
  • + <%= subnav_link_to "Listing", forum_topics_path %> <% if CurrentUser.is_member? %> -
  • <%= link_to "New", new_forum_topic_path %>
  • -
  • <%= link_to "Request alias", new_tag_alias_request_path %>
  • -
  • <%= link_to "Request implication", new_tag_implication_request_path %>
  • -
  • <%= link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post, :"data-shortcut" => "shift+r" %>
  • + <%= subnav_link_to "New", new_forum_topic_path %> + <%= subnav_link_to "Request alias", new_tag_alias_request_path %> + <%= subnav_link_to "Request implication", new_tag_implication_request_path %> + <%= subnav_link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post, :"data-shortcut" => "shift+r" %> <% end %> -
  • <%= link_to "Search", search_forum_posts_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:forum") %>
  • + <%= subnav_link_to "Search", search_forum_posts_path %> + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:forum") %> <% if CurrentUser.is_member? && @forum_topic && !@forum_topic.new_record? %>
  • |
  • -
  • <%= link_to "Reply", new_forum_post_path(:topic_id => @forum_topic.id) %>
  • + <%= subnav_link_to "Reply", new_forum_post_path(:topic_id => @forum_topic.id) %> <% if @forum_topic.user_subscription(CurrentUser.user) %> -
  • <%= link_to "Unsubscribe", unsubscribe_forum_topic_path(@forum_topic), :method => :post %>
  • + <%= subnav_link_to "Unsubscribe", unsubscribe_forum_topic_path(@forum_topic), :method => :post %> <% else %> -
  • <%= link_to "Subscribe", subscribe_forum_topic_path(@forum_topic), :method => :post, :data => {:confirm => "Are you sure you want to receive email notifications for this forum topic?"} %>
  • + <%= subnav_link_to "Subscribe", subscribe_forum_topic_path(@forum_topic), :method => :post, :data => {:confirm => "Are you sure you want to receive email notifications for this forum topic?"} %> <% end %> <% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %> -
  • <%= link_to "Edit", edit_forum_topic_path(@forum_topic), "data-shortcut": "e" %>
  • + <%= subnav_link_to "Edit", edit_forum_topic_path(@forum_topic), "data-shortcut": "e" %> <% if CurrentUser.is_moderator? %> <% if @forum_topic.is_deleted? %> -
  • <%= link_to "Undelete", undelete_forum_topic_path(@forum_topic), :method => :post %>
  • + <%= subnav_link_to "Undelete", undelete_forum_topic_path(@forum_topic), :method => :post %> <% else %> -
  • <%= link_to "Delete", forum_topic_path(@forum_topic), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this forum topic?" %>
  • + <%= subnav_link_to "Delete", forum_topic_path(@forum_topic), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this forum topic?" %> <% end %> <% if @forum_topic.is_locked? %> -
  • <%= link_to "Unlock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => false}), :method => :put %>
  • + <%= subnav_link_to "Unlock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => false}), :method => :put %> <% else %> -
  • <%= link_to "Lock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => true}), :method => :put, :data => {:confirm => "Are you sure you want to lock this forum topic?"} %>
  • + <%= subnav_link_to "Lock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => true}), :method => :put, :data => {:confirm => "Are you sure you want to lock this forum topic?"} %> <% end %> <% if @forum_topic.is_sticky? %> -
  • <%= link_to "Unsticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => false}), :method => :put %>
  • + <%= subnav_link_to "Unsticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => false}), :method => :put %> <% else %> -
  • <%= link_to "Sticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => true}), :method => :put, :data => {:confirm => "Are you sure you want to sticky this forum topic?"} %>
  • + <%= subnav_link_to "Sticky", forum_topic_path(@forum_topic, :forum_topic => {:is_sticky => true}), :method => :put, :data => {:confirm => "Are you sure you want to sticky this forum topic?"} %> <% end %> -
  • <%= link_to "Merge", new_merge_forum_topic_path(@forum_topic) %>
  • + <%= subnav_link_to "Merge", new_merge_forum_topic_path(@forum_topic) %> <% end %> <% end %> <% end %> diff --git a/app/views/ip_bans/_secondary_links.html.erb b/app/views/ip_bans/_secondary_links.html.erb index 97c912c65..4548ebfb3 100644 --- a/app/views/ip_bans/_secondary_links.html.erb +++ b/app/views/ip_bans/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", ip_bans_path %>
  • -
  • <%= link_to "New", new_ip_ban_path %>
  • + <%= subnav_link_to "Listing", ip_bans_path %> + <%= subnav_link_to "New", new_ip_ban_path %>
    <% end %> diff --git a/app/views/janitor_trials/_secondary_links.html.erb b/app/views/janitor_trials/_secondary_links.html.erb index 3a4492509..a8e405926 100644 --- a/app/views/janitor_trials/_secondary_links.html.erb +++ b/app/views/janitor_trials/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", janitor_trials_path %>
  • -
  • <%= link_to "New", new_janitor_trial_path %>
  • + <%= subnav_link_to "Listing", janitor_trials_path %> + <%= subnav_link_to "New", new_janitor_trial_path %>
    <% end %> diff --git a/app/views/news_updates/_secondary_links.html.erb b/app/views/news_updates/_secondary_links.html.erb index 8cfce2174..d9b8c75e1 100644 --- a/app/views/news_updates/_secondary_links.html.erb +++ b/app/views/news_updates/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", news_updates_path %>
  • -
  • <%= link_to "New", new_news_update_path %>
  • + <%= subnav_link_to "Listing", news_updates_path %> + <%= subnav_link_to "New", new_news_update_path %>
    <% end %> diff --git a/app/views/notes/_secondary_links.html.erb b/app/views/notes/_secondary_links.html.erb index 27ea91845..c5af37b9a 100644 --- a/app/views/notes/_secondary_links.html.erb +++ b/app/views/notes/_secondary_links.html.erb @@ -1,11 +1,11 @@ <% content_for(:secondary_links) do %>
  • <%= render "notes/quick_search" %>
  • -
  • <%= link_to "Listing", notes_path %>
  • -
  • <%= link_to "Posts", posts_path(:tags => "order:note") %>
  • -
  • <%= link_to "Search", search_notes_path %>
  • -
  • <%= link_to "History", note_versions_path %>
  • -
  • <%= link_to "Requests", posts_path(:tags => "translation_request") %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:notes") %>
  • + <%= subnav_link_to "Listing", notes_path %> + <%= subnav_link_to "Posts", posts_path(:tags => "order:note") %> + <%= 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") %>
    <% end %> diff --git a/app/views/pools/_secondary_links.html.erb b/app/views/pools/_secondary_links.html.erb index ac2272b4c..13df4cc1b 100644 --- a/app/views/pools/_secondary_links.html.erb +++ b/app/views/pools/_secondary_links.html.erb @@ -1,29 +1,29 @@ <% content_for(:secondary_links) do %>
  • <%= render "pools/quick_search" %>
  • -
  • <%= link_to "Gallery", gallery_pools_path %>
  • -
  • <%= link_to "Listing", pools_path %>
  • -
  • <%= link_to "New", new_pool_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:search => {:title => "help:pools"}) %>
  • + <%= 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"}) %> <% if @pool && !@pool.new_record? %>
  • |
  • -
  • <%= link_to "Show", pool_path(@pool) %>
  • -
  • <%= link_to "Posts", posts_path(:tags => "pool:#{@pool.id}") %>
  • + <%= subnav_link_to "Show", pool_path(@pool) %> + <%= subnav_link_to "Posts", posts_path(:tags => "pool:#{@pool.id}") %> <% if CurrentUser.is_member? %> -
  • <%= link_to "Edit", edit_pool_path(@pool), "data-shortcut": "e" %>
  • + <%= subnav_link_to "Edit", edit_pool_path(@pool), "data-shortcut": "e" %> <% end %> <% if @pool.deletable_by?(CurrentUser.user) %> <% if @pool.is_deleted? %> -
  • <%= link_to "Undelete", undelete_pool_path(@pool), :method => :post, :remote => true %>
  • + <%= subnav_link_to "Undelete", undelete_pool_path(@pool), :method => :post, :remote => true %> <% else %> -
  • <%= link_to "Delete", pool_path(@pool), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this pool?", :remote => true %>
  • + <%= subnav_link_to "Delete", pool_path(@pool), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this pool?", :remote => true %> <% end %> <% end %> <% if PoolArchive.enabled? %> -
  • <%= link_to "History", pool_versions_path(:search => {:pool_id => @pool.id}) %>
  • + <%= subnav_link_to "History", pool_versions_path(:search => {:pool_id => @pool.id}) %> <% end %> <% if @pool.post_count <= 100 && CurrentUser.is_member? %> -
  • <%= link_to "Order", edit_pool_order_path(@pool) %>
  • + <%= subnav_link_to "Order", edit_pool_order_path(@pool) %> <% end %> <% end %>
    diff --git a/app/views/post_versions/_secondary_links.html.erb b/app/views/post_versions/_secondary_links.html.erb index 3fc65c84a..135a7cc7f 100644 --- a/app/views/post_versions/_secondary_links.html.erb +++ b/app/views/post_versions/_secondary_links.html.erb @@ -1,9 +1,9 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", posts_path %>
  • -
  • <%= link_to "Upload", new_upload_path %>
  • -
  • <%= link_to "Search", search_post_versions_path %>
  • -
  • <%= link_to "Changes", post_versions_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:posts") %>
  • + <%= subnav_link_to "Listing", posts_path %> + <%= subnav_link_to "Upload", new_upload_path %> + <%= subnav_link_to "Search", search_post_versions_path %> + <%= subnav_link_to "Changes", post_versions_path %> + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:posts") %>
    <% end %> diff --git a/app/views/posts/partials/common/_secondary_links.html.erb b/app/views/posts/partials/common/_secondary_links.html.erb index e8fb0cac8..c1677c04c 100644 --- a/app/views/posts/partials/common/_secondary_links.html.erb +++ b/app/views/posts/partials/common/_secondary_links.html.erb @@ -1,22 +1,22 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", posts_path %>
  • - - + <%= subnav_link_to "Listing", posts_path %> + <%= subnav_link_to "Upload", new_upload_path %> + <%= subnav_link_to "Hot", posts_path(:tags => "order:rank", :d => "1") %> <% if RecommenderService.available_for_user? %> -
  • <%= link_to "Recommended", recommended_posts_path(context: "user") %>
  • + <%= subnav_link_to "Recommended", recommended_posts_path(context: "user") %> <% end %> <% unless CurrentUser.is_anonymous? %> - - + <%= subnav_link_to "Favorites", favorites_path %> + <%= subnav_link_to "Fav groups", favorite_groups_path %> <% if CurrentUser.has_saved_searches? %> - + <%= subnav_link_to "Saved searches", posts_path(:tags => "search:all") %> <% end %> <% end %> - + <%= subnav_link_to "Changes", post_versions_path %> <% if CurrentUser.can_approve_posts? %> - + <%= subnav_link_to "Moderate", moderator_post_queue_path %> <% end %> - + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:posts") %>
    <% end %> diff --git a/app/views/saved_searches/_secondary_links.html.erb b/app/views/saved_searches/_secondary_links.html.erb index 0b221881e..bb256851b 100644 --- a/app/views/saved_searches/_secondary_links.html.erb +++ b/app/views/saved_searches/_secondary_links.html.erb @@ -1,6 +1,6 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "View posts", posts_path(:tags => "search:all") %>
  • -
  • <%= link_to "Manage saved searches", saved_searches_path %>
  • + <%= subnav_link_to "View posts", posts_path(:tags => "search:all") %> + <%= subnav_link_to "Manage saved searches", saved_searches_path %>
    <% end %> diff --git a/app/views/sessions/_secondary_links.html.erb b/app/views/sessions/_secondary_links.html.erb index cdcc4365a..5fc14e383 100644 --- a/app/views/sessions/_secondary_links.html.erb +++ b/app/views/sessions/_secondary_links.html.erb @@ -1,7 +1,7 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Sign up", new_user_path %>
  • -
  • <%= link_to "Reset Password", new_maintenance_user_password_reset_path %>
  • -
  • <%= link_to "Login Reminder", new_maintenance_user_login_reminder_path %>
  • + <%= subnav_link_to "Sign up", new_user_path %> + <%= subnav_link_to "Reset Password", new_maintenance_user_password_reset_path %> + <%= subnav_link_to "Login Reminder", new_maintenance_user_login_reminder_path %>
    <% end %> diff --git a/app/views/tag_aliases/_secondary_links.html.erb b/app/views/tag_aliases/_secondary_links.html.erb index ba769bd27..03310c095 100644 --- a/app/views/tag_aliases/_secondary_links.html.erb +++ b/app/views/tag_aliases/_secondary_links.html.erb @@ -1,9 +1,9 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", tag_aliases_path %>
  • -
  • <%= link_to "MetaSearch", meta_searches_tags_path %>
  • -
  • <%= link_to "Request alias", new_tag_alias_request_path %>
  • -
  • <%= link_to "Request bulk update", new_bulk_update_request_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:tag_aliases") %>
  • + <%= subnav_link_to "Listing", tag_aliases_path %> + <%= subnav_link_to "MetaSearch", meta_searches_tags_path %> + <%= subnav_link_to "Request alias", new_tag_alias_request_path %> + <%= subnav_link_to "Request bulk update", new_bulk_update_request_path %> + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:tag_aliases") %>
    <% end %> diff --git a/app/views/tag_implications/_secondary_links.html.erb b/app/views/tag_implications/_secondary_links.html.erb index 1a1d65472..7fe94b213 100644 --- a/app/views/tag_implications/_secondary_links.html.erb +++ b/app/views/tag_implications/_secondary_links.html.erb @@ -1,9 +1,9 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", tag_implications_path %>
  • -
  • <%= link_to "MetaSearch", meta_searches_tags_path %>
  • -
  • <%= link_to "Request implication", new_tag_implication_request_path %>
  • -
  • <%= link_to "Request bulk update", new_bulk_update_request_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:title => "help:tag_implications") %>
  • + <%= subnav_link_to "Listing", tag_implications_path %> + <%= subnav_link_to "MetaSearch", meta_searches_tags_path %> + <%= subnav_link_to "Request implication", new_tag_implication_request_path %> + <%= subnav_link_to "Request bulk update", new_bulk_update_request_path %> + <%= subnav_link_to "Help", wiki_pages_path(:title => "help:tag_implications") %>
    <% end %> diff --git a/app/views/tags/_secondary_links.html.erb b/app/views/tags/_secondary_links.html.erb index 9db33e1cc..2069a83a0 100644 --- a/app/views/tags/_secondary_links.html.erb +++ b/app/views/tags/_secondary_links.html.erb @@ -1,17 +1,17 @@ <% content_for(:secondary_links) do %>
  • <%= render "tags/quick_search" %>
  • -
  • <%= link_to "Listing", tags_path %>
  • -
  • <%= link_to "MetaSearch", meta_searches_tags_path %>
  • -
  • <%= link_to "Related tags", related_tag_path %>
  • -
  • <%= link_to "Cheatsheet", wiki_pages_path(:search => {:title => "help:cheatsheet"}) %>
  • -
  • <%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %>
  • + <%= subnav_link_to "Listing", tags_path %> + <%= subnav_link_to "MetaSearch", meta_searches_tags_path %> + <%= subnav_link_to "Related tags", related_tag_path %> + <%= subnav_link_to "Cheatsheet", wiki_pages_path(:search => {:title => "help:cheatsheet"}) %> + <%= subnav_link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %> <% if @tag %>
  • |
  • -
  • <%= link_to "Posts (#{Post.fast_count(@tag.name)})", posts_path(:tags => @tag.name) %>
  • -
  • <%= link_to "Edit", edit_tag_path(@tag) %>
  • + <%= subnav_link_to "Posts (#{Post.fast_count(@tag.name)})", posts_path(:tags => @tag.name) %> + <%= subnav_link_to "Edit", edit_tag_path(@tag) %> <% if @tag.post_count < 1_000 %> -
  • <%= link_to "Fix", new_tag_correction_path(:tag_id => @tag.id) %>
  • + <%= subnav_link_to "Fix", new_tag_correction_path(:tag_id => @tag.id) %> <% end %> <% end %>
    diff --git a/app/views/uploads/_secondary_links.html.erb b/app/views/uploads/_secondary_links.html.erb index 678134ae3..3f5668e17 100644 --- a/app/views/uploads/_secondary_links.html.erb +++ b/app/views/uploads/_secondary_links.html.erb @@ -1,9 +1,9 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", uploads_path %>
  • -
  • <%= link_to "New", new_upload_path %>
  • -
  • <%= link_to "Batch Upload", batch_uploads_path %>
  • -
  • <%= link_to "Similar Images Search", iqdb_queries_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(search: { title: "help:upload" }) %>
  • + <%= subnav_link_to "Listing", uploads_path %> + <%= subnav_link_to "New", new_upload_path %> + <%= subnav_link_to "Batch Upload", batch_uploads_path %> + <%= subnav_link_to "Similar Images Search", iqdb_queries_path %> + <%= subnav_link_to "Help", wiki_pages_path(search: { title: "help:upload" }) %>
    <% end %> diff --git a/app/views/user_feedbacks/_secondary_links.html.erb b/app/views/user_feedbacks/_secondary_links.html.erb index 4de817ed8..ef3ac9831 100644 --- a/app/views/user_feedbacks/_secondary_links.html.erb +++ b/app/views/user_feedbacks/_secondary_links.html.erb @@ -2,14 +2,14 @@ <% if CurrentUser.is_gold? %> <% if @user_feedback %> -
  • <%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => @user_feedback.user_id}) %>
  • + <%= subnav_link_to "New", new_user_feedback_path(:user_feedback => {:user_id => @user_feedback.user_id}) %> <% elsif params[:search] && params[:search][:user_id] %> -
  • <%= link_to "New", new_user_feedback_path(:user_feedback => {:user_id => params[:search][:user_id]}) %>
  • + <%= subnav_link_to "New", new_user_feedback_path(:user_feedback => {:user_id => params[:search][:user_id]}) %> <% else %> -
  • <%= link_to "New", new_user_feedback_path %>
  • + <%= subnav_link_to "New", new_user_feedback_path %> <% end %> <% end %> -
  • <%= link_to "Listing", user_feedbacks_path %>
  • -
  • <%= link_to "Search", search_user_feedbacks_path %>
  • + <%= subnav_link_to "Listing", user_feedbacks_path %> + <%= subnav_link_to "Search", search_user_feedbacks_path %>
    <% end %> diff --git a/app/views/user_name_change_requests/_secondary_links.html.erb b/app/views/user_name_change_requests/_secondary_links.html.erb index 36fb8c1de..5e839727a 100644 --- a/app/views/user_name_change_requests/_secondary_links.html.erb +++ b/app/views/user_name_change_requests/_secondary_links.html.erb @@ -1,7 +1,7 @@ <% content_for(:secondary_links) do %> -
  • <%= link_to "Listing", user_name_change_requests_path %>
  • -
  • <%= link_to "New", new_user_name_change_request_path %>
  • -
  • <%= link_to "Help", wiki_pages_path(:search => {:title => "help:user_name_change_requests"}) %>
  • + <%= subnav_link_to "Listing", user_name_change_requests_path %> + <%= subnav_link_to "New", new_user_name_change_request_path %> + <%= subnav_link_to "Help", wiki_pages_path(:search => {:title => "help:user_name_change_requests"}) %>
    <% end %> diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb index 2383a7635..c0f8a4e5f 100644 --- a/app/views/users/_secondary_links.html.erb +++ b/app/views/users/_secondary_links.html.erb @@ -1,41 +1,41 @@ <% content_for(:secondary_links) do %>
  • <%= render "users/quick_search" %>
  • -
  • <%= link_to "Listing", users_path %>
  • -
  • <%= link_to "Search", search_users_path %>
  • + <%= subnav_link_to "Listing", users_path %> + <%= subnav_link_to "Search", search_users_path %> <% if CurrentUser.user.is_anonymous? %> -
  • <%= link_to "Sign up", new_user_path %>
  • + <%= subnav_link_to "Sign up", new_user_path %> <% end %> <% if @user && !@user.new_record? && !CurrentUser.user.is_anonymous? %>
  • |
  • <% if @user.id == CurrentUser.user.id %> -
  • <%= link_to "Settings", edit_user_path(CurrentUser.user) %>
  • -
  • <%= link_to "Profile", user_path(CurrentUser.user) %>
  • -
  • <%= link_to "Messages #{CurrentUser.user.dmail_count}", dmails_current_folder_path %>
  • + <%= subnav_link_to "Settings", edit_user_path(CurrentUser.user) %> + <%= subnav_link_to "Profile", user_path(CurrentUser.user) %> + <%= subnav_link_to "Messages #{CurrentUser.user.dmail_count}", dmails_current_folder_path %> <% if !@user.is_platinum? %> -
  • <%= link_to "Upgrade", new_user_upgrade_path %>
  • + <%= subnav_link_to "Upgrade", new_user_upgrade_path %> <% end %> <% else %> -
  • <%= link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %>
  • + <%= subnav_link_to "Send message", new_dmail_path(:dmail => {:to_id => @user.id}) %> <% if !@user.is_platinum? %> -
  • <%= link_to "Gift upgrade", new_user_upgrade_path(:user_id => @user.id) %>
  • + <%= subnav_link_to "Gift upgrade", new_user_upgrade_path(:user_id => @user.id) %> <% end %> <% end %> <% if CurrentUser.user.is_moderator? %> -
  • <%= link_to "Promote", edit_admin_user_path(@user) %>
  • + <%= subnav_link_to "Promote", edit_admin_user_path(@user) %> <% if @user.is_banned? %> -
  • <%= link_to "Unban", ban_path(@user.recent_ban) %>
  • + <%= subnav_link_to "Unban", ban_path(@user.recent_ban) %> <% else %> -
  • <%= link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %>
  • + <%= subnav_link_to "Ban", new_ban_path(:ban => {:user_id => @user.id}) %> <% end %> <% end %>
  • |
  • -
  • <%= link_to "Sign out", sign_out_session_path %>
  • + <%= subnav_link_to "Sign out", sign_out_session_path %> <% end %>
    <% end %> diff --git a/app/views/wiki_pages/_secondary_links.html.erb b/app/views/wiki_pages/_secondary_links.html.erb index 5cefde78f..0002d3f99 100644 --- a/app/views/wiki_pages/_secondary_links.html.erb +++ b/app/views/wiki_pages/_secondary_links.html.erb @@ -1,33 +1,33 @@ <% content_for(:secondary_links) do %>
  • <%= render "wiki_pages/quick_search" %>
  • -
  • <%= link_to "Listing", wiki_pages_path %>
  • -
  • <%= link_to "Search", search_wiki_pages_path %>
  • + <%= subnav_link_to "Listing", wiki_pages_path %> + <%= subnav_link_to "Search", search_wiki_pages_path %> <% if CurrentUser.is_member? %> -
  • <%= link_to "New", new_wiki_page_path %>
  • + <%= subnav_link_to "New", new_wiki_page_path %> <% end %> -
  • <%= link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %>
  • + <%= subnav_link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %> <% if @wiki_page && @wiki_page.new_record? && @wiki_page.try(:tag).present? %>
  • |
  • -
  • <%= link_to "Posts (#{@wiki_page.tag.post_count})", posts_path(:tags => @wiki_page.title) %>
  • + <%= subnav_link_to "Posts (#{@wiki_page.tag.post_count})", posts_path(:tags => @wiki_page.title) %> <% elsif @wiki_page && !@wiki_page.new_record? %>
  • |
  • -
  • <%= link_to "Posts (#{@wiki_page.tag.try(:post_count) || 0})", posts_path(:tags => @wiki_page.title) %>
  • -
  • <%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %>
  • + <%= subnav_link_to "Posts (#{@wiki_page.tag.try(:post_count) || 0})", posts_path(:tags => @wiki_page.title) %> + <%= subnav_link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %> <% if CurrentUser.is_member? %> -
  • <%= link_to "Edit", edit_wiki_page_path(@wiki_page), "data-shortcut": "e" %>
  • + <%= subnav_link_to "Edit", edit_wiki_page_path(@wiki_page), "data-shortcut": "e" %> <% end %> <% if CurrentUser.is_builder? && !@wiki_page.is_deleted? %> -
  • <%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this wiki page?" %>
  • + <%= subnav_link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this wiki page?" %> <% end %> <% elsif @wiki_page_version %>
  • |
  • -
  • <%= link_to "Newest", wiki_page_path(@wiki_page_version.wiki_page_id) %>
  • + <%= subnav_link_to "Newest", wiki_page_path(@wiki_page_version.wiki_page_id) %> <% if CurrentUser.is_member? %> -
  • <%= link_to "Revert to", revert_wiki_page_path(@wiki_page_version.wiki_page_id, :version_id => @wiki_page_version.id), :method => :put, :data => {:confirm => "Are you sure you want to revert to this version?"} %>
  • + <%= subnav_link_to "Revert to", revert_wiki_page_path(@wiki_page_version.wiki_page_id, :version_id => @wiki_page_version.id), :method => :put, :data => {:confirm => "Are you sure you want to revert to this version?"} %> <% end %> <% end %>