* Refactor user settings page

* Change default route to posts#index
* Add footer to intro page
* Change promotion report to exclude deleted posts
This commit is contained in:
r888888888
2013-07-09 17:47:29 -07:00
parent 87eabe3b00
commit a4911e3f65
6 changed files with 41 additions and 28 deletions

View File

@@ -56,6 +56,10 @@ div#c-users {
display: block;
max-width: 30em;
}
.active {
color: black;
}
}
div#a-new {

View File

@@ -1,6 +1,6 @@
class IntroPresenter
def popular_tags
Tag.where("category = 3").order("post_count desc").limit(12).map(&:name)
Tag.where("category = 3").order("post_count desc").limit(8).map(&:name)
end
def each

View File

@@ -24,6 +24,8 @@
</div>
</div>
<%= render "static/footer" %>
<% content_for(:page_title) do %>
<%= Danbooru.config.app_name %>
<% end %>

View File

@@ -3,9 +3,9 @@
<h1>Settings</h1>
<%= simple_form_for @user do |f| %>
<fieldset>
<legend>Basic Settings</legend>
<h2 id="edit-options"><%= link_to "Basic settings", "#basic-settings", :class => 'active' %> | <%= link_to "Advanced settings", "#advanced-settings" %> | <%= link_to "Change password", "#change-password" %> | <%= link_to "Delete account", maintenance_user_deletion_path %></h2>
<fieldset id="basic-settings-section">
<div class="input">
<label>Name</label>
@@ -25,50 +25,42 @@
<em>blank</em>
<% end %>
&ndash;
<%= link_to "Change your email", new_maintenance_user_email_change_path %></p>
<%= link_to "Change your email", new_maintenance_user_email_change_path %>
</p>
</div>
<%= f.input :time_zone, :include_blank => false %>
<%= f.input :receive_email_notifications, :as => :select, :include_blank => false %>
<%= f.input :comment_threshold, :hint => "Comments below this score will be hidden by default" %>
<%= f.input :default_image_size, :hint => "Show original image or show resampled #{Danbooru.config.large_image_width} pixel version", :label => "Default image width", :collection => [["850px", "large"], ["original", "original"]], :include_blank => false %>
<%= f.input :default_image_size, :hint => "Show original image or show resized #{Danbooru.config.large_image_width} pixel version", :label => "Default image width", :collection => [["850px", "large"], ["original", "original"]], :include_blank => false %>
<% if CurrentUser.user.is_gold? %>
<%= f.input :per_page, :label => "Posts per page", :as => :select, :collection => (1..100), :include_blank => false %>
<% end %>
<%= f.input :blacklisted_tags, :hint => "Put any tag combinations you never want to see here. Each combination should go on a separate line.", :input_html => {:size => "40x5"} %>
</fieldset>
<fieldset id="advanced-settings-section">
<%= f.input :style_usernames, :as => :select, :label => "Colored usernames", :hint => "Color each user's name depending on their level", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
<%= f.input :always_resize_images, :as => :select, :include_blank => false, :label => "Fit images to window", :hint => "Use JavaScript to resize images to fit window" %>
<%= f.input :enable_post_navigation, :as => :select, :include_blank => false, :label => "Enable keyboard shortcuts" %>
<%= f.input :new_post_navigation_layout, :as => :select, :label => "Pool links", :include_blank => false, :collection => [["Below", "true"], ["Above", "false"]], :hint => "When browsing pools, place navigation links above or below the image" %>
<%= f.input :enable_sequential_post_navigation, :as => :select, :label => "Enable slideshow mode", :hint => "Show prev/next links when viewing a post", :include_blank => false %>
<%= f.input :hide_deleted_posts, :as => :select, :label => "Deleted post filter", :hint => "Remove deleted posts from search results", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
<%= f.input :enable_auto_complete, :as => :select, :collection => [["Yes", "true"], ["No", "false"]], :include_blank => false %>
<div class="input text optional field_with_hint">
<label class="text optional" for="user_favorite_tags">Frequent tags</label>
<textarea id="user_favorite_tags" class="text optional" rows="5" name="user[favorite_tags]" cols="40"><%= raw @user.favorite_tags %></textarea>
<span class="hint">A list of tags that you use often. They will appear when using the list of Related Tags.</span>
</div>
</fieldset>
<fieldset>
<legend>Advanced Settings</legend>
<%= f.input :style_usernames, :as => :select, :label => "Colored usernames", :hint => "Color each user's name depending on their rank", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
<%= f.input :always_resize_images, :as => :select, :include_blank => false, :label => "Fit images to window", :hint => "Use JavaScript to resize images to fit window" %>
<%= f.input :enable_post_navigation, :as => :select, :include_blank => false, :label => "Enable keyboard shortcuts" %>
<%= f.input :new_post_navigation_layout, :as => :select, :label => "Pool links", :include_blank => false, :collection => [["Bottom", "true"], ["Top", "false"]], :hint => "When browsing pools, where do you want the navigation links to be placed?" %>
<%= f.input :enable_sequential_post_navigation, :as => :select, :label => "Enable slideshow mode", :hint => "Show prev/next links when viewing a post", :include_blank => false %>
<%= f.input :hide_deleted_posts, :as => :select, :label => "Deleted post filter", :hint => "Hide deleted posts at the database level", :include_blank => false, :collection => [["Yes", "true"], ["No", "false"]] %>
<%= f.input :enable_auto_complete, :as => :select, :collection => [["Yes", "true"], ["No", "false"]], :include_blank => false %>
</fieldset>
<fieldset>
<legend>Change Password</legend>
<fieldset id="change-password-section">
<%= f.input :password, :hint => "Leave blank if you don't want to change your password", :label => "New password", :input_html => {:autocomplete => "off"} %>
<%= f.input :old_password, :as => :password, :input_html => {:autocomplete => "off"} %>
</fieldset>
<fieldset>
<legend>Delete Account</legend>
<div class="input">
<p><%= link_to "Delete your account", maintenance_user_deletion_path %></p>
</div>
</fieldset>
<%= f.button :submit, "Submit" %>
<% end %>
</div>
@@ -78,4 +70,19 @@
Settings - <%= Danbooru.config.app_name %>
<% end %>
<% content_for(:html_header) do %>
<script type="text/javascript">
$(function() {
$("#change-password-section,#advanced-settings-section").hide();
$("#edit-options a").on("click", function(e) {
var $target = $(e.target);
$("h2 a").removeClass("active");
$("#basic-settings-section,#change-password-section,#advanced-settings-section").hide();
$target.addClass("active")
$($target.attr("href") + "-section").show();
});
});
</script>
<% end %>
<%= render "secondary_links" %>

View File

@@ -4,7 +4,7 @@ module Danbooru
class Configuration
# The version of this Danbooru.
def version
"2.23.1"
"2.24.0"
end
# The name of this Danbooru.

View File

@@ -356,5 +356,5 @@ Danbooru::Application.routes.draw do
match "/static/benchmark" => "static#benchmark"
match "/static/name_change" => "static#name_change", :as => "name_change"
root :to => "posts#home"
root :to => "posts#index"
end