##// END OF EJS Templates
show flags, and desc sort pull request based on created_date ref #765
marcink -
r3389:1c4505e3 beta
parent child Browse files
Show More
@@ -477,12 +477,16 class SettingsController(BaseController)
477 477 c.my_pull_requests = PullRequest.query()\
478 478 .filter(PullRequest.user_id ==
479 479 self.rhodecode_user.user_id)\
480 .order_by(PullRequest.created_on.desc())\
480 481 .all()
481 c.participate_in_pull_requests = \
482
483 c.participate_in_pull_requests = sorted(
482 484 [x.pull_request for x in PullRequestReviewers.query()\
483 485 .filter(PullRequestReviewers.user_id ==
484 486 self.rhodecode_user.user_id)\
485 .all()]
487 .all()],
488 key=lambda o: o.created_on, reverse=True)
489
486 490 return render('admin/users/user_edit_my_account_pullrequests.html')
487 491
488 492 @NotAnonymous()
@@ -55,7 +55,7 class PullRequestModel(BaseModel):
55 55 repo = self._get_repo(repo)
56 56 return PullRequest.query()\
57 57 .filter(PullRequest.other_repo == repo)\
58 .order_by(PullRequest.created_on)\
58 .order_by(PullRequest.created_on.desc())\
59 59 .all()
60 60
61 61 def create(self, created_by, org_repo, org_ref, other_repo, other_ref,
@@ -78,7 +78,7 class PullRequestModel(BaseModel):
78 78 self.sa.add(new)
79 79 Session().flush()
80 80 #members
81 for member in reviewers:
81 for member in set(reviewers):
82 82 _usr = self._get_user(member)
83 83 reviewer = PullRequestReviewers(_usr, new)
84 84 self.sa.add(reviewer)
@@ -116,6 +116,7 class PullRequestModel(BaseModel):
116 116 'pr_url': pr_url,
117 117 'pr_revisions': revisions
118 118 }
119
119 120 notif.create(created_by=created_by_user, subject=subject, body=body,
120 121 recipients=reviewers,
121 122 type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
@@ -6,6 +6,10
6 6 <li>
7 7 <div style="height: 12px">
8 8 <div style="float:left">
9 %if pull_request.is_closed():
10 <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/>
11 %endif
12 <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" />
9 13 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
10 14 ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
11 15 </a>
@@ -29,6 +33,10
29 33 %for pull_request in c.participate_in_pull_requests:
30 34 <li>
31 35 <div style="height: 12px">
36 %if pull_request.is_closed():
37 <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/>
38 %endif
39 <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" />
32 40 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
33 41 ${_('Pull request #%s opened by %s on %s') % (pull_request.pull_request_id, pull_request.author.full_name, h.fmt_date(pull_request.created_on))}
34 42 </a>
General Comments 0
You need to be logged in to leave comments. Login now