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

Change comment style #70

Merged
merged 12 commits into from
May 22, 2023
Merged

Change comment style #70

merged 12 commits into from
May 22, 2023

Conversation

zhaospei
Copy link
Collaborator

No description provided.

@zhaospei zhaospei requested a review from cuom1999 May 20, 2023 05:14
@cuom1999
Copy link
Contributor

Thanks em!

make_style.sh thì nên để 755 để có thể chạy được nhưng để anh sửa cũng được.

@cuom1999 cuom1999 merged commit 1056a47 into LQDJudge:master May 22, 2023
Copy link
Contributor

@cuom1999 cuom1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anh có vài góp ý nhỏ. Anh code lại trong 57ded6f luôn rồi.

if parrent_none:
queryset = queryset.filter(parent=None, hidden=False)
if (comment_remove != -1):
queryset.get(pk=comment_remove).delete()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chỗ này tạo ra bug: comment bị xóa khỏi DB. Thay vào đó, dùng queryset.exclude

.annotate(
count_replies=Count("replies", distinct=True),
revisions=Count("versions", distinct=True),
)[offset:offset+limit]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chỗ này có 1 bug khi pre_query != None. Khi đó offset = 1, và sau khi loại bỏ pre_query thì sẽ bị thiếu thằng 0 trong queryset. Đúng thì offset nên bằng 0 (và logic comment_more cần sửa chút)

{% else %}
{% include "comments/content-list.html" %}
{% endif %}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic cái này và content-list gần như giống nhau. Mình có thể hợp vào làm một để tránh lặp code

@@ -151,40 +152,92 @@ def post(self, request, *args, **kwargs):
return self.render_to_response(context)

def get(self, request, *args, **kwargs):
pre_query = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nên dùng từ dễ hiểu hơn, ví dụ như target_comment thay vì pre_query

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const comment_remove = urlParams.get('comment-id');
console.log(comment_remove);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log :))

@zhaospei
Copy link
Collaborator Author

Anh có vài góp ý nhỏ. Anh code lại trong 57ded6f luôn rồi.

Dạ vâng, em cảm ơn anh nhiều ạ !

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

Successfully merging this pull request may close these issues.

2 participants