diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index 826b3c7f2..104da379b 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -127,25 +127,6 @@ } Danbooru.Post.initialize_nav_help_link = function() { - $("#close-nav-help-link").click(function(e) { - Danbooru.Cookie.put("close-nav-help", "1"); - $("#nav-help").hide(); - e.preventDefault(); - }); - - if (Danbooru.Cookie.get("close-nav-help") === "1") { - $("#nav-help").hide(); - } - - $("#close-search-seq-nav").click(function(e) { - Danbooru.Cookie.put("close-search-seq", "1"); - $("#search-seq-nav").hide(); - e.preventDefault(); - }); - - if (Danbooru.Cookie.get("close-search-seq") === "1") { - $("#search-seq-nav").hide(); - } } Danbooru.Post.initialize_titles = function() { diff --git a/app/assets/stylesheets/specific/posts.css.scss b/app/assets/stylesheets/specific/posts.css.scss index 07dbf0c7a..2d06c6ae5 100644 --- a/app/assets/stylesheets/specific/posts.css.scss +++ b/app/assets/stylesheets/specific/posts.css.scss @@ -231,9 +231,18 @@ div#c-posts { margin: 0 1em; } - #pool-nav, #search-seq-nav, #nav-help { + #nav-links { margin: 1em 0; + padding: 1em 0.5em; + #keyboard-shortcuts-link { + margin-top: 1em; + font-size: 80%; + font-style: italic; + } + } + + #pool-nav, #search-seq-nav, #nav-help { li { position: relative; text-align: center; diff --git a/app/logical/anonymous_user.rb b/app/logical/anonymous_user.rb index 9b56ddac0..3e446ad4e 100644 --- a/app/logical/anonymous_user.rb +++ b/app/logical/anonymous_user.rb @@ -149,6 +149,18 @@ class AnonymousUser 0 end + def enable_post_navigation + true + end + + def new_post_navigation_layout + true + end + + def enable_privacy_mode + false + end + %w(member banned privileged builder platinum contributor janitor moderator admin).each do |name| define_method("is_#{name}?") do false diff --git a/app/models/user.rb b/app/models/user.rb index be66ba8f5..a54ddbd11 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -17,7 +17,7 @@ class User < ActiveRecord::Base end attr_accessor :password, :old_password - attr_accessible :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :as => [:moderator, :janitor, :contributor, :privileged, :member, :anonymous, :default, :builder, :admin] + attr_accessible :enable_privacy_mode, :enable_post_navigation, :new_post_navigation_layout, :password, :old_password, :password_confirmation, :password_hash, :email, :last_logged_in_at, :last_forum_read_at, :has_mail, :receive_email_notifications, :comment_threshold, :always_resize_images, :favorite_tags, :blacklisted_tags, :name, :ip_addr, :time_zone, :default_image_size, :as => [:moderator, :janitor, :contributor, :privileged, :member, :anonymous, :default, :builder, :admin] attr_accessible :level, :as => :admin validates_length_of :name, :within => 2..100, :on => :create validates_format_of :name, :with => /\A[^\s:]+\Z/, :on => :create, :message => "cannot have whitespace or colons" diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 4b5ee7dfa..b276fcd00 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -85,6 +85,10 @@ class PostPresenter < Presenter @tag_set_presenter.split_tag_list_html(template, options.merge(:show_extra_links => CurrentUser.user.is_privileged?)) end + def has_nav_links?(template) + template.params[:tags].present? || @post.pools.active.any? + end + def post_footer_for_pool_html(template) if template.params[:pool_id] pool = Pool.where(:id => template.params[:pool_id]).first diff --git a/app/views/posts/partials/show/_nav_links.html.erb b/app/views/posts/partials/show/_nav_links.html.erb new file mode 100644 index 000000000..214c17973 --- /dev/null +++ b/app/views/posts/partials/show/_nav_links.html.erb @@ -0,0 +1,13 @@ +<% if (position == "bottom" && CurrentUser.user.new_post_navigation_layout) || (position == "top" && !CurrentUser.user.new_post_navigation_layout) %> + +<% end %> diff --git a/app/views/posts/partials/show/_pools.html.erb b/app/views/posts/partials/show/_pools.html.erb index 53aec294c..fb2860a04 100644 --- a/app/views/posts/partials/show/_pools.html.erb +++ b/app/views/posts/partials/show/_pools.html.erb @@ -1,3 +1,3 @@ -