<%inherit file="/base/base.mako"/> <%namespace name="base" file="/base/base.mako"/> <%def name="title()"> ${_('%s Pull Request #%s') % (c.repo_name, c.pull_request.pull_request_id)} %if c.rhodecode_name: · ${h.branding(c.rhodecode_name)} %endif <%def name="breadcrumbs_links()"> ${c.pull_request.title} %if c.pull_request.is_closed(): (${_('Closed')}) %endif <%def name="menu_bar_nav()"> ${self.menu_items(active='repositories')} <%def name="menu_bar_subnav()"> ${self.repo_menu(active='showpullrequest')} <%def name="main()">
${self.repo_page_title(c.rhodecode_db_repo)}
${self.breadcrumbs()}
<% summary = lambda n:{False:'summary-short'}.get(n) %>
${_('Pull request #%s') % c.pull_request.pull_request_id} ${_('From')} ${h.format_date(c.pull_request.created_on)} %if c.allowed_to_update:
% if c.allowed_to_delete: ${h.secure_form(h.route_path('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id), request=request)} ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} ${h.end_form()} % else: ${_('Delete')} % endif
${_('Edit')}
%endif
## branch link is only valid if it is a branch %if c.pull_request.source_ref_parts.type == 'branch': ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} %else: ${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name} %endif ${c.pull_request.source_repo.clone_url()}
% if c.ancestor_commit: ${_('Common ancestor')}: ${h.show_id(c.ancestor_commit)} % endif
%if h.is_hg(c.pull_request.source_repo): <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> %elif h.is_git(c.pull_request.source_repo): <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> %endif
## branch link is only valid if it is a branch %if c.pull_request.target_ref_parts.type == 'branch': ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} %else: ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} %endif ${c.pull_request.target_repo.clone_url()}
## Link to the shadow repository.
% if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: %if h.is_hg(c.pull_request.target_repo): <% clone_url = 'hg clone --update {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> %elif h.is_git(c.pull_request.target_repo): <% clone_url = 'git clone --branch {} {} pull-request-{}'.format(c.pull_request.shadow_merge_ref.name, c.shadow_clone_url, c.pull_request.pull_request_id) %> %endif
% else:
${_('Shadow repository data not available')}.
% endif
%if c.pull_request_review_status:
%if c.pull_request.is_closed(): ${_('Closed')}, %endif ${h.commit_status_lbl(c.pull_request_review_status)} - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} %endif
${h.urlify_commit_message(c.pull_request.description, c.repo_name)}
<% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %> <% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
% if c.show_version_changes: <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} ## SHOW ALL VERSIONS OF PR <% ver_pr = None %> % for data in reversed(list(enumerate(c.versions, 1))): <% ver_pos = data[0] %> <% ver = data[1] %> <% ver_pr = ver.pull_request_version_id %> <% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %> % endfor ## show comment/inline comments summary <%def name="comments_summary()"> ${comments_summary()}
v${ver_pos} <% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
% if c.at_version_num != ver_pr: G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])} % endif ##${ver.source_ref_parts.commit_id[:6]} ${h.age_component(ver.updated_on, time_is_local=True)}
% if c.at_version: <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['display']) %> <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['display']) %> ${_('Comments at this version')}: % else: <% inline_comm_count_ver = len(c.inline_versions[c.at_version_num]['until']) %> <% general_comm_count_ver = len(c.comment_versions[c.at_version_num]['until']) %> ${_('Comments for this pull request')}: % endif %if general_comm_count_ver: ${_("%d General ") % general_comm_count_ver} %else: ${_("%d General ") % general_comm_count_ver} %endif %if inline_comm_count_ver: , ${_("%d Inline") % inline_comm_count_ver} %else: , ${_("%d Inline") % inline_comm_count_ver} %endif %if outdated_comm_count_ver: , ${_("%d Outdated") % outdated_comm_count_ver} | ${_('show outdated comments')} %else: , ${_("%d Outdated") % outdated_comm_count_ver} %endif
% else:
${_('Pull request versions not available')}.
${comments_summary()}
% endif
## AUTHOR
${_('Author of this pull request')}
  • ${self.gravatar_with_user(c.pull_request.author.email, 16)}
## REVIEW RULES ## REVIEWERS
${_('Pull request reviewers')} %if c.allowed_to_update: ${_('Edit')} %endif
## members redering block
    % for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers: % endfor
## end members redering block %if not c.pull_request.is_closed(): %endif
##DIFF
##CS % if c.missing_requirements:
${_('Missing requirements:')} ${_('These commits cannot be displayed, because this repository uses the Mercurial largefiles extension, which was not enabled.')}
% elif c.missing_commits:
${_('Missing commits')}: ${_('This pull request cannot be displayed, because one or more commits no longer exist in the source repository.')} ${_('Please update this pull request, push the commits back into the source repository, or consider closing this pull request.')}
% endif
% if not c.compare_mode: % if c.at_version_pos:

${_('Showing changes at v%d, commenting is disabled.') % c.at_version_pos}

% endif
% if c.allowed_to_update and not c.pull_request.is_closed(): ${_('Update commits')} % else: ${_('Update commits')} % endif
% endif
% if not c.missing_commits: % if c.compare_mode: % if c.at_version:

${_('Commits and changes between v{ver_from} and {ver_to} of this pull request, commenting is disabled').format(ver_from=c.from_version_pos, ver_to=c.at_version_pos if c.at_version_pos else 'latest')}:

${_('commits added: {}, removed: {}').format(len(c.commit_changes_summary.added), len(c.commit_changes_summary.removed))}
% for c_type, commit in c.commit_changes: % if c_type in ['a', 'r']: <% if c_type == 'a': cc_title = _('Commit added in displayed changes') elif c_type == 'r': cc_title = _('Commit removed in displayed changes') else: cc_title = '' %> % endif % endfor
${_('Time')} ${_('Author')} ${_('Commit')} ${_('Description')}
${c_type.upper()}
${h.age_component(commit.date)} ${base.gravatar_with_user(commit.author, 16)} r${commit.revision}:${h.short_id(commit.raw_id)} ${h.hidden('revisions', commit.raw_id)}
${h.urlify_commit_message(commit.message, c.repo_name)}
% endif % else: <%include file="/compare/compare_commits.mako" /> % endif
<%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> ${cbdiffs.render_diffset_menu()} ${cbdiffs.render_diffset( c.diffset, use_comments=True, collapse_when_files_over=30, disable_new_comments=not c.allowed_to_comment, deleted_files_comments=c.deleted_files_comments)}
% else: ## skipping commits we need to clear the view for missing commits
% endif
## template for inline comment form <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> ## render general comments
% if general_outdated_comm_count_ver:
% if general_outdated_comm_count_ver == 1: ${_('there is {num} general comment from older versions').format(num=general_outdated_comm_count_ver)}, ${_('show it')} % else: ${_('there are {num} general comments from older versions').format(num=general_outdated_comm_count_ver)}, ${_('show them')} % endif
% endif
${comment.generate_comments(c.comments, include_pull_request=True, is_pull_request=True)} % if not c.pull_request.is_closed(): ## merge status, and merge action
<%include file="/pullrequests/pullrequest_merge_checks.mako"/>
## main comment form and it status ${comment.comments(h.route_path('pullrequest_comment_create', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), c.pull_request_review_status, is_pull_request=True, change_status=c.allowed_to_change_status)} %endif