From 988835a9a3a793bab8ee426e02cc279b82110053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 10 Nov 2014 22:00:17 +0100 Subject: [PATCH] FEATURE: users can see the raw email source of their own posts --- app/assets/javascripts/discourse/models/_post.js | 4 ++-- app/assets/javascripts/discourse/templates/post.hbs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/models/_post.js b/app/assets/javascripts/discourse/models/_post.js index 9e865ea1892..d79c7d5a567 100644 --- a/app/assets/javascripts/discourse/models/_post.js +++ b/app/assets/javascripts/discourse/models/_post.js @@ -65,8 +65,8 @@ Discourse.Post = Discourse.Model.extend({ postElementId: Discourse.computed.fmt('post_number', 'post_%@'), canViewRawEmail: function() { - return Discourse.User.currentProp('staff'); - }.property(), + return this.get("user_id") === Discourse.User.currentProp("id") || Discourse.User.currentProp('staff'); + }.property("user_id"), bookmarkedChanged: function() { Discourse.Post.bookmark(this.get('id'), this.get('bookmarked')) diff --git a/app/assets/javascripts/discourse/templates/post.hbs b/app/assets/javascripts/discourse/templates/post.hbs index 9fc639251fd..3c2689c6ab6 100644 --- a/app/assets/javascripts/discourse/templates/post.hbs +++ b/app/assets/javascripts/discourse/templates/post.hbs @@ -50,16 +50,16 @@ {{/if}} {{#if wiki}} -
+
{{fa-icon "pencil-square-o"}}
{{/if}} {{#if via_email}} {{#if canViewRawEmail}} -
+
{{fa-icon "envelope-o"}}
{{else}} -
+
{{fa-icon "envelope-o"}}
{{/if}} {{/if}} -
+
{{fa-icon "circle"}}