Files @ ffd45b185016
Branch filter:

Location: kallithea/rhodecode/templates/pullrequests/pullrequest_show.html - annotation

Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5.

This imports changes between changesets 21af6c4eab3d and 6177597791c2 in
RhodeCode's original repository, including only changes to Python files and HTML.

RhodeCode clearly licensed its changes to these files under GPLv3
in their /LICENSE file, which states the following:
The Python code and integrated HTML are licensed under the GPLv3 license.

(See:
https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE
or
http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE
for an online copy of that LICENSE file)

Conservancy reviewed these changes and confirmed that they can be licensed as
a whole to the Kallithea project under GPLv3-only.

While some of the contents committed herein are clearly licensed
GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the
statement above from RhodeCode indicates that they intend GPLv3-only as their
license, per GPLv3§14 and other relevant sections of GPLv3.
f29469677319
f29469677319
f29469677319
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
f29469677319
f29469677319
f29469677319
f29469677319
f29469677319
f29469677319
2ea981f9da79
2ea981f9da79
2ea981f9da79
2ea981f9da79
f29469677319
072a37c44f58
f29469677319
f29469677319
f29469677319
f29469677319
f29469677319
8a8a559eaf95
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
7224882c4059
7224882c4059
7224882c4059
cb40b3f6428c
7224882c4059
7224882c4059
7224882c4059
7224882c4059
ffd45b185016
ffd45b185016
95ec841bfe1f
79abd21d51c4
79abd21d51c4
79abd21d51c4
8a8a559eaf95
8a8a559eaf95
95ec841bfe1f
7224882c4059
7224882c4059
7224882c4059
7224882c4059
7224882c4059
7224882c4059
7224882c4059
7224882c4059
7224882c4059
b1822f4a85ca
b58ed6d608cc
b1822f4a85ca
ec6354949623
b1822f4a85ca
7224882c4059
acc05c33cc0c
2ab2eed4a70a
2ab2eed4a70a
2ab2eed4a70a
2ab2eed4a70a
2ab2eed4a70a
2ab2eed4a70a
6eaee7e2829e
6eaee7e2829e
6eaee7e2829e
3608f15f51ed
3608f15f51ed
3608f15f51ed
3608f15f51ed
ffd45b185016
3608f15f51ed
2ab2eed4a70a
2ab2eed4a70a
81bbb8086f03
0dfe7eaf21cb
0dfe7eaf21cb
6ff98871247a
0dfe7eaf21cb
0dfe7eaf21cb
ffd45b185016
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
0dfe7eaf21cb
7224882c4059
acc05c33cc0c
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
ffd45b185016
8eab81115660
ffd45b185016
4d3032431d4f
3f50a5e8fc4d
4d3032431d4f
1fd3c043c025
4d3032431d4f
4d3032431d4f
4d3032431d4f
c2a206162062
4d3032431d4f
685ebc84c2e9
4d3032431d4f
c2a206162062
685ebc84c2e9
c2a206162062
c2a206162062
c2a206162062
c2a206162062
c2a206162062
685ebc84c2e9
c2a206162062
c2a206162062
c2a206162062
c2a206162062
c2a206162062
4d3032431d4f
4d3032431d4f
4d3032431d4f
4d3032431d4f
4d3032431d4f
4d3032431d4f
4d3032431d4f
c2a206162062
ec6354949623
685ebc84c2e9
4d3032431d4f
4d3032431d4f
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
ffd45b185016
cb40b3f6428c
a0adf8db1416
3f50a5e8fc4d
cb40b3f6428c
cb40b3f6428c
cb40b3f6428c
cb40b3f6428c
fe2bb88bf7ac
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
c2a206162062
ec6354949623
c2a206162062
c2a206162062
1bc579bcd67a
1bc579bcd67a
1bc579bcd67a
a0adf8db1416
d5e42c00f3c1
58c529332e7e
aad51f79d040
d5e42c00f3c1
58c529332e7e
58c529332e7e
58c529332e7e
58c529332e7e
fd4ea41c2dc1
fd4ea41c2dc1
58c529332e7e
a0adf8db1416
a0adf8db1416
a0adf8db1416
b4f401524060
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
a0adf8db1416
68f9c216377d
3f50a5e8fc4d
cb40b3f6428c
3f50a5e8fc4d
a0adf8db1416
a0adf8db1416
a0adf8db1416
f29469677319
f29469677319
f29469677319
<%inherit file="/base/base.html"/>

<%def name="title()">
    ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)}
    %if c.rhodecode_name:
        &middot; ${c.rhodecode_name}
    %endif
</%def>

