fixes #2558: site map links

This commit is contained in:
r888888888
2015-12-09 15:45:43 -08:00
parent 75327bf963
commit 3bffc67d5a
3 changed files with 12 additions and 5 deletions

View File

@@ -3,6 +3,10 @@ class SavedSearch < ActiveRecord::Base
extend ActiveSupport::Concern
module ClassMethods
def posts_search_available?
Danbooru.config.listbooru_server.present? && CurrentUser.is_gold?
end
def refresh_listbooru(user_id)
return unless Danbooru.config.listbooru_auth_key
user = User.find(user_id)

View File

@@ -5,7 +5,7 @@
<% @categories.each do |category, saved_searches| %>
<h2>
<% if category.present? %>
<%= link_to category.tr("_", " "), posts_path(:tags => "search:#{category}") %>
<%= link_to_if SavedSearch.posts_search_available?, category.tr("_", " "), posts_path(:tags => "search:#{category}") %>
<% else %>
Uncategorized
<% end %>

View File

@@ -14,7 +14,7 @@
<% if CurrentUser.can_approve_posts? %>
<li><%= link_to("Moderate", moderator_post_queue_path) %></li>
<% end %>
<% if CurrentUser.is_admin? %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
<% end %>
</ul>
@@ -89,7 +89,7 @@
<section>
<ul>
<li><h1>Users</h1></li>
<% if CurrentUser.can_approve_posts? %>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("Dashboard", moderator_dashboard_path) %></li>
<% end %>
<li><%= link_to("Help", wiki_pages_path(:title => "help:users")) %></li>
@@ -109,10 +109,13 @@
<li><%= link_to("Mod Actions", mod_actions_path) %></li>
<li><%= link_to("Jobs", delayed_jobs_path) %></li>
<li><%= link_to("Bulk Update Requests", bulk_update_requests_path) %></li>
<li><%= link_to("Janitor Trials", janitor_trials_path) %></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("IP Bans", ip_bans_path) %></li>
<% end %>
<% if CurrentUser.is_admin? %>
<li><%= link_to("Janitor Trials", janitor_trials_path) %></li>
<li><%= link_to("IP Bans", ip_bans_path) %></li>
<li><%= link_to("News Updates", news_updates_path) %></li>
<li><%= link_to("Alias & Implication Import", new_admin_alias_and_implication_import_path) %></li>
<li><%= link_to("Admin Dashboard", admin_dashboard_path) %></li>