Fix #3694: Favgroup UX issues.
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.FavoriteGroup.add_to_favgroup = function(e) {
|
Danbooru.FavoriteGroup.add_to_favgroup = function(e) {
|
||||||
var favgroup_index = String.fromCharCode(e.which);
|
var favgroup_index = (e.key === "0") ? "10" : e.key;
|
||||||
var link = $("#add-to-favgroup-" + favgroup_index + ":visible");
|
var link = $("#add-to-favgroup-" + favgroup_index + ":visible");
|
||||||
if (link.length) {
|
if (link.length) {
|
||||||
link.click();
|
link.click();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class FavoriteGroup < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def default_order
|
def default_order
|
||||||
order(updated_at: :desc)
|
order(name: :asc)
|
||||||
end
|
end
|
||||||
|
|
||||||
def search(params)
|
def search(params)
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ class User < ApplicationRecord
|
|||||||
has_many :saved_searches
|
has_many :saved_searches
|
||||||
has_many :forum_posts, lambda {order("forum_posts.created_at, forum_posts.id")}, :foreign_key => "creator_id"
|
has_many :forum_posts, lambda {order("forum_posts.created_at, forum_posts.id")}, :foreign_key => "creator_id"
|
||||||
has_many :user_name_change_requests, lambda {visible.order("user_name_change_requests.created_at desc")}
|
has_many :user_name_change_requests, lambda {visible.order("user_name_change_requests.created_at desc")}
|
||||||
|
has_many :favorite_groups, lambda {order(name: :asc)}, foreign_key: :creator_id
|
||||||
belongs_to :inviter, class_name: "User", optional: true
|
belongs_to :inviter, class_name: "User", optional: true
|
||||||
after_update :create_mod_action
|
after_update :create_mod_action
|
||||||
accepts_nested_attributes_for :dmail_filter
|
accepts_nested_attributes_for :dmail_filter
|
||||||
@@ -305,10 +306,6 @@ class User < ApplicationRecord
|
|||||||
def remove_favorite!(post)
|
def remove_favorite!(post)
|
||||||
Favorite.remove(post: post, user: self)
|
Favorite.remove(post: post, user: self)
|
||||||
end
|
end
|
||||||
|
|
||||||
def favorite_groups
|
|
||||||
FavoriteGroup.for_creator(CurrentUser.user.id).order("updated_at desc")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module LevelMethods
|
module LevelMethods
|
||||||
@@ -753,7 +750,7 @@ class User < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def favorite_group_count
|
def favorite_group_count
|
||||||
FavoriteGroup.for_creator(id).count
|
favorite_groups.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def appeal_count
|
def appeal_count
|
||||||
|
|||||||
Reference in New Issue
Block a user