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 158 forks source link

Issue 210 #245

Closed danirus closed 3 years ago

danirus commented 3 years ago

The issue-210 per-se is done with this PR, however the JavaScript part of the ticket needs to be integrated with the rest of the project. Such integration which will be done as part of the ticket #161.

Fixes issue #210, about listing top comments. Since v3.0.0 there is a new way to receive user feedback on comments. The model CommentFlag is no longer used to store such feedback. There is a new model CommentReaction that stores user reactions to comments. For each pair reaction/comment there is a counter and a list of reaction authors, this way it is possible to retrieve comments by their reactions. In addition there is new frontend code to handle user reactions. To get aligned with issue #161, the new frontend to handle reactions doesn't have additional dependencies, it's a pure JavaScript module.