From 879652f05526b12c16a5cbd49bfafc5c4bdb2cb8 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Mon, 12 Aug 2013 11:12:12 -0400 Subject: [PATCH] Add setting edit_history_visible_to_public to control whether post edits can be viewed by everyone. Uncheck it so only staff users can see edits. --- app/assets/javascripts/discourse/models/post.js | 6 +++++- .../discourse/templates/post.js.handlebars | 15 +++++++++++---- .../stylesheets/application/topic-post.css.scss | 2 +- app/models/site_setting.rb | 1 + config/locales/server.en.yml | 1 + 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/models/post.js b/app/assets/javascripts/discourse/models/post.js index 0fe6af369..d6801a18e 100644 --- a/app/assets/javascripts/discourse/models/post.js +++ b/app/assets/javascripts/discourse/models/post.js @@ -343,7 +343,11 @@ Discourse.Post = Discourse.Model.extend({ topic = this.get('topic'); return !topic.isReplyDirectlyBelow(this); - }.property('reply_count') + }.property('reply_count'), + + canViewEditHistory: function() { + return (Discourse.SiteSettings.edit_history_visible_to_public || (Discourse.User.current() && Discourse.User.current().get('staff'))); + }.property() }); diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index efb2f3a08..23924a535 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -32,10 +32,17 @@
{{#if hasHistory}} {{/if}}