diff --git a/app/assets/javascripts/common.js b/app/assets/javascripts/common.js index a978d9431..a46217aa2 100644 --- a/app/assets/javascripts/common.js +++ b/app/assets/javascripts/common.js @@ -16,6 +16,18 @@ $(document).ready(function() { $(this).hide(); }); + // More link + $("#site-map-link").click(function(e) { + $("#more-links").toggle(); + e.preventDefault(); + e.stopPropagation(); + }); + $("#more-links").hide().offset({top: $("#site-map-link").offset().top + $("#site-map-link").height() + 10, left: $("#site-map-link").offset().left}); + + $(document).click(function(e) { + $("#more-links").hide(); + }); + // Ajax links $("a[data-remote=true]").click(function(e) { Danbooru.ajax_start(e.target); diff --git a/app/assets/stylesheets/common/main_layout.css.scss b/app/assets/stylesheets/common/main_layout.css.scss index 4e092c710..7012bb387 100644 --- a/app/assets/stylesheets/common/main_layout.css.scss +++ b/app/assets/stylesheets/common/main_layout.css.scss @@ -48,3 +48,16 @@ footer#page-footer { div.clearfix { clear: both; } + +div#more-links { + z-index: 5000; + position: absolute; + background: white; + border: 1px solid #999; + width: 8em; + line-height: 1.3em; + padding: 0.2em 0.6em; + -moz-box-shadow: 2px 2px 2px #ccc; + -webkit-box-shadow: 2px 2px 2px #ccc; + box-shadow: 2px 2px 2px #ccc; +} diff --git a/app/controllers/tag_implications_controller.rb b/app/controllers/tag_implications_controller.rb index 882e19945..7ff9e910f 100644 --- a/app/controllers/tag_implications_controller.rb +++ b/app/controllers/tag_implications_controller.rb @@ -1,6 +1,5 @@ class TagImplicationsController < ApplicationController - before_filter :admin_only, :only => [:approve, :destroy] - before_filter :member_only, :only => [:create] + before_filter :admin_only, :only => [:new, :create, :approve, :destroy] respond_to :html, :xml, :json, :js def new diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ffe778bb7..4bb0f680f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -82,29 +82,23 @@ protected when "forum_posts" /^\/forum_topics/ - when "uploads" - /^\/post/ - - when "post_versions", "explore/posts" - /^\/post/ - - when "pool_versions" - /^\/pool/ + when "comments" + /^\/comments/ - when "note_versions" - /^\/note/ + when "notes", "note_versions" + /^\/notes/ - when "artist_versions" - /^\/artist/ - - when "moderator/post/dashboards" + when "posts", "uploads", "post_versions", "explore/posts", "moderator/post/dashboards", "favorites", "tag_subscriptions" /^\/post/ - when "moderator/dashboards" - /^\/moderator/ + when "wiki_pages", "wiki_page_versions" + /^\/wiki_pages/ + + when "forum_topics", "forum_posts" + /^\/forum_topics/ else - /^\/#{controller}/ + /^\/static/ end end end diff --git a/app/models/tag_implication.rb b/app/models/tag_implication.rb index 06c56ebff..45b8927ed 100644 --- a/app/models/tag_implication.rb +++ b/app/models/tag_implication.rb @@ -24,9 +24,9 @@ class TagImplication < ActiveRecord::Base until children.empty? all.concat(children) - children = self.class.where(["antecedent_name IN (?) and status = ?", children, "active"]).all.map(&:consequent_name) + children = self.class.where(["antecedent_name IN (?)", children]).all.map(&:consequent_name) end - end + end.sort end end @@ -40,7 +40,7 @@ class TagImplication < ActiveRecord::Base def update_descendant_names! update_descendant_names - save! + update_column(:descendant_names, descendant_names) end def update_descendant_names_for_parent @@ -77,6 +77,7 @@ class TagImplication < ActiveRecord::Base def process! update_column(:status, "processing") + update_descendant_names_for_parent update_posts update_column(:status, "active") rescue Exception => e diff --git a/app/views/layouts/_main_links.html.erb b/app/views/layouts/_main_links.html.erb index 1253e38aa..eb30537b0 100644 --- a/app/views/layouts/_main_links.html.erb +++ b/app/views/layouts/_main_links.html.erb @@ -7,17 +7,7 @@ <%= nav_link_to("Posts", posts_path) %> <%= nav_link_to("Comments", comments_path(:group_by => "post")) %> <%= nav_link_to("Notes", notes_path(:group_by => "post")) %> - <%= nav_link_to("Artists", artists_path(:order => "date")) %> - <%= nav_link_to("Tags", tags_path(:order => "date")) %> - <% if CurrentUser.is_moderator? %> - <%= nav_link_to("Aliases", tag_aliases_path) %> - <%= nav_link_to("Implications", tag_implications_path) %> - <% end %> - <%= nav_link_to("Pools", pools_path) %> <%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %> <%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %> - <% if CurrentUser.is_janitor? %> - <%= nav_link_to("Dashboard", moderator_dashboard_path) %> - <% end %> - <%= nav_link_to("»".html_safe, site_map_path) %> + <%= nav_link_to("»".html_safe, site_map_path, :id => "site-map-link") %> \ No newline at end of file diff --git a/app/views/layouts/_more_links.html.erb b/app/views/layouts/_more_links.html.erb new file mode 100644 index 000000000..9063bd7d1 --- /dev/null +++ b/app/views/layouts/_more_links.html.erb @@ -0,0 +1,14 @@ +