only staff can view raw email
This commit is contained in:
parent
2131a37811
commit
3854c0a29e
|
@ -64,6 +64,10 @@ Discourse.Post = Discourse.Model.extend({
|
|||
hasHistory: Em.computed.gt('version', 1),
|
||||
postElementId: Discourse.computed.fmt('post_number', 'post_%@'),
|
||||
|
||||
canViewRawEmail: function() {
|
||||
return Discourse.User.currentProp('staff');
|
||||
}.property(),
|
||||
|
||||
bookmarkedChanged: function() {
|
||||
Discourse.Post.bookmark(this.get('id'), this.get('bookmarked'))
|
||||
.then(null, function (error) {
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
{{#if raw_email}}
|
||||
<pre><code>{{raw_email}}</code></pre>
|
||||
{{else}}
|
||||
Not Available!
|
||||
{{i18n raw_email.not_available}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -53,7 +53,11 @@
|
|||
<div class="post-info wiki" title="{{i18n post.wiki.about}}" {{action "editPost" this}}><i class="fa fa-pencil-square-o"></i></div>
|
||||
{{/if}}
|
||||
{{#if via_email}}
|
||||
<div class="post-info via-email" title="{{i18n post.via_email}}" {{action "showRawEmail" this}}><i class="fa fa-envelope-o"></i></div>
|
||||
{{#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>
|
||||
{{else}}
|
||||
<div class="post-info via-email" title="{{i18n post.via_email}}"><i class="fa fa-envelope-o"></i></div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<div {{bind-attr class=":read-state read"}} title="{{i18n post.unread}}"><i class='fa fa-circle'></i></div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/raw_email',
|
||||
title: I18n.t('raw_email'),
|
||||
title: I18n.t('raw_email.title'),
|
||||
|
||||
resizeModal: function(){
|
||||
var viewPortHeight = $(window).height();
|
||||
|
|
|
@ -122,18 +122,21 @@ aside.quote {
|
|||
|
||||
.post-info {
|
||||
&.wiki, &.via-email {
|
||||
cursor: pointer;
|
||||
margin-right: 5px;
|
||||
i.fa {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
&.wiki {
|
||||
cursor: pointer;
|
||||
color: $wiki;
|
||||
}
|
||||
&.via-email {
|
||||
color: scale-color($primary, $lightness: 70%);
|
||||
}
|
||||
&.raw-email {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1382,9 +1382,13 @@ en:
|
|||
users_lowercase: "users"
|
||||
category_title: "Category"
|
||||
history: "History"
|
||||
raw_email: "Raw Email"
|
||||
changed_by: "by {{author}}"
|
||||
|
||||
|
||||
raw_email:
|
||||
title: "Raw Email"
|
||||
not_available: "Not available!"
|
||||
|
||||
categories_list: "Categories List"
|
||||
|
||||
filters:
|
||||
|
|
Loading…
Reference in New Issue