# HG changeset patch # User Mads Kiilerich # Date 2016-05-23 18:02:33 # Node ID 0cb43732260bb8922e3188fce024c26c6c7e89f6 # Parent 96779dba8b01768d4334c4d5e0215600e8bd1168 pullrequests: make it easier to see what needs attention on "my" list; list PRs needing attention separately diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -219,11 +219,19 @@ class PullrequestsController(BaseRepoCon self.authuser.user_id) \ .all()) - c.participate_in_pull_requests = _filter(PullRequest.query() \ - .join(PullRequestReviewers) \ + c.participate_in_pull_requests = [] + c.participate_in_pull_requests_todo = [] + done_status = set([ChangesetStatus.STATUS_APPROVED, ChangesetStatus.STATUS_REJECTED]) + for pr in _filter(PullRequest.query() + .join(PullRequestReviewers) .filter(PullRequestReviewers.user_id == - self.authuser.user_id) \ - ) + self.authuser.user_id) + ): + status = pr.user_review_status(c.authuser.user_id) # very inefficient!!! + if status in done_status: + c.participate_in_pull_requests.append(pr) + else: + c.participate_in_pull_requests_todo.append(pr) return render('/pullrequests/pullrequest_show_my.html') diff --git a/kallithea/templates/pullrequests/pullrequest_show_my.html b/kallithea/templates/pullrequests/pullrequest_show_my.html --- a/kallithea/templates/pullrequests/pullrequest_show_my.html +++ b/kallithea/templates/pullrequests/pullrequest_show_my.html @@ -35,6 +35,9 @@
${_('Pull Requests Created by Me')}
${pullrequest_data.pullrequest_overview(c.my_pull_requests)} +
${_('Pull Requests Needing My Review')}
+ ${pullrequest_data.pullrequest_overview(c.participate_in_pull_requests_todo)} +
${_('Pull Requests I Participate In')}
${pullrequest_data.pullrequest_overview(c.participate_in_pull_requests)}