diff --git a/extensions/approval/js/forum/dist/extension.js b/extensions/approval/js/forum/dist/extension.js index ff2c9a67e..ba6956303 100644 --- a/extensions/approval/js/forum/dist/extension.js +++ b/extensions/approval/js/forum/dist/extension.js @@ -1,7 +1,7 @@ 'use strict'; -System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/models/Discussion', 'flarum/models/Post', 'flarum/components/Badge', 'flarum/components/DiscussionListItem', 'flarum/components/CommentPost', 'flarum/components/Button', 'flarum/utils/PostControls'], function (_export, _context) { - var extend, override, app, Discussion, Post, Badge, DiscussionListItem, CommentPost, Button, PostControls; +System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/models/Discussion', 'flarum/models/Post', 'flarum/components/Badge', 'flarum/components/DiscussionListItem', 'flarum/components/Post', 'flarum/components/CommentPost', 'flarum/components/Button', 'flarum/utils/PostControls'], function (_export, _context) { + var extend, override, app, Discussion, Post, Badge, DiscussionListItem, PostComponent, CommentPost, Button, PostControls; return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; @@ -16,6 +16,8 @@ System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/ Badge = _flarumComponentsBadge.default; }, function (_flarumComponentsDiscussionListItem) { DiscussionListItem = _flarumComponentsDiscussionListItem.default; + }, function (_flarumComponentsPost) { + PostComponent = _flarumComponentsPost.default; }, function (_flarumComponentsCommentPost) { CommentPost = _flarumComponentsCommentPost.default; }, function (_flarumComponentsButton) { @@ -44,9 +46,9 @@ System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/ } }); - extend(CommentPost.prototype, 'attrs', function (attrs) { - if (!this.props.post.isApproved() && !this.props.post.isHidden()) { - attrs.className += ' CommentPost--unapproved'; + extend(PostComponent.prototype, 'attrs', function (attrs) { + if (!this.props.post.isApproved()) { + attrs.className += ' Post--unapproved'; } }); @@ -56,7 +58,7 @@ System.register('flarum/approval/main', ['flarum/extend', 'flarum/app', 'flarum/ } }); - override(CommentPost.prototype, 'flagReason', function (original, flag) { + override(PostComponent.prototype, 'flagReason', function (original, flag) { if (flag.type() === 'approval') { return app.translator.trans('flarum-approval.forum.post.awaiting_approval_text'); } diff --git a/extensions/approval/js/forum/src/main.js b/extensions/approval/js/forum/src/main.js index e8de8dcba..813ca70ac 100644 --- a/extensions/approval/js/forum/src/main.js +++ b/extensions/approval/js/forum/src/main.js @@ -4,6 +4,7 @@ import Discussion from 'flarum/models/Discussion'; import Post from 'flarum/models/Post'; import Badge from 'flarum/components/Badge'; import DiscussionListItem from 'flarum/components/DiscussionListItem'; +import PostComponent from 'flarum/components/Post'; import CommentPost from 'flarum/components/CommentPost'; import Button from 'flarum/components/Button'; import PostControls from 'flarum/utils/PostControls'; @@ -27,9 +28,9 @@ app.initializers.add('flarum-approval', () => { } }); - extend(CommentPost.prototype, 'attrs', function(attrs) { - if (!this.props.post.isApproved() && !this.props.post.isHidden()) { - attrs.className += ' CommentPost--unapproved'; + extend(PostComponent.prototype, 'attrs', function(attrs) { + if (!this.props.post.isApproved()) { + attrs.className += ' Post--unapproved'; } }); @@ -39,7 +40,7 @@ app.initializers.add('flarum-approval', () => { } }); - override(CommentPost.prototype, 'flagReason', function(original, flag) { + override(PostComponent.prototype, 'flagReason', function(original, flag) { if (flag.type() === 'approval') { return app.translator.trans('flarum-approval.forum.post.awaiting_approval_text'); } diff --git a/extensions/approval/less/forum/extension.less b/extensions/approval/less/forum/extension.less index 2f1d8a514..d5fbc93d2 100644 --- a/extensions/approval/less/forum/extension.less +++ b/extensions/approval/less/forum/extension.less @@ -1,7 +1,8 @@ -.CommentPost--unapproved { +.Post--unapproved { .Post-header, .Post-body, - .Post-footer { + .EventPost-icon, + .EventPost-info { opacity: 0.5; } }