danirus / django-comments-xtd

A pluggable Django comments application with thread support, follow-up notifications, mail confirmation, like/dislike flags, moderation, a ReactJS plugin and Bootstrap 5.3.
https://django-comments-xtd.readthedocs.io
BSD 2-Clause "Simplified" License
594 stars 157 forks source link

Editing comment #162

Open saivineeth100 opened 4 years ago

saivineeth100 commented 4 years ago

Users Ability to delete and edit the comment if he is the owner of comment.

danirus commented 4 years ago

I'm not sure about this feature. Comments posted after the modified one might loose sense altogether.

saivineeth100 commented 4 years ago

Let's take facebook comments system we can edit comments (also we can see comments history), if user want to delete comment he can delete the comment fully.

danirus commented 4 years ago

I think it would be a nice use case to build along with any of these model history apps. I don't think there's so much missing in django-comments-xtd to implement it. However I have very limited time, I can't work on it now. But if you want to put time on it I will be glad to assist you. Otherwise I will revisit the idea in the (I hope not so far) future.

ashwani99 commented 4 years ago

Hi @danirus Thanks for this awesome comments package django-comments-xtd. I would like to implement this feature. Can you give me some pointers where should I start?

danirus commented 4 years ago

Giving a commenter the chance to change a comment opens up some scenarios. A simple one is to allow editing only during N minutes since it was posted, or until another comment comes down the list or down the thread. I'm not sure of the benefit of going beyond that, allowing time unlimited edition could easily lead to a sensation of disconnection between the comments. It seems such a dynamism belongs to chats more than comments. What do you think?

While the feature gets shaped I would start exploring apps from the model-audit grid to get inspired.

ashwani99 commented 4 years ago

Editing comments do open open up different scenarios. Can we try and keep it more generic? Perhaps a function or property of the comment that decides if it can be edited or not. Why I am saying this is because for different applications, the window to make comments editable may vary. A few I can think of as of now:

Also, that brings me another scenario, after a comment has been edited can it be deleted or not?

What are your thoughts on this?

danirus commented 4 years ago

I do agree about the function that returns a True or False indicating whether a comment can be edited or not. The function should be customizable via a setting. It can default to the path to a function (maybe in models.py) that returns a False, so that by default comments are not editable. That would make the feature backward compatible. The function receives the comment as a param. The object the comment was sent to, blog post or whatnot, is accessible via the comment. So any decision that depends on flags, reactions or the object subject of the comment are accessible via the comment itself.

Another thing to consider is that checking whether a comment is editable reduces query performance when listing comments. So the option to edit a comment could be added in the template for authenticated users, and with an additional email containing the edit-comment link that could be sent after the visitor has confirm the comment via email.

About deleting a comment, it's a good point. I think a comment's author should have the right to delete its own comment, via mail confirmation when it's not an authenticated user, in the same way as it works when posting. But let's make a new ticket for it.

tian-yan commented 2 years ago

Hi, just curious, is this new feature still in progress or already committed ? thanks