Revert "Revert "Change comment style (#67)" (#68)"

This reverts commit 0494a36681.
This commit is contained in:
Phuoc Dinh Le 2023-05-20 08:54:17 +09:00 committed by GitHub
parent 0494a36681
commit da2a11adf9
784 changed files with 696 additions and 307 deletions

0
judge/models/__init__.py Normal file → Executable file
View file

0
judge/models/bookmark.py Normal file → Executable file
View file

0
judge/models/choices.py Normal file → Executable file
View file

12
judge/models/comment.py Normal file → Executable file
View file

@ -56,6 +56,7 @@ class Comment(MPTTModel):
related_name="replies",
on_delete=CASCADE,
)
versions = VersionRelation()
class Meta:
@ -111,6 +112,15 @@ class Comment(MPTTModel):
if len(output) >= n:
return output
return output
@cached_property
def get_replies(self):
query = Comment.filter(parent=self)
return len(query)
@cached_property
def get_revisions(self):
return self.versions.count()
@cached_property
def page_title(self):
@ -141,7 +151,7 @@ class Comment(MPTTModel):
)
def get_absolute_url(self):
return "%s#comment-%d" % (self.link, self.id)
return "%s?comment-id=%d#comment-%d" % (self.link, self.id, self.id)
class CommentVote(models.Model):

0
judge/models/contest.py Normal file → Executable file
View file

0
judge/models/course.py Normal file → Executable file
View file

0
judge/models/interface.py Normal file → Executable file
View file

0
judge/models/message.py Normal file → Executable file
View file

0
judge/models/pagevote.py Normal file → Executable file
View file

0
judge/models/problem.py Normal file → Executable file
View file

0
judge/models/problem_data.py Normal file → Executable file
View file

0
judge/models/profile.py Normal file → Executable file
View file

0
judge/models/runtime.py Normal file → Executable file
View file

0
judge/models/submission.py Normal file → Executable file
View file

0
judge/models/ticket.py Normal file → Executable file
View file

0
judge/models/volunteer.py Normal file → Executable file
View file