Allow moderation of public article comments #354
No reviewers
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha!354
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "article-moderation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I further improved this PR, replacing the predefined reasons with a free-form input for reasons (which does remove the translations), allowing comments to be deleted (and undeleted) as well, and made the editing interface a bit more adaptive (i.e. change wordings based on whether a comment is already moderated or not).
There are a few commits that modify HTMLForm, adding methods related to select dropdowns, which are now no longer used. But since they're likely to be useful in the future, I've left these commits in the PR.
I did a force push for easier review of the complete changes.
@ -499,0 +510,4 @@throw new LogicException("Form field \"$name\" not found");else if ($found->count() > 1)throw new LogicException("Form field \"$name\" found multiple times");use type hinting at
$field.and also at
$attributesuse type hinting
use strikt comparison
!==the name of this variable is a bit confusion, it's not always hidden.
remove the second blank line
use typehinting
@ -1109,0 +1324,4 @@$li->addClass('hidden');$details = $this->html->createElement('details')->appendTo($li);$placeholder = $this->html->createElement('summary')->appendTo($details);$commentHtml->appendTo($details);$resolvedis never passedIt would be more diverse if the class would be separated so that all comments get the "
comment" class and the first comment would get "first" as well.@ -499,0 +510,4 @@throw new LogicException("Form field \"$name\" not found");else if ($found->count() > 1)throw new LogicException("Form field \"$name\" found multiple times");Right, I did the comments, but then it is still useful to use PHP-readable hints as well, of course.
Fixed.
@ -1109,0 +1324,4 @@$li->addClass('hidden');$details = $this->html->createElement('details')->appendTo($li);$placeholder = $this->html->createElement('summary')->appendTo($details);$commentHtml->appendTo($details);w00ps, fixed :-)
Fixed.
Maybe, or maybe using
:first-childcould remove the need for this class entirely. However, this just moves the existing class, so I'm going to consider this out of scope for the PR for now.Do you mean that "hidden" is confusing in general, because you can still show the comment by expanding it? This is true, but I couldn't think of any better name ("hidden-by-default" is too complicated, I think). And it is hidden, it's just also
possible to reveal what's hidden :-)
Or do you mean that this particular button does not always hide the comment, it sometimes only changes the reason? That's not really what happens in practice, though, since this button always uses the HIDE command, so it always sets the moderate-status to hidden and sets the moderate-reason. So if the status is already hidden, this (in the view of the user) only changes the reason, but underwater it still does both.
Maybe this clarifies things? If not, let me know what you mean exactly, and maybe you also have a suggestion to improve?
Fixed.
Fixed.
I think I misread the
$hidden = $comment->getAttribute(self::FIELD_NAME_DISCUSSION_MODERATION_STATUS) === self::MODERATION_STATUS_HIDDEN;for$hidden = $comment->getAttribute(self::FIELD_NAME_DISCUSSION_MODERATION_STATUS);.My bad.
agreed
Thanks! I squashed the fixups and will merge now.