Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
f889849b6b
|
@ -12,7 +12,7 @@ class OwnersController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@owner = Owner.find_by(login: params[:id]) || Owner.find_by(id: params[:id])
|
@owner = Owner.find_by(login: params[:id]) || Owner.find_by(id: params[:id])
|
||||||
# return render_not_found unless @owner.present?
|
return render_ok(type: 'User') unless @owner.present?
|
||||||
# 组织
|
# 组织
|
||||||
if @owner.is_a?(Organization)
|
if @owner.is_a?(Organization)
|
||||||
return render_forbidden("没有查看组织的权限") if org_limited_condition || org_privacy_condition
|
return render_forbidden("没有查看组织的权限") if org_limited_condition || org_privacy_condition
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
json.type @owner.type
|
json.type @owner.present? ? @owner.type : 'User'
|
||||||
if @owner.is_a?(Organization)
|
if @owner.present? && @owner.is_a?(Organization)
|
||||||
json.partial! "organizations/organizations/detail", organization: @owner
|
json.partial! "organizations/organizations/detail", organization: @owner
|
||||||
json.can_create_project @can_create_project
|
json.can_create_project @can_create_project
|
||||||
json.is_admin @is_admin
|
json.is_admin @is_admin
|
||||||
json.is_member @is_member
|
json.is_member @is_member
|
||||||
elsif @owner.is_a?(User)
|
elsif @owner.present? && @owner.is_a?(User)
|
||||||
json.partial! 'users/user', locals: { user: @owner }
|
json.partial! 'users/user', locals: { user: @owner }
|
||||||
json.undo_messages @waiting_applied_messages.size
|
json.undo_messages @waiting_applied_messages.size
|
||||||
json.undo_transfer_projects @common_applied_transfer_projects.size
|
json.undo_transfer_projects @common_applied_transfer_projects.size
|
||||||
|
@ -21,6 +21,6 @@ elsif @owner.is_a?(User)
|
||||||
json.city @owner.show_location ? @owner.city : nil
|
json.city @owner.show_location ? @owner.city : nil
|
||||||
json.custom_department @owner.show_department ? @owner.custom_department : nil
|
json.custom_department @owner.show_department ? @owner.custom_department : nil
|
||||||
json.description @owner.description
|
json.description @owner.description
|
||||||
elsif
|
else
|
||||||
json.nil
|
json.nil
|
||||||
end
|
end
|
Loading…
Reference in New Issue