FIX: add meta details for user summary page
This commit is contained in:
parent
1ebd3dbbd0
commit
0cb2b7d603
|
@ -20,7 +20,7 @@ class UsersController < ApplicationController
|
||||||
skip_before_action :check_xhr, only: [
|
skip_before_action :check_xhr, only: [
|
||||||
:show, :badges, :password_reset, :update, :account_created,
|
:show, :badges, :password_reset, :update, :account_created,
|
||||||
:activate_account, :perform_account_activation, :user_preferences_redirect, :avatar,
|
:activate_account, :perform_account_activation, :user_preferences_redirect, :avatar,
|
||||||
:my_redirect, :toggle_anon, :admin_login, :confirm_admin, :email_login
|
:my_redirect, :toggle_anon, :admin_login, :confirm_admin, :email_login, :summary
|
||||||
]
|
]
|
||||||
|
|
||||||
before_action :respond_to_suspicious_request, only: [:create]
|
before_action :respond_to_suspicious_request, only: [:create]
|
||||||
|
@ -213,14 +213,21 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def summary
|
def summary
|
||||||
user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
@user = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||||
|
raise Discourse::NotFound unless guardian.can_see_profile?(@user)
|
||||||
|
|
||||||
raise Discourse::NotFound unless guardian.can_see_profile?(user)
|
summary = UserSummary.new(@user, guardian)
|
||||||
|
|
||||||
summary = UserSummary.new(user, guardian)
|
|
||||||
serializer = UserSummarySerializer.new(summary, scope: guardian)
|
serializer = UserSummarySerializer.new(summary, scope: guardian)
|
||||||
|
respond_to do |format|
|
||||||
|
format.html do
|
||||||
|
@restrict_fields = guardian.restrict_user_fields?(@user)
|
||||||
|
render :show
|
||||||
|
end
|
||||||
|
format.json do
|
||||||
render_json_dump(serializer)
|
render_json_dump(serializer)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def invited
|
def invited
|
||||||
inviter = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
inviter = fetch_user_from_params(include_inactive: current_user.try(:staff?) || (current_user && SiteSetting.show_inactive_accounts))
|
||||||
|
|
Loading…
Reference in New Issue