Changeset - 1c4505e3be5b
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2013-02-20 02:15:12
marcin@python-works.com
show flags, and desc sort pull request based on created_date ref #765
3 files changed with 17 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -477,12 +477,16 @@ class SettingsController(BaseController)
 
        c.my_pull_requests = PullRequest.query()\
 
                                .filter(PullRequest.user_id ==
 
                                        self.rhodecode_user.user_id)\
 
                                .order_by(PullRequest.created_on.desc())\
 
                                .all()
 
        c.participate_in_pull_requests = \
 

	
 
        c.participate_in_pull_requests = sorted(
 
            [x.pull_request for x in PullRequestReviewers.query()\
 
                                    .filter(PullRequestReviewers.user_id ==
 
                                            self.rhodecode_user.user_id)\
 
                                    .all()]
 
                                    .all()],
 
                                    key=lambda o: o.created_on, reverse=True)
 

	
 
        return render('admin/users/user_edit_my_account_pullrequests.html')
 

	
 
    @NotAnonymous()
rhodecode/model/pull_request.py
Show inline comments
 
@@ -55,7 +55,7 @@ class PullRequestModel(BaseModel):
 
        repo = self._get_repo(repo)
 
        return PullRequest.query()\
 
                .filter(PullRequest.other_repo == repo)\
 
                .order_by(PullRequest.created_on)\
 
                .order_by(PullRequest.created_on.desc())\
 
                .all()
 

	
 
    def create(self, created_by, org_repo, org_ref, other_repo, other_ref,
 
@@ -78,7 +78,7 @@ class PullRequestModel(BaseModel):
 
        self.sa.add(new)
 
        Session().flush()
 
        #members
 
        for member in reviewers:
 
        for member in set(reviewers):
 
            _usr = self._get_user(member)
 
            reviewer = PullRequestReviewers(_usr, new)
 
            self.sa.add(reviewer)
 
@@ -116,6 +116,7 @@ class PullRequestModel(BaseModel):
 
            'pr_url': pr_url,
 
            'pr_revisions': revisions
 
        }
 

	
 
        notif.create(created_by=created_by_user, subject=subject, body=body,
 
                     recipients=reviewers,
 
                     type_=Notification.TYPE_PULL_REQUEST, email_kwargs=kwargs)
rhodecode/templates/admin/users/user_edit_my_account_pullrequests.html
Show inline comments
 
@@ -6,6 +6,10 @@
 
      <li>
 
        <div style="height: 12px">
 
          <div style="float:left">
 
          %if pull_request.is_closed():
 
              <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/>
 
          %endif
 
          <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" />          
 
          <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
          ${_('Pull request #%s opened on %s') % (pull_request.pull_request_id, h.fmt_date(pull_request.created_on))}
 
          </a>
 
@@ -29,6 +33,10 @@
 
      %for pull_request in c.participate_in_pull_requests:
 
      <li>
 
        <div style="height: 12px">
 
        %if pull_request.is_closed():
 
            <img src="${h.url('/images/icons/lock_go.png')}" title="${_('Closed')}"/>
 
        %endif
 
        <img src="${h.url('/images/icons/flag_status_%s.png' % str(pull_request.last_review_status))}" />          
 
        <a href="${h.url('pullrequest_show',repo_name=pull_request.other_repo.repo_name,pull_request_id=pull_request.pull_request_id)}">
 
        ${_('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))}
 
        </a>
0 comments (0 inline, 0 general)