Merge branch 'development' of https://github.com/Rulingcom/orbit into 0917_ntu_mb
Bring Development Related Changes to ntu_mb
This commit is contained in:
commit
096aec3406
58 files changed
+438
-258
No files matched your search
@@ -240,6 +240,32 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def edit_order
|
||||
@users = User.not_guest_user
|
||||
end
|
||||
|
||||
def update_order
|
||||
if params[:users].present?
|
||||
params[:users].values.sort.each do |pair|
|
||||
to_go = pair[0].to_i
|
||||
if to_go > 0
|
||||
user_at_position = User.where(position: to_go - 1).first
|
||||
user = User.find(pair[1])
|
||||
if user_at_position && !user_at_position == user
|
||||
if user.position > user_at_position.position
|
||||
user.move_above(user_at_position)
|
||||
else
|
||||
user.move_below(user_at_position)
|
||||
end
|
||||
elsif to_go > User.count
|
||||
user.move_to_bottom
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@users = User.not_guest_user
|
||||
end
|
||||
|
||||
protected
|
||||
def get_tags
|
||||
|
||||
Reference in new issue
Block a user