##// 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 c.my_pull_requests = PullRequest.query()\
477 c.my_pull_requests = PullRequest.query()\
478 .filter(PullRequest.user_id ==
478 .filter(PullRequest.user_id ==
479 self.rhodecode_user.user_id)\
479 self.rhodecode_user.user_id)\
480 .order_by(PullRequest.created_on.desc())\
480 .all()
481 .all()
481 c.participate_in_pull_requests = \
482
483 c.participate_in_pull_requests = sorted(
482 [x.pull_request for x in PullRequestReviewers.query()\
484 [x.pull_request for x in PullRequestReviewers.query()\
483 .filter(PullRequestReviewers.user_id ==
485 .filter(PullRequestReviewers.user_id ==
484 self.rhodecode_user.user_id)\
486 self.rhodecode_user.user_id)\
485 .all()]
487 .all()],
488 key=lambda o: o.created_on, reverse=True)
489
486 return render('admin/users/user_edit_my_account_pullrequests.html')
490 return render('admin/users/user_edit_my_account_pullrequests.html')
487
491
488 @NotAnonymous()
492 @NotAnonymous()
@@ -55,7 +55,7 class PullRequestModel(BaseModel):
55 repo = self._get_repo(repo)
55 repo = self._get_repo(repo)
56 return PullRequest.query()\
56 return PullRequest.query()\
57 .filter(PullRequest.other_repo == repo)\
57 .filter(PullRequest.other_repo == repo)\
58 .order_by(PullRequest.created_on)\
58 .order_by(PullRequest.created_on.desc())\
59 .all()
59 .all()
60
60
61 def create(self, created_by, org_repo, org_ref, other_repo, other_ref,
61 def create(self, created_by, org_repo, org_ref, other_repo, other_ref,
@@ -78,7 +78,7 class PullRequestModel(BaseModel):
78 self.sa.add(new)
78 self.sa.add(new)
79 Session().flush()
79 Session().flush()
80 #members
80 #members
81 for member in reviewers:
81 for member in set(reviewers):
82 _usr = self._get_user(member)
82 _usr = self._get_user(member)
83 reviewer = PullRequestReviewers(_usr, new)
83 reviewer = PullRequestReviewers(_usr, new)
84 self.sa.add(reviewer)
84 self.sa.add(reviewer)
@@ -116,6 +116,7 class PullRequestModel(BaseModel):
116 'pr_url': pr_url,
116 'pr_url': pr_url,
117 'pr_revisions': revisions
117 'pr_revisions': revisions
118 }
118 }
119
119 notif.create(created_by=created_by_user, subject=subject, body=body,
120 notif.create(created_by=created_by_user, subject=subject, body=body,
120 recipients=reviewers,
121 recipients=reviewers,
121 type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
122 type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
@@ -6,6 +6,10
6 <li>
6 <li>
7 <div style="height: 12px">
7 <div style="height: 12px">
8 <div style="float:left">
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 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
13 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
10 ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
14 ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
11 </a>
15 </a>
@@ -29,6 +33,10
29 %for pull_request in c.participate_in_pull_requests:
33 %for pull_request in c.participate_in_pull_requests:
30 <li>
34 <li>
31 <div style="height: 12px">
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 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
40 <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
33 ${_('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))}
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 </a>
42 </a>
General Comments 0
You need to be logged in to leave comments. Login now