# HG changeset patch # User Mads Kiilerich # Date 1464019353 -7200 # Node ID 0cb43732260bb8922e3188fce024c26c6c7e89f6 # Parent 96779dba8b01768d4334c4d5e0215600e8bd1168 pullrequests: make it easier to see what needs attention on "my" list; list PRs needing attention separately diff -r 96779dba8b01 -r 0cb43732260b kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Tue May 17 23:10:33 2016 +0200 +++ b/kallithea/controllers/pullrequests.py Mon May 23 18:02:33 2016 +0200 @@ -219,11 +219,19 @@ 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 -r 96779dba8b01 -r 0cb43732260b kallithea/templates/pullrequests/pullrequest_show_my.html --- a/kallithea/templates/pullrequests/pullrequest_show_my.html Tue May 17 23:10:33 2016 +0200 +++ b/kallithea/templates/pullrequests/pullrequest_show_my.html Mon May 23 18:02:33 2016 +0200 @@ -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)}