FEATURE: users can see the raw email source of their own posts

This commit is contained in:
Régis Hanol 2014-11-10 22:00:17 +01:00
parent ec76be964e
commit 988835a9a3
2 changed files with 6 additions and 6 deletions

View File

@ -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'))

View File

@ -50,16 +50,16 @@
</div>
{{/if}}
{{#if wiki}}
<div class="post-info wiki" title="{{i18n post.wiki.about}}" {{action "editPost" this}}><i class="fa fa-pencil-square-o"></i></div>
<div class="post-info wiki" title="{{i18n post.wiki.about}}" {{action "editPost" this}}>{{fa-icon "pencil-square-o"}}</div>
{{/if}}
{{#if via_email}}
{{#if canViewRawEmail}}
<div class="post-info via-email raw-email" title="{{i18n post.via_email}}" {{action "showRawEmail" this}}><i class="fa fa-envelope-o"></i></div>
<div class="post-info via-email raw-email" title="{{i18n post.via_email}}" {{action "showRawEmail" this}}>{{fa-icon "envelope-o"}}</div>
{{else}}
<div class="post-info via-email" title="{{i18n post.via_email}}"><i class="fa fa-envelope-o"></i></div>
<div class="post-info via-email" title="{{i18n post.via_email}}">{{fa-icon "envelope-o"}}</div>
{{/if}}
{{/if}}
<div {{bind-attr class=":read-state read"}} title="{{i18n post.unread}}"><i class='fa fa-circle'></i></div>
<div {{bind-attr class=":read-state read"}} title="{{i18n post.unread}}">{{fa-icon "circle"}}</div>
</div>
<div {{bind-attr class=":select-posts controller.multiSelect::hidden"}}>