Put current user first, closes #2063
This commit is contained in:
@@ -301,6 +301,7 @@
|
||||
url: "/users.json",
|
||||
data: {
|
||||
"search[order]": "post_upload_count",
|
||||
"search[current_user_first]": "true",
|
||||
"search[name_matches]": term + "*",
|
||||
"limit": 10,
|
||||
},
|
||||
|
||||
@@ -711,6 +711,10 @@ class User < ActiveRecord::Base
|
||||
if params[:id].present?
|
||||
q = q.where("id in (?)", params[:id].split(",").map(&:to_i))
|
||||
end
|
||||
|
||||
if params[:current_user_first] == "true" && !CurrentUser.is_anonymous?
|
||||
q = q.order("id = #{CurrentUser.user.id.to_i} desc")
|
||||
end
|
||||
|
||||
case params[:order]
|
||||
when "name"
|
||||
|
||||
Reference in New Issue
Block a user