<%inherit file="/base/base.mako"/> <%namespace name="base" file="/base/base.mako"/> <%namespace name="dt" file="/data_table/_dt_elements.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()">
% 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.breadcrumbs()}
<% 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)}
## review
%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 {} reviewer vote', 'calculated based on {} reviewers votes', len(c.pull_request_reviewers)).format(len(c.pull_request_reviewers))} %endif
## 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
## 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
## TODOs will be listed here
## Only show unresolved, that is only what matters TODO Comments - ${len(c.unresolved_comments)} / ${(len(c.unresolved_comments) + len(c.resolved_comments))} % if not c.at_version: % if c.resolved_comments: Show resolved % else: Show resolved % endif % endif
<% def sorter(entry): user_id = entry.author.user_id resolved = '1' if entry.resolved else '0' if user_id == c.rhodecode_user.user_id: # own comments first user_id = 0 return '{}_{}_{}'.format(resolved, user_id, str(entry.comment_id).zfill(100)) %> % if c.at_version: % else: % for todo_comment in sorted(c.unresolved_comments + c.resolved_comments, key=sorter): <% resolved = todo_comment.resolved %> % if inline: <% outdated_at_ver = todo_comment.outdated_at_version(getattr(c, 'at_version_num', None)) %> % else: <% outdated_at_ver = todo_comment.older_than_version(getattr(c, 'at_version_num', None)) %> % endif % endfor % if len(c.unresolved_comments) == 0: % endif % endif
${_('unresolved TODOs unavailable in this view')}.
% if resolved: % else: % endif ${base.gravatar(todo_comment.author.email, 16, user=todo_comment.author, tooltip=True, extra_class=['no-margin'])}
${h.chop_at_smart(todo_comment.text, '\n', suffix_if_chopped='...')}
${_('No unresolved TODOs')}.
% if c.state_progressing:

${_('Cannot show diff when pull request state is changing. Current progress state')}: ${c.pull_request.state}

% 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_refresh_url} in case you think this is an error.').format(force_refresh_url=h.link_to('force refresh', h.current_route_path(request, force_refresh='1')))|n}
% 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, 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)}
% endif % else: <%include file="/compare/compare_commits.mako" /> % endif
<%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/> % if c.at_version: <% c.inline_cnt = len(c.inline_versions[c.at_version_num]['display']) %> <% c.comments = c.comment_versions[c.at_version_num]['display'] %> % else: <% c.inline_cnt = len(c.inline_versions[c.at_version_num]['until']) %> <% c.comments = c.comment_versions[c.at_version_num]['until'] %> % endif <% pr_menu_data = { 'outdated_comm_count_ver': outdated_comm_count_ver } %> ${cbdiffs.render_diffset_menu(c.diffset, range_diff_on=c.range_diff_on)} % 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
${_('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