# HG changeset patch # User Marcin Kuzminski # Date 2020-09-27 17:33:46 # Node ID 6bf75c538ac4b6a92d721f0736ab64e04b78a6e2 # Parent a9e68bf1c431447baab239fd23bd3a4a79e05b04 sidebar: expose status indicator for general comments which changed review status. diff --git a/rhodecode/events/pullrequest.py b/rhodecode/events/pullrequest.py --- a/rhodecode/events/pullrequest.py +++ b/rhodecode/events/pullrequest.py @@ -145,7 +145,7 @@ class PullRequestCommentEvent(PullReques status = None if self.comment.status_change: - status = self.comment.status_change[0].status + status = self.comment.review_status data.update({ 'comment': { @@ -184,7 +184,7 @@ class PullRequestCommentEditEvent(PullRe status = None if self.comment.status_change: - status = self.comment.status_change[0].status + status = self.comment.review_status data.update({ 'comment': { diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -3881,6 +3881,16 @@ class ChangesetComment(Base, BaseModel): return self.get_index_from_version( self.pull_request_version_id, versions) + @property + def review_status(self): + if self.status_change: + return self.status_change[0].status + + @property + def review_status_lbl(self): + if self.status_change: + return self.status_change[0].status_lbl + def __repr__(self): if self.comment_id: return '' % self.comment_id diff --git a/rhodecode/templates/base/sidebar.mako b/rhodecode/templates/base/sidebar.mako --- a/rhodecode/templates/base/sidebar.mako +++ b/rhodecode/templates/base/sidebar.mako @@ -89,6 +89,7 @@ if is_pr: version_info = (' made in older version (v{})'.format(comment_ver_index) if is_from_old_ver == 'true' else ' made in this version') %> + diff --git a/rhodecode/templates/changeset/changeset_file_comment.mako b/rhodecode/templates/changeset/changeset_file_comment.mako --- a/rhodecode/templates/changeset/changeset_file_comment.mako +++ b/rhodecode/templates/changeset/changeset_file_comment.mako @@ -76,9 +76,9 @@ status_change_title = 'Status of review for commit {}'.format(h.short_id(comment.commit_id)) %> - +
- ${comment.status_change[0].status_lbl} + ${comment.review_status_lbl}
% else:
diff --git a/rhodecode/templates/ejs_templates/templates.html b/rhodecode/templates/ejs_templates/templates.html --- a/rhodecode/templates/ejs_templates/templates.html +++ b/rhodecode/templates/ejs_templates/templates.html @@ -196,6 +196,9 @@ if (show_disabled) {
File: <%- file_name -%> <% } else { %> + <% if (review_status) { %> + + <% } %> General TODO <% if (version_info) { %> <%= version_info %> @@ -210,6 +213,9 @@ if (show_disabled) {
File: <%- file_name -%> <% } else { %> + <% if (review_status) { %> + + <% } %> General comment <% if (version_info) { %> <%= version_info %>