# HG changeset patch # User Mads Kiilerich # Date 2014-07-04 14:12:06 # Node ID 7879d8d88672eb0a879233fa5a293a4dbe3d424e # Parent cc5300a1f2ac88b3b6a5a68595797c42176f1db0 pull requests: show changeset comment and status flags in the changelog for PRs diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -312,6 +312,7 @@ class ChangesetController(BaseRepoContro return render('changeset/changeset.html') else: c.cs_ranges_org = None + c.cs_comments = {} revs = [ctx.revision for ctx in reversed(c.cs_ranges)] c.jsdata = json.dumps(graph_data(c.db_repo_scm_instance, revs)) return render('changeset/changeset_range.html') diff --git a/kallithea/controllers/compare.py b/kallithea/controllers/compare.py --- a/kallithea/controllers/compare.py +++ b/kallithea/controllers/compare.py @@ -222,15 +222,13 @@ class CompareController(BaseRepoControll c.cs_ranges, c.cs_ranges_org, c.ancestor = self._get_changesets( org_repo.scm_instance.alias, org_repo.scm_instance, c.org_rev, other_repo.scm_instance, c.other_rev) - c.statuses = c.db_repo.statuses( - [x.raw_id for x in c.cs_ranges]) + raw_ids = [x.raw_id for x in c.cs_ranges] + c.cs_comments = other_repo.get_comments(raw_ids) + c.statuses = other_repo.statuses(raw_ids) revs = [ctx.revision for ctx in reversed(c.cs_ranges)] c.jsdata = json.dumps(graph_data(c.other_repo.scm_instance, revs)) - c.statuses = c.db_repo.statuses([x.raw_id for x in - c.cs_ranges]) - if partial: return render('compare/compare_cs.html') if merge and c.ancestor: diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -204,7 +204,9 @@ class PullrequestsController(BaseRepoCon revs = [ctx.revision for ctx in reversed(c.cs_ranges)] c.jsdata = json.dumps(graph_data(org_scm_instance, revs)) - c.statuses = c.org_repo.statuses([x.raw_id for x in c.cs_ranges]) + raw_ids = [x.raw_id for x in c.cs_ranges] + c.cs_comments = c.org_repo.get_comments(raw_ids) + c.statuses = c.org_repo.statuses(raw_ids) ignore_whitespace = request.GET.get('ignorews') == '1' line_context = request.GET.get('context', 3) diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css --- a/kallithea/public/css/style.css +++ b/kallithea/public/css/style.css @@ -2657,6 +2657,8 @@ BIN_FILENODE = 6 height: 41px; } +#pull_request_overview .comments-container, +#changeset_compare_view_content .comments-container, #graph_content .comments-container, #shortlog_data .comments-container, #graph_content .logtags { @@ -2761,13 +2763,14 @@ BIN_FILENODE = 6 padding: 3px 0; } +#pull_request_overview .comments-cnt a, +#changeset_compare_view_content .comments-cnt a, #graph_content .comments-cnt a, #shortlog_data .comments-cnt a { background-image: url('../images/icons/comments.png'); background-repeat: no-repeat; background-position: 100% 50%; padding: 5px 0; - padding-right: 20px; } .right .changes { 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 @@ -25,6 +25,16 @@ %endif + %if c.cs_comments.get(cs.raw_id): +
+ +
+ %endif ${cs.date}
gravatar