discourse#2591

This commit is contained in:
Ben Lubar 2014-07-27 12:12:36 -05:00
parent 44dc4b4a17
commit ac8c2e1e07
3 changed files with 9 additions and 6 deletions

View File

@ -167,9 +167,9 @@
{{preference-checkbox labelKey="user.enable_quoting" checked=enable_quoting}}
{{preference-checkbox labelKey="user.dynamic_favicon" checked=dynamic_favicon}}
{{preference-checkbox labelKey="user.disable_jump_reply" checked=disable_jump_reply}}
{{#if !Discourse.SiteSettings.edit_history_available_to_public}}
{{#unless Discourse.SiteSettings.edit_history_available_to_public}}
{{preference-checkbox labelKey="user.edit_history_public" checked=edit_history_public}}
{{/if}}
{{/unless}}
{{plugin-outlet "user_custom_preferences"}}
</div>

View File

@ -43,7 +43,8 @@ class UserSerializer < BasicUserSerializer
:suspended_till,
:uploaded_avatar_id,
:badge_count,
:has_title_badges
:has_title_badges,
:edit_history_public
has_one :invited_by, embed: :object, serializer: BasicUserSerializer
has_many :custom_groups, embed: :object, serializer: BasicGroupSerializer
@ -77,8 +78,7 @@ class UserSerializer < BasicUserSerializer
:gravatar_avatar_upload_id,
:custom_avatar_upload_id,
:custom_fields,
:has_title_badges,
:edit_history_public
:has_title_badges
###
### ATTRIBUTES
@ -237,4 +237,7 @@ class UserSerializer < BasicUserSerializer
object.badges.where(allow_title: true).count > 0
end
def include_edit_history_public?
can_edit && !SiteSetting.edit_history_visible_to_public
end
end

View File

@ -137,7 +137,7 @@ module PostGuardian
return false unless post
if !post.hidden
return true if post.wiki || SiteSetting.edit_history_visible_to_public || post.user.edit_history_public
return true if post.wiki || SiteSetting.edit_history_visible_to_public || post.user.try(:edit_history_public)
end
authenticated? &&