feat: 添加评论删除功能#20
Merged
Merged
Conversation
aba2222
reviewed
Feb 21, 2026
| <span> | ||
| <small class="text-muted">{{ comment.created_at|date:"Y-m-d H:i" }}</small> | ||
| {% if comment.author == request.user %} | ||
| <form method="post" action="{% url 'comment_delete' comment_id=comment.id %}" class="d-inline ms-2" onsubmit="return confirm('确定删除这条评论吗?')"> |
Owner
There was a problem hiding this comment.
这样的弹窗确认过于简单了,最好有像删除用户或帖子一样的输入确认。弹出或跳转出一个确认框要求输入正确文本才可删除的更安全和风格统一。
Contributor
Author
There was a problem hiding this comment.
使用了个位数加法来进行验证并统一了样式
Owner
|
你能解决一下分支的冲突吗? |
使用随机加法验证替代简单弹窗,风格与帖子删除页面统一。 解决分支冲突,合并楼层号功能。
8873583 to
4e768ed
Compare
aba2222
approved these changes
Feb 23, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Changes
forum/views.py: 新增comment_delete_view,校验评论作者身份后删除forum/urls.py: 新增comments/<id>/delete/路由forum/templates/forum/post_detail.html: 评论区添加删除按钮(仅作者可见)