@@ -44,7 +44,7 @@
<% end %>
- <% # for users, bookmark and mark to read later %>
+ <%# for users, bookmark and mark to read later %>
<% if current_user.is_a?(User) %>
<% @bookmark ||= bookmark_if_exists(@work) %>
@@ -64,7 +64,7 @@
<% end %>
- <% # If in single chapter view, show comments for the chapter; otherwise, show the comments for the entire work %>
+ <%# If in single chapter view, show comments for the chapter; otherwise, show the comments for the entire work %>
<% @previous_chapter || @next_chapter ? commentable = @chapter : commentable = @work %>
<% if commentable.count_visible_comments > 0 %>
<%= show_hide_comments_link(commentable) %>
@@ -73,14 +73,19 @@
<% end %>
- <% # for author or admin, review comments if moderating them %>
+ <%# for author or admin, review comments if moderating them %>
<% if (logged_in_as_admin? || (current_user && current_user.is_author_of?(@work))) && @work.find_all_comments.unreviewed_only.exists? %>
<% end %>
- <% # allow user to disable style on work if it has been customized %>
+ <%# allow user to disable style on work if it has been customized %>
<% if @work.work_skin %>
<% if Preference.disable_work_skin?(params[:style]) %>
@@ -105,7 +110,7 @@
<% end %>
- <%# The li, noscript, and button tags MUST be on the same line here to avoid the behavior described in https://otwarchive.atlassian.net/browse/AO3-4629?focusedCommentId=372231 %>
+ <%# The li, noscript, and button tags MUST be on the same line here %>
<% if downloadable? && AdminSetting.current.downloads_enabled? %>
diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml
index 630a3291f9..792e2db918 100644
--- a/config/locales/views/en.yml
+++ b/config/locales/views/en.yml
@@ -3346,6 +3346,7 @@ en:
download:
button: Download
heading: Download
+ unreviewed_comments: "Unreviewed Comments (%{count})"
work_header_notes:
inspired_by:
other_works_inspired_by_this_one: other works inspired by this one
diff --git a/features/comments_and_kudos/comment_moderation.feature b/features/comments_and_kudos/comment_moderation.feature
index 3f32b97d08..c5837b85b8 100644
--- a/features/comments_and_kudos/comment_moderation.feature
+++ b/features/comments_and_kudos/comment_moderation.feature
@@ -330,3 +330,23 @@ Feature: Comment Moderation
And I view the work "Moderation"
And I follow "Unreviewed Comments (1)"
Then I should not see "Parent Thread"
+
+ Scenario: Creator marks an unreviewed comment as spam and the count updates
+ Given I am logged in as "spam_catcher"
+ And I have a work "Spam Trap"
+ And I edit the work "Spam Trap"
+ And I check "Enable comment moderation on this work"
+ And I press "Post Without Preview"
+ And I am logged out
+ When I view the work "Spam Trap"
+ And I fill in "Comment" with "Fake spam"
+ And I fill in "Name" with "Spammer"
+ And I fill in "Email" with "spam@example.com"
+ And I press "Comment"
+ When I am logged in as "spam_catcher"
+ And I view the work "Spam Trap"
+ Then I should see "Unreviewed Comments (1)"
+ When I follow "Unreviewed Comments"
+ And I follow "Spam"
+ Then I should see "Unreviewed Comments (0)"
+ And I should not see "Fake spam"
diff --git a/features/step_definitions/comment_steps.rb b/features/step_definitions/comment_steps.rb
index 22d1cc413a..2881865066 100644
--- a/features/step_definitions/comment_steps.rb
+++ b/features/step_definitions/comment_steps.rb
@@ -273,6 +273,7 @@
Given "the moderated work {string} by {string}" do |title, login|
user = ensure_user(login)
+ user.preference.update!(allow_co_creator_invite: true)
w = FactoryBot.create(:work, title: title, authors: [user.default_pseud])
w.update_attribute(:moderated_commenting_enabled, true)
end