Added notice for comments requiring approval
authorAlexander Ebert <ebert@woltlab.com>
Wed, 8 Mar 2017 12:21:20 +0000 (13:21 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 8 Mar 2017 12:21:20 +0000 (13:21 +0100)
See #2219

com.woltlab.wcf/objectType.xml
com.woltlab.wcf/templates/commentList.tpl
com.woltlab.wcf/templates/commentListAddComment.tpl
wcfsetup/install/files/lib/data/comment/CommentAction.class.php
wcfsetup/install/files/style/ui/comment.scss
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index ea76c956691288fc6c609ee7c1d5cafd1700693b..861cebef4cb354b86b0e69c492bdd550e0742c9e 100644 (file)
                <!-- /comments -->
                
                <!-- moderation -->
+               <type>
+                       <name>com.woltlab.wcf.comment.comment</name>
+                       <definitionname>com.woltlab.wcf.moderation.activation</definitionname>
+                       <classname>wcf\system\moderation\queue\activation\CommentCommentModerationQueueActivationHandler</classname>
+               </type>
                <type>
                        <name>com.woltlab.wcf.comment.comment</name>
                        <definitionname>com.woltlab.wcf.moderation.report</definitionname>
                        <classname>wcf\system\moderation\queue\report\CommentCommentModerationQueueReportHandler</classname>
                </type>
                
+               <type>
+                       <name>com.woltlab.wcf.comment.response</name>
+                       <definitionname>com.woltlab.wcf.moderation.activation</definitionname>
+                       <classname>wcf\system\moderation\queue\activation\CommentResponseModerationQueueActivationHandler</classname>
+               </type>
                <type>
                        <name>com.woltlab.wcf.comment.response</name>
                        <definitionname>com.woltlab.wcf.moderation.report</definitionname>
index dce45958f26db4febf0fc73406519fb55ee87a49..0b60da80d4d420fd1f393e1daf48f5a6c2aef634 100644 (file)
@@ -1,5 +1,5 @@
 {if !$commentManager|isset}{assign var='commentManager' value=$commentList->getCommentManager()}{/if}
-{assign var=__comentCanModerate value=$commentManager->canModerate($commentList->objectTypeID, $commentList->objectID)}
+{if !$commentCanModerate|isset}{assign var=commentCanModerate value=$commentManager->canModerate($commentList->objectTypeID, $commentList->objectID)}{/if}
 {foreach from=$commentList item=comment}
        <li class="comment jsComment"
            data-object-id="{@$comment->commentID}" data-comment-id="{@$comment->commentID}" data-object-type="com.woltlab.wcf.comment"
@@ -41,7 +41,7 @@
                                        
                                        <nav class="jsMobileNavigation buttonGroupNavigation">
                                                <ul class="buttonList iconList">
-                                                       {if $comment->isDisabled && $__comentCanModerate}
+                                                       {if $comment->isDisabled && $commentCanModerate}
                                                                <li class="jsOnly"><a href="#" class="jsEnableComment"><span class="icon icon16 fa-check"></span> <span class="invisible">{lang}wcf.comment.approve{/lang}</span></a></li>
                                                        {/if}
                                                        {if $commentManager->supportsReport() && $__wcf->session->getPermission('user.profile.canReportContent')}
index 2bdf993b7659ac0f138693339ae9d9fbd256e79f..8b950510f249cbafa0e8071fef3d3984e7f4e357 100644 (file)
@@ -2,6 +2,10 @@
        {@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(48)}
        <div class="commentListAddComment collapsed" data-placeholder="{lang}wcf.comment.add{/lang}">
                <div class="commentListAddCommentEditorContainer">
+                       {if !$commentList->getCommentManager()->canAddWithoutApproval($commentList->objectID)}
+                               <p class="info">{lang}wcf.comment.add.moderation.info{/lang}</p>
+                       {/if}
+                       
                        <textarea id="{$wysiwygSelector}" name="text" class="wysiwygTextarea"
                                  data-disable-attachments="true"
                                  data-disable-media="true"
index 1f16b23e1ccaabcefd425bdbd076ea6e665a5cd7..d8e42c21b22b80b272377ec01c1d56bfcbb867f5 100644 (file)
@@ -806,6 +806,7 @@ class CommentAction extends AbstractDatabaseObjectAction implements IMessageInli
                }
                
                WCF::getTPL()->assign([
+                       'commentCanModerate' => $this->commentProcessor->canModerate($comment->getDecoratedObject()->objectTypeID, $comment->getDecoratedObject()->objectID),
                        'commentList' => [$comment],
                        'commentManager' => $this->commentProcessor
                ]);
index e2bdd7a5ce7a07ce7705c16d08e6056777ff1901..2b464adc9efdbb70ab0f3b2eef1542575a7d9b1c 100644 (file)
        }
 }
 
+.commentListAddCommentEditorContainer > .info:first-child {
+       margin-top: 0;
+}
+
 .commentEditorContainer {
        > .icon {
                left: calc(50% - 24px);
index b24492b4ad06f582276de46cb09ea1f2bfdc2fd6..4ff09dbd9267ebecaf4b2f8b3b299e9a3b406050 100644 (file)
@@ -2155,6 +2155,7 @@ Fehler sind beispielsweise:
        
        <category name="wcf.comment">
                <item name="wcf.comment.add"><![CDATA[Kommentar schreiben …]]></item>
+               <item name="wcf.comment.add.moderation.info"><![CDATA[Neu erstellte Kommentare unterliegen der Moderation und werden erst sichtbar, wenn sie durch einen Moderator geprüft und freigeschaltet wurden.]]></item>
                <item name="wcf.comment.approve"><![CDATA[Freischalten]]></item>
                <item name="wcf.comment.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} diesen Kommentar wirklich löschen?]]></item>
                <item name="wcf.comment.description"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Drücke{else}Drücken Sie{/if} die Eingabetaste, um abzusenden oder Escape, um abzubrechen.]]></item>
index 708e3d02f28da23699ab7092d9c1b6709129ada8..38f72c8ba6f741374eca4bf2779bc72dbb945029 100644 (file)
@@ -2113,6 +2113,7 @@ Errors are:
        
        <category name="wcf.comment">
                <item name="wcf.comment.add"><![CDATA[Write a comment …]]></item>
+               <item name="wcf.comment.add.moderation.info"><![CDATA[Newly created comments need to be manually approved before publication, other users cannot see this comment until it has been approved.]]></item>
                <item name="wcf.comment.approve"><![CDATA[Approve]]></item>
                <item name="wcf.comment.delete.confirmMessage"><![CDATA[Do you really want to delete this comment?]]></item>
                <item name="wcf.comment.description"><![CDATA[Press Enter to send or Escape to cancel.]]></item>