Files
danbooru/app/views/wiki_pages/_secondary_links.html.erb
evazion a5ef86bbe8 views: add html ids for main menu and subnav menu.
Also refactor secondary links to put the <menu> element in the default
layout instead of in each _secondary_links partial.
2019-09-17 00:28:41 -05:00

33 lines
1.9 KiB
Plaintext

<% content_for(:secondary_links) do %>
<%= quick_search_form_for(:title, wiki_pages_path, "wiki pages", autocomplete: "wiki-page") %>
<%= subnav_link_to "Listing", wiki_pages_path %>
<%= subnav_link_to "Search", search_wiki_pages_path %>
<% if CurrentUser.is_member? %>
<%= subnav_link_to "New", new_wiki_page_path %>
<% end %>
<%= subnav_link_to "Help", wiki_pages_path(:search => {:title => "help:wiki"}) %>
<% if @wiki_page && @wiki_page.new_record? && @wiki_page.try(:tag).present? %>
<li>|</li>
<%= subnav_link_to "Posts (#{@wiki_page.tag.post_count})", posts_path(:tags => @wiki_page.title) %>
<% elsif @wiki_page && !@wiki_page.new_record? %>
<li>|</li>
<%= 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? %>
<%= subnav_link_to "Edit", edit_wiki_page_path(@wiki_page), "data-shortcut": "e" %>
<% end %>
<% if CurrentUser.is_builder? && !@wiki_page.is_deleted? %>
<%= 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 %>
<li>|</li>
<%= subnav_link_to "Newest", wiki_page_path(@wiki_page_version.wiki_page_id) %>
<% if @wiki_page_version.previous %>
<%= subnav_link_to "Diff", diff_wiki_page_versions_path(:otherpage => @wiki_page_version.id, :thispage => @wiki_page_version.previous.id) %>
<% end %>
<% if CurrentUser.is_member? %>
<%= 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 %>
<% end %>