<%def name="breadcrumbs_links()">
    ${_('Pull request #%s') % c.pull_request.pull_request_id}
</%def>

<%def name="page_nav()">
    ${self.menu('repositories')}
</%def>

<%def name="main()">
${self.repo_context_bar('showpullrequest')}
<div class="box">
    <!-- box / title -->
    <div class="title">
        ${self.breadcrumbs()}
    </div>

    <div class="form" style="float: left">
        <div class="pr-details-title ${'closed' if c.pull_request.is_closed() else ''}">
            ${_('Title')}: ${c.pull_request.title}
            %if c.pull_request.is_closed():
                (${_('Closed')})
            %endif
        </div>
      <div id="summary" class="fields">
         <div class="field">
          <div class="label-summary">
              <label>${_('Review status')}:</label>
          </div>
          <div class="input">
            <div class="changeset-status-container" style="float:none;clear:both">
            %if c.current_changeset_status:
              <div class="changeset-status-ico" style="padding:0px 4px 0px 0px">
                  <img src="${h.url('/images/icons/flag_status_%s.png' % c.current_changeset_status)}" title="${_('Pull request status calculated from votes')}"/></div>
              <div class="changeset-status-lbl tooltip" title="${_('Pull request status calculated from votes')}">
                %if c.pull_request.is_closed():
                    ${_('Closed')},
                %endif
                ${h.changeset_status_lbl(c.current_changeset_status)}
              </div>

            %endif
            </div>
          </div>
         </div>
         <div class="field">
          <div class="label-summary">
              <label>${_('Still not reviewed by')}:</label>
          </div>
          <div class="input">
            % if len(c.pull_request_pending_reviewers) > 0:
                <div class="tooltip" title="${h.tooltip(', '.join([x.username for x in c.pull_request_pending_reviewers]))}">${ungettext('%d reviewer', '%d reviewers',len(c.pull_request_pending_reviewers)) % len(c.pull_request_pending_reviewers)}</div>
            %else:
                <div>${_('Pull request was reviewed by all reviewers')}</div>
            %endif
          </div>
         </div>
         <div class="field">
          <div class="label-summary">
              <label>${_('Origin repository')}:</label>
          </div>
          <div class="input">
              <div>

              ## branch link is only valid if it is a branch
              <span class="spantag"><a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name, anchor=c.pull_request.org_ref_parts[1])}">${c.pull_request.org_ref_parts[0]}: ${c.pull_request.org_ref_parts[1]}</a></span>
              <span>
               %if h.is_hg(c.pull_request.org_repo):
                 | ${_('Pull changes')} <span style="font-family: monospace">hg pull -r ${h.short_id(c.cs_ranges[-1].raw_id)} <a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span>
               %elif h.is_git(c.pull_request.org_repo):
                 | ${_('Pull changes')} <span style="font-family: monospace">git pull <a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a> ${c.pull_request.org_ref_parts[1]} </span>
               %endif
              </div>
          </div>
         </div>
         <div class="field">
          <div class="label-summary">
              <label>${_('Description')}:</label>
          </div>
          <div class="input">
              <div style="white-space:pre-wrap">${h.urlify_commit(c.pull_request.description, c.repo_name)}</div>
          </div>
         </div>
         <div class="field">
          <div class="label-summary">
              <label>${_('Created on')}:</label>
          </div>
          <div class="input">
              <div>${h.fmt_date(c.pull_request.created_on)}</div>
          </div>
         </div>
      </div>
    </div>
    ## REVIEWERS
    <div style="float:left; border-left:1px dashed #eee">
       <div class="pr-details-title">${_('Pull request reviewers')}</div>
        <div id="reviewers" style="padding:0px 0px 5px 10px">
          ## members goes here !
          <div style="min-height:30px">
            <ul id="review_members" class="group_members">
            %for member,status in c.pull_request_reviewers:
              <li id="reviewer_${member.user_id}">
                <div class="reviewers_member">
                    <div class="reviewer_status tooltip" title="${h.tooltip(h.changeset_status_lbl(status[0][1].status if status else 'not_reviewed'))}">
                      <img src="${h.url(str('/images/icons/flag_status_%s.png' % (status[0][1].status if status else 'not_reviewed')))}"/>
                    </div>
                  <div class="reviewer_gravatar gravatar"><img alt="gravatar" src="${h.gravatar_url(member.email,14)}"/> </div>
                  <div style="float:left;">${member.full_name} (${_('owner') if c.pull_request.user_id == member.user_id else _('reviewer')})</div>
                  <input type="hidden" value="${member.user_id}" name="review_members" />
                  %if not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.user_id == c.rhodecode_user.user_id):
                  <div class="reviewer_member_remove action_button" onclick="removeReviewMember(${member.user_id})">
                      <i class="icon-remove-sign" style="color: #FF4444;"></i>
                  </div>
                  %endif
                </div>
              </li>
            %endfor
            </ul>
          </div>
          %if not c.pull_request.is_closed():
          <div class='ac'>
            %if h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) or c.pull_request.author.user_id == c.rhodecode_user.user_id:
            <div class="reviewer_ac">
               ${h.text('user', class_='yui-ac-input')}
               <span class="help-block">${_('Add or remove reviewer to this pull request.')}</span>
               <div id="reviewers_container"></div>
            </div>
            <div style="padding:0px 10px">
             <span id="update_pull_request" class="btn btn-mini">${_('Save Changes')}</span>
            </div>
            %endif
          </div>
          %endif
        </div>
       </div>

    <div style="overflow: auto; clear: both">
      ##DIFF
      <div class="table" style="float:left;clear:none">
          <div id="body" class="diffblock">
              <div style="white-space:pre-wrap;padding:5px">${_('Compare view')}</div>
          </div>
          <div id="changeset_compare_view_content">
              ##CS
              <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)}</div>
              <%include file="/compare/compare_cs.html" />

              ## FILES
              <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">

              % if c.limited_diff:
                  ${ungettext('%s file changed', '%s files changed', len(c.files)) % len(c.files)}
              % else:
                  ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.files)) % (len(c.files),c.lines_added,c.lines_deleted)}:
              %endif

              </div>
              <div class="cs_files">
                %if not c.files:
                   <span class="empty_data">${_('No files')}</span>
                %endif
                %for fid, change, f, stat in c.files:
                    <div class="cs_${change}">
                      <div class="node">${h.link_to(h.safe_unicode(f),h.url.current(anchor=fid))}</div>
                      <div class="changes">${h.fancy_file_stats(stat)}</div>
                    </div>
                %endfor
              </div>
              % if c.limited_diff:
                <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h5>
              % endif
          </div>
      </div>
    </div>
    <script>
    var _USERS_AC_DATA = ${c.users_array|n};
    var _GROUPS_AC_DATA = ${c.user_groups_array|n};
    // TODO: switch this to pyroutes
    AJAX_COMMENT_URL = "${url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id)}";
    AJAX_COMMENT_DELETE_URL = "${url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__')}";

    pyroutes.register('pullrequest_comment', "${url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']);
    pyroutes.register('pullrequest_comment_delete', "${url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s')}", ['repo_name', 'comment_id']);
    pyroutes.register('pullrequest_update', "${url('pullrequest_update',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s')}", ['repo_name', 'pull_request_id']);

    </script>

    ## diff block
    <%namespace name="diff_block" file="/changeset/diff_block.html"/>
    %for fid, change, f, stat in c.files:
      ${diff_block.diff_block_simple([c.changes[fid]])}
    %endfor
    % if c.limited_diff:
      <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}" onclick="return confirm('${_("Showing a huge diff might take some time and resources")}')">${_('Show full diff')}</a></h4>
    % endif


    ## template for inline comment form
    <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
    ${comment.comment_inline_form()}

    ## render comments and inlines
    ${comment.generate_comments(include_pr=True)}

    % if not c.pull_request.is_closed():
      ## main comment form and it status
      ${comment.comments(h.url('pullrequest_comment', repo_name=c.repo_name,
                                pull_request_id=c.pull_request.pull_request_id),
                         c.current_changeset_status,
                         is_pr=True, change_status=c.allowed_to_change_status)}
    %endif

    <script type="text/javascript">
      YUE.onDOMReady(function(){
          PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA, _GROUPS_AC_DATA);

          YUE.on(YUQ('.show-inline-comments'),'change',function(e){
              var show = 'none';
              var target = e.currentTarget;
              if(target.checked){
                  var show = ''
              }
              var boxid = YUD.getAttribute(target,'id_for');
              var comments = YUQ('#{0} .inline-comments'.format(boxid));
              for(c in comments){
                 YUD.setStyle(comments[c],'display',show);
              }
              var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
              for(c in btns){
                  YUD.setStyle(btns[c],'display',show);
               }
          })

          YUE.on(YUQ('.line'),'click',function(e){
              var tr = e.currentTarget;
              injectInlineForm(tr);
          });

          // inject comments into they proper positions
          var file_comments = YUQ('.inline-comment-placeholder');
          renderInlineComments(file_comments);

          YUE.on(YUD.get('update_pull_request'),'click',function(e){
              updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
          })
      })
    </script>

</div>

</%def>