Skip to content
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

Ability to delete own comment #361

Open
sabyasachi opened this issue Dec 18, 2021 · 3 comments
Open

Ability to delete own comment #361

sabyasachi opened this issue Dec 18, 2021 · 3 comments
Assignees
Labels

Comments

@sabyasachi
Copy link

Creating a separate ticket as discussed in #162.

Users should be able to delete their own comments.

Any workaround till then?

@danirus
Copy link
Owner

danirus commented Dec 19, 2021

Thanks @sabyasachi.

An initial description of the user story could be:

  1. Enable comment deletion by setting COMMENTS_XTD_ALLOW_COMMENT_DELETION = True.
  2. Add a "Delete" link in the footer of the comment.
  3. Create a remove.html and removed.html templates. They will be used when not using the JavaScript plugin.
  4. The comment object will not be remove from the DB, as that would break the comment tree, but rather marked as removed by setting the is_removed attribute of the comment to True.
  5. It should be possible to connect to a new signal comment_removal_received to allow other apps do something additional when the a user sends a comment removal: maybe deleting the content of the comment attribute, or whatnot. So that signal must be sent within the user-request-comment-removal controller.
  6. If the user is authenticated, and the comment.user matches the authenticated user, the remove.html template will display a confirmation button to remove the comment. Once the user clicks the button, the removed.html template will confirm the user that comment has been removed.
  7. If the user is not authenticated the remove.html template should request the user to provide the email used to post the comment. In the controller, if the email provided doesn't match the comment's user_email attribute, it should simply ignore the request, but will inform the user that a confirmation email has been sent. The confirmation email shall be requested only when the email address provided by the user matches the comment's user_email.
  8. Add the required routes to the urlpatterns.
  9. There should be an implementation of this logic in the JavaScript plugin.

Let me know if I missed anything important. We could go further in detail. That's just a bullet point description of what shall be done. If anyone feels like working on it, please, feel free to ask. Otherwise I will do it sometime in the future.

@callmeUmer
Copy link

@danirus Is this issue still open ? if yes, I can definitely work on this.

@danirus
Copy link
Owner

danirus commented Feb 23, 2022

Sounds good @callmeUmer. I assign it to you.
Feel free to reach out here or by email (it is in my commits).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants