From 325f5de6fa671135b630251dd3bba98a8a815b7b Mon Sep 17 00:00:00 2001 From: sarken Date: Wed, 19 Jun 2024 07:05:38 -0400 Subject: [PATCH] AO3-6739 Display moderated commenting notice on individual chapters (#4859) * AO3-6739 Extend tests to cover moderation message on chapters * AO3-6739 Display moderated commenting notice on chapters --- app/views/comments/_comment_form.html.erb | 9 +++++---- features/comments_and_kudos/comment_moderation.feature | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/comments/_comment_form.html.erb b/app/views/comments/_comment_form.html.erb index ab69c7f5752..9dcf3adcd03 100644 --- a/app/views/comments/_comment_form.html.erb +++ b/app/views/comments/_comment_form.html.erb @@ -28,10 +28,11 @@ <% if comments_are_moderated(commentable) && !current_user_is_work_creator(commentable) %>

- <%# i18n-tasks-use - t("comments.commentable.permissions.moderated_commenting.notice.admin_post") - t("comments.commentable.permissions.moderated_commenting.notice.work") %> - <%= t("comments.commentable.permissions.moderated_commenting.notice.#{commentable.model_name.i18n_key}") %> + <% if commentable.is_a?(AdminPost) %> + <%= t("comments.commentable.permissions.moderated_commenting.notice.admin_post") %> + <% else %> + <%= t("comments.commentable.permissions.moderated_commenting.notice.work") %> + <% end %>

<% end %> diff --git a/features/comments_and_kudos/comment_moderation.feature b/features/comments_and_kudos/comment_moderation.feature index 161bcaac20d..51176bfcbc5 100644 --- a/features/comments_and_kudos/comment_moderation.feature +++ b/features/comments_and_kudos/comment_moderation.feature @@ -37,10 +37,13 @@ Feature: Comment Moderation And I set up the draft "Moderation" And I check "Enable comment moderation" And I post the work without preview + And I post a chapter for the work "Moderation" Then comment moderation should be enabled on "Moderation" When I am logged in as "commenter" - And I view the work "Moderation" - Then I should see "has chosen to moderate comments" + And I go to the work "Moderation" in full mode + Then I should see "This work's creator has chosen to moderate comments on the work. Your comment will not appear until it has been approved by the creator." + When I go to the 2nd chapter of the work "Moderation" + Then I should see "This work's creator has chosen to moderate comments on the work. Your comment will not appear until it has been approved by the creator." Scenario: Post a moderated comment Given the moderated work "Moderation" by "author"