diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -2183,6 +2183,13 @@ class ChangesetComment(Base, BaseModel): q = q.filter(cls.pull_request_id == pull_request_id) return q.all() + def url(self): + anchor = "comment-%s" % self.comment_id + import kallithea.lib.helpers as h + if self.revision: + return h.url('changeset_home', repo_name=self.repo.repo_name, revision=self.revision, anchor=anchor) + elif self.pull_request_id is not None: + return self.pull_request.url(anchor=anchor) class ChangesetStatus(Base, BaseModel): __tablename__ = 'changeset_statuses' diff --git a/kallithea/templates/changelog/changelog.html b/kallithea/templates/changelog/changelog.html --- a/kallithea/templates/changelog/changelog.html +++ b/kallithea/templates/changelog/changelog.html @@ -93,7 +93,7 @@ ${self.repo_context_bar('changelog', c.f %else: - + %endif @@ -122,7 +122,7 @@ ${self.repo_context_bar('changelog', c.f %if c.comments.get(cs.raw_id):
- + ${len(c.comments[cs.raw_id])} diff --git a/kallithea/templates/changelog/changelog_summary_data.html b/kallithea/templates/changelog/changelog_summary_data.html --- a/kallithea/templates/changelog/changelog_summary_data.html +++ b/kallithea/templates/changelog/changelog_summary_data.html @@ -31,7 +31,7 @@ %if c.comments.get(cs.raw_id,[]):
- + ${len(c.comments[cs.raw_id])}
diff --git a/kallithea/templates/changeset/changeset_file_comment.html b/kallithea/templates/changeset/changeset_file_comment.html --- a/kallithea/templates/changeset/changeset_file_comment.html +++ b/kallithea/templates/changeset/changeset_file_comment.html @@ -22,7 +22,7 @@ %else: ${_('on this changeset')} %endif - + %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or co.author.user_id == c.authuser.user_id: diff --git a/kallithea/templates/compare/compare_cs.html b/kallithea/templates/compare/compare_cs.html --- a/kallithea/templates/compare/compare_cs.html +++ b/kallithea/templates/compare/compare_cs.html @@ -28,7 +28,7 @@ %if c.cs_comments.get(cs.raw_id):