mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
FEATURE: support staff only custom user fields
This commit is contained in:
parent
0ec56ed903
commit
9698447e89
@ -1078,6 +1078,7 @@ en:
|
||||
detect_custom_avatars: "Whether or not to check that users have uploaded custom avatars."
|
||||
max_daily_gravatar_crawls: "Maximum number of times Discourse will check Gravatar for custom avatars in a day"
|
||||
public_user_custom_fields: "A whitelist of custom fields for a user that can be shown publically."
|
||||
staff_user_custom_fields: "A whitelist of custom fields for a user that can be shown to staff."
|
||||
|
||||
allow_profile_backgrounds: "Allow users to upload profile backgrounds."
|
||||
|
||||
|
@ -299,6 +299,9 @@ users:
|
||||
public_user_custom_fields:
|
||||
type: list
|
||||
default: ''
|
||||
staff_user_custom_fields:
|
||||
type: list
|
||||
default: ''
|
||||
|
||||
posting:
|
||||
min_post_length:
|
||||
|
@ -42,6 +42,11 @@ class TopicView
|
||||
@user_custom_fields = User.custom_fields_for_ids(@posts.map(&:user_id), SiteSetting.public_user_custom_fields.split('|'))
|
||||
end
|
||||
|
||||
if @guardian.is_staff? && SiteSetting.staff_user_custom_fields.present? && @posts
|
||||
@user_custom_fields ||= {}
|
||||
@user_custom_fields.deep_merge!(User.custom_fields_for_ids(@posts.map(&:user_id), SiteSetting.staff_user_custom_fields.split('|')))
|
||||
end
|
||||
|
||||
@draft_key = @topic.draft_key
|
||||
@draft_sequence = DraftSequence.current(@user, @draft_key)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user