-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-5860 Prevent leaving comments or kudos when logged in as admin #4378
Merged
Merged
Changes from 43 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
cc10ee2
Ask admins to log out before commenting
ceithir 1fba796
Ask admins to log out before leaving kudos
ceithir 1ee02e0
Clean up now irrelevant code
ceithir 9142a82
Update reminder text
ceithir 12c31ba
Controller tests instead of integration tests
ceithir 7aa02d3
Hide kudos/comments button as admin
ceithir 4ed8ade
Restrict commenting on works only?
ceithir 33b89e0
Attempt at disabling all admin comments
ceithir 0228eed
Revert "Attempt at disabling all admin comments"
ceithir 731229a
Fix test to not restrict admin comments on tags
ceithir d43483b
? spacing
ceithir 60da2d0
Hound
ceithir f33f7d3
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir f50f30b
Hide whole form, not solely button
ceithir f876634
Prevent admin from commenting on anything
ceithir 1416d90
Update old test for new behavior
ceithir 2bbe0f8
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir 05d8843
Check message and redirection at once
ceithir 485ff75
Add test for no reply comment
ceithir dde9452
Remove empty if
ceithir bac38ce
Now useless admin only form
ceithir 45d007d
Lost EOF newline
ceithir 75ba8e7
Actually hide Reply link
ceithir 5d79d12
Check not admin on all "add comment" routes
ceithir 987c85e
Consistent location for check
ceithir 21a2048
Updated test for new behavior
ceithir 68c056b
Unneeded change
ceithir a1c39fa
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir face994
More precise message
ceithir 6a402bd
Better test description
ceithir 24c925b
Missing test
ceithir ba071ea
Normalize i18n files
ceithir 079c090
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir bdb5b41
Forgot to update similar tests indeed
ceithir 5ddfb2e
Handle :js format
ceithir 70f4e2a
Revert "Handle :js format"
ceithir 8923da3
Make sure admin cannot create kudos through AJAX
ceithir 8ab8775
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir 493d6fa
Oops
ceithir 5e8e94f
Doing two things as once...
ceithir 0ec17bf
Actual non silly merge conflict
ceithir 9266392
Intended behavior?
ceithir b329103
Merge remote-tracking branch 'upstream/master' into AO3-5860
ceithir 7155047
Update ts( to t(
ceithir 9c7a080
If you start doing something...
ceithir 55b0885
Test update
ceithir ce366d6
Acceptable HTML
ceithir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
<% if logged_in? %> | ||
<% if current_user_is_anonymous_creator(commentable) %> | ||
<p class="notice"> | ||
<%= ts("While this work is anonymous, comments you post will also be listed anonymously.") %> | ||
<%= ts("While this work is anonymous, comments you post will also be listed anonymously.") %> | ||
Check failure on line 38 in app/views/comments/_comment_form.html.erb GitHub Actions / ERB Lint runner
|
||
</p> | ||
<% end %> | ||
|
||
|
@@ -64,13 +64,6 @@ | |
<p class="footnote">(<%= allowed_html_instructions %>)</p> | ||
<% end %> | ||
|
||
<% elsif logged_in_as_admin? %> | ||
<h4 class="heading"><%= ts("Comment as") %> <span class="byline"><%= current_admin.login %></span> | ||
<%= f.hidden_field :name, :value => "#{current_admin.login}", :id => "comment_name_for_#{commentable.id}" %> | ||
<%= f.hidden_field :email, :value => "#{current_admin.email}", :id => "comment_email_for_#{commentable.id}" %> | ||
</h4> | ||
<p class="footnote">(<%= allowed_html_instructions %>)</p> | ||
|
||
<% else %> | ||
<dl> | ||
<dt class="landmark"><%= ts("Note") %>:</dt> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the behavior like with
format: :js
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely not great, as
<html><body>You are being <a href="http://www.example.com/">redirected</a>.</body></html>
is not valid JSON.Could be handled more nicely like 5ddfb2e... But seems a bit overkill for what I understand is an edge case (maybe I'm missing something?), where the user clicks in the Kudos button in one tab after having logged as admin in another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that does seem like overkill for the situation. Maybe just add a test showing no kudos is created and we'll leave it at that?