Changeset - dcd1c159a132
[Not reviewed]
beta
0 2 0
Mads Kiilerich - 13 years ago 2013-02-04 22:34:47
madski@unity3d.com
pull request: don't show fake path with owner names - and owner avatars is also not relevant
2 files changed with 5 insertions and 21 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -111,63 +111,53 @@ class PullrequestsController(BaseRepoCon
 
            raise HTTPNotFound
 

	
 
        try:
 
            org_repo.scm_instance.get_changeset()
 
        except EmptyRepositoryError, e:
 
            h.flash(h.literal(_('There are no changesets yet')),
 
                    category='warning')
 
            redirect(url('summary_home', repo_name=org_repo.repo_name))
 

	
 
        other_repos_info = {}
 

	
 
        c.org_repos = []
 
        c.org_repos.append((org_repo.repo_name, '%s/%s' % (
 
                                org_repo.user.username, org_repo.repo_name))
 
                           )
 
        c.org_repos.append((org_repo.repo_name, org_repo.repo_name))
 
        c.default_org_repo = org_repo.repo_name
 
        c.org_refs, c.default_org_ref = self._get_repo_refs(org_repo.scm_instance)
 

	
 
        c.other_repos = []
 
        # add org repo to other so we can open pull request against itself
 
        c.other_repos.extend(c.org_repos)
 
        c.default_other_repo = org_repo.repo_name
 
        c.default_other_refs, c.default_other_ref = self._get_repo_refs(org_repo.scm_instance)
 
        other_repos_info[org_repo.repo_name] = {
 
            'gravatar': h.gravatar_url(org_repo.user.email, 24),
 
            'description': org_repo.description,
 
            'revs': h.select('other_ref', c.default_other_ref, c.default_other_refs, class_='refs')
 
        }
 

	
 
        # gather forks and add to this list ... even though it is rare to request forks to pull their parent
 
        for fork in org_repo.forks:
 
            c.other_repos.append((fork.repo_name, '%s/%s' % (
 
                                    fork.user.username, fork.repo_name))
 
                                 )
 
            c.other_repos.append((fork.repo_name, fork.repo_name))
 
            refs, default_ref = self._get_repo_refs(fork.scm_instance)
 
            other_repos_info[fork.repo_name] = {
 
                'gravatar': h.gravatar_url(fork.user.email, 24),
 
                'description': fork.description,
 
                'revs': h.select('other_ref', default_ref, refs, class_='refs')
 
            }
 

	
 
        # add parents of this fork also, but only if it's not empty
 
        if org_repo.parent and org_repo.parent.scm_instance.revisions:
 
            c.default_other_repo = org_repo.parent.repo_name
 
            c.default_other_refs, c.default_other_ref = self._get_repo_refs(org_repo.parent.scm_instance)
 
            c.other_repos.append((org_repo.parent.repo_name, '%s/%s' % (
 
                                        org_repo.parent.user.username,
 
                                        org_repo.parent.repo_name))
 
                                     )
 
            c.other_repos.append((org_repo.parent.repo_name, org_repo.parent.repo_name))
 
            other_repos_info[org_repo.parent.repo_name] = {
 
                'gravatar': h.gravatar_url(org_repo.parent.user.email, 24),
 
                'description': org_repo.parent.description,
 
                'revs': h.select('other_ref', c.default_other_ref, c.default_other_refs, class_='refs')
 
            }
 

	
 
        c.other_repos_info = json.dumps(other_repos_info)
 
        c.review_members = [org_repo.user]
 
        return render('/pullrequests/pullrequest.html')
 

	
 
    @NotAnonymous()
 
    def create(self, repo_name):
 
        repo = RepoModel()._get_repo(repo_name)
 
        try:
rhodecode/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -17,45 +17,39 @@
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 
    ${h.form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')}
 
    <div style="float:left;padding:0px 30px 30px 30px">
 
        <input type="hidden" name="rev_start" value="${request.GET.get('rev_start')}" />
 
        <input type="hidden" name="rev_end" value="${request.GET.get('rev_end')}" />
 

	
 
        ##ORG
 
        <div style="float:left">
 
            <div class="fork_user">
 
                <div class="gravatar">
 
                    <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_db_repo.user.email,24)}"/>
 
                </div>
 
            <div>
 
                <span style="font-size: 20px">
 
                ${h.select('org_repo','',c.org_repos,class_='refs')}:${h.select('org_ref',c.default_org_ref,c.org_refs,class_='refs')}
 
                </span>
 
                 <div style="padding:5px 3px 3px 42px;">${c.rhodecode_db_repo.description}</div>
 
            </div>
 
            <div style="clear:both;padding-top: 10px"></div>
 
        </div>
 
          <div style="float:left;font-size:24px;padding:0px 20px">
 
          <img height=32 width=32 src="${h.url('/images/arrow_right_64.png')}"/>
 
          </div>
 

	
 
        ##OTHER, most Probably the PARENT OF THIS FORK
 
        <div style="float:left">
 
            <div class="fork_user">
 
                <div class="gravatar">
 
                    <img id="other_repo_gravatar" alt="gravatar" src=""/>
 
                </div>
 
            <div>
 
                <span style="font-size: 20px">
 
                ${h.select('other_repo',c.default_other_repo,c.other_repos,class_='refs')}:${h.select('other_ref',c.default_other_ref,c.default_other_refs,class_='refs')}
 
                </span>
 
                 <div id="other_repo_desc" style="padding:5px 3px 3px 42px;"></div>
 
            </div>
 
            <div style="clear:both;padding-top: 10px"></div>
 
        </div>
 
       <div style="clear:both;padding-top: 10px"></div>
 
       ## overview pulled by ajax
 
       <div style="float:left" id="pull_request_overview"></div>
 
       <div style="float:left;clear:both;padding:10px 10px 10px 0px;display:none">
 
            <a id="pull_request_overview_url" href="#">${_('Detailed compare view')}</a>
0 comments (0 inline, 0 general)