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) %>
+
+ <% if params[:tags].present? && CurrentUser.user.enable_post_navigation && params[:tags] !~ /order:/ %>
+ <%= render "posts/partials/show/search_seq", :post => post %>
+ <% end %>
+
+ <% if post.pools.active.any? %>
+ <%= render "posts/partials/show/pools", :post => post %>
+ <% end %>
+
+
<%= link_to "Keyboard shortcuts available", keyboard_shortcuts_path %>
+
+<% 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 @@
-
+
<%= @post.presenter.pool_html(self) %>
diff --git a/app/views/posts/partials/show/_search_seq.html.erb b/app/views/posts/partials/show/_search_seq.html.erb
index 0f0d75911..073d1564c 100644
--- a/app/views/posts/partials/show/_search_seq.html.erb
+++ b/app/views/posts/partials/show/_search_seq.html.erb
@@ -1,4 +1,4 @@
-
+
-
<%= link_to "«prev".html_safe, show_seq_post_path(post, :tags => params[:tags], :seq => "prev"), :rel => "prev", :class => "prev" %>
@@ -6,6 +6,4 @@
<%= link_to "next»".html_safe, show_seq_post_path(post, :tags => params[:tags], :seq => "next"), :rel => "next", :class => "next" %>
-
-
diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb
index 4a64645c5..839d51b92 100644
--- a/app/views/posts/show.html.erb
+++ b/app/views/posts/show.html.erb
@@ -30,6 +30,10 @@
+ <% if @post.presenter.has_nav_links?(self) %>
+ <%= render "posts/partials/show/nav_links", :post => @post, :position => "top" %>
+ <% end %>
+
<%= render "posts/partials/show/notices", :post => @post %>
<%= render_advertisement("horizontal") %>
@@ -39,16 +43,8 @@
<%= @post.presenter.image_html(self) %>
- <% if params[:tags] || @post.pools.active.any? %>
- <%= render "posts/partials/show/nav_help" %>
- <% end %>
-
- <% if params[:tags] %>
- <%= render "posts/partials/show/search_seq", :post => @post %>
- <% end %>
-
- <% if @post.pools.active.any? %>
- <%= render "posts/partials/show/pools", :post => @post %>
+ <% if @post.presenter.has_nav_links?(self) %>
+ <%= render "posts/partials/show/nav_links", :post => @post, :position => "bottom" %>
<% end %>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
index 838eee18f..1f3914531 100644
--- a/app/views/users/edit.html.erb
+++ b/app/views/users/edit.html.erb
@@ -4,16 +4,14 @@
<%= simple_form_for @user do |f| %>
diff --git a/db/migrate/20130307225324_add_settings_to_users.rb b/db/migrate/20130307225324_add_settings_to_users.rb
new file mode 100644
index 000000000..b18e914f2
--- /dev/null
+++ b/db/migrate/20130307225324_add_settings_to_users.rb
@@ -0,0 +1,7 @@
+class AddSettingsToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :enable_post_navigation, :boolean, :null => false, :default => true
+ add_column :users, :new_post_navigation_layout, :boolean, :null => false, :default => true
+ add_column :users, :enable_privacy_mode, :boolean, :null => false, :default => false
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index cc14ee26a..21aaebbe6 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -2597,7 +2597,10 @@ CREATE TABLE users (
favorite_tags text,
blacklisted_tags text,
time_zone character varying(255) DEFAULT 'Eastern Time (US & Canada)'::character varying NOT NULL,
- bcrypt_password_hash text
+ bcrypt_password_hash text,
+ enable_post_navigation boolean DEFAULT true NOT NULL,
+ new_post_navigation_layout boolean DEFAULT true NOT NULL,
+ enable_privacy_mode boolean DEFAULT false NOT NULL
);
@@ -6226,4 +6229,6 @@ INSERT INTO schema_migrations (version) VALUES ('20130221214811');
INSERT INTO schema_migrations (version) VALUES ('20130302214500');
-INSERT INTO schema_migrations (version) VALUES ('20130305005138');
\ No newline at end of file
+INSERT INTO schema_migrations (version) VALUES ('20130305005138');
+
+INSERT INTO schema_migrations (version) VALUES ('20130307225324');
\ No newline at end of file