<%inherit file="/base/base.mako"/> <%namespace name="base" file="/base/base.mako"/> <%namespace name="dt" file="/data_table/_dt_elements.mako"/> <%namespace name="sidebar" file="/base/sidebar.mako"/> <%def name="title()"> ${_('{} Pull Request !{}').format(c.repo_name, c.pull_request.pull_request_id)} %if c.rhodecode_name: · ${h.branding(c.rhodecode_name)} %endif <%def name="breadcrumbs_links()"> <%def name="menu_bar_nav()"> ${self.menu_items(active='repositories')} <%def name="menu_bar_subnav()"> ${self.repo_menu(active='showpullrequest')} <%def name="main()"> ## Container to gather extracted Tickets <% c.referenced_commit_issues = [] c.referenced_desc_issues = [] %>
% if c.pull_request.is_closed(): ${_('Closed')} % endif
<% summary = lambda n:{False:'summary-short'}.get(n) %>
${_('Pull request !{}').format(c.pull_request.pull_request_id)} ${_('Created on')} ${h.format_date(c.pull_request.created_on)}, ${_('by')}
${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)}
%if c.allowed_to_update:
${_('Edit')}
%endif
${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name, issues_container=c.referenced_desc_issues)}
## source
## Source %if c.pull_request.source_ref_parts.type == 'branch': ${c.pull_request.source_ref_parts.type}:${c.pull_request.source_ref_parts.name} %else: ${'{}:{}'.format(c.pull_request.source_ref_parts.type, c.pull_request.source_ref_parts.name)} %endif ${_('of')} ${c.pull_request.source_repo.repo_name} → ## Target %if c.pull_request.target_ref_parts.type == 'branch': ${c.pull_request.target_ref_parts.type}:${c.pull_request.target_ref_parts.name} %else: ${'{}:{}'.format(c.pull_request.target_ref_parts.type, c.pull_request.target_ref_parts.name)} %endif ${_('of')} ${c.pull_request.target_repo.repo_name} more details
## versions
<% 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, ', '{} versions available for this pull request, ', len(c.versions)).format(len(c.versions))} ${_('show 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
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: General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${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, tooltip=False)}
% else:
${_('Pull request versions not available')}.
% endif
% if c.state_progressing:

${_('Cannot show diff when pull request state is changing. Current progress state')}: ${c.pull_request.state} % if c.is_super_admin:
If you think this is an error try forced state reset to created state. % endif

% else: ## Diffs rendered here
##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.')}
${_('Consider doing a `force update commits` in case you think this is an error.')}
% elif c.pr_merge_source_commit.changed and not c.pull_request.is_closed():
${_('There are new changes for `{}:{}` in source repository, please consider updating this pull request.').format(c.pr_merge_source_commit.ref_spec.type, c.pr_merge_source_commit.ref_spec.name)}
% endif
% if not c.compare_mode: % if c.at_version_index:

${_('Showing changes at v{}, commenting is disabled.').format(c.at_version_index)}

% 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: ## COMPARE RANGE DIFF MODE % 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_index, ver_to=c.at_version_index if c.at_version_index 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, tooltip=True)} r${commit.idx}:${h.short_id(commit.raw_id)} ${h.hidden('revisions', commit.raw_id)}
${h.urlify_commit_message(commit.message, c.repo_name, issues_container=c.referenced_commit_issues)}
% endif ## Regular DIFF % else: <%include file="/compare/compare_commits.mako" /> % endif
<%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> <% pr_menu_data = { 'outdated_comm_count_ver': outdated_comm_count_ver, 'pull_request': c.pull_request } %> ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on, pull_request_menu=pr_menu_data)} % if c.range_diff_on: % for commit in c.commit_ranges: ${cbdiffs.render_diffset( c.changes[commit.raw_id], commit=commit, use_comments=True, collapse_when_files_over=5, disable_new_comments=True, deleted_files_comments=c.deleted_files_comments, inline_comments=c.inline_comments, pull_request_menu=pr_menu_data, show_todos=False)} % endfor % else: ${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, inline_comments=c.inline_comments, pull_request_menu=pr_menu_data, show_todos=False)} % endif
% 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"/> ## comments heading with count
${_('General Comments')} ${len(c.comments)}
## 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(): ## 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)} ## merge status, and merge action
<%include file="/pullrequests/pullrequest_merge_checks.mako"/>
%endif % endif
### NAV SIDEBAR ## This JS needs to be at the end