Show More
@@ -101,12 +101,11 b' class TestPullrequestsView(object):' | |||||
101 | for commit_id in pull_request.revisions: |
|
101 | for commit_id in pull_request.revisions: | |
102 | response.mustcontain(commit_id) |
|
102 | response.mustcontain(commit_id) | |
103 |
|
103 | |||
104 |
|
|
104 | response.mustcontain(pull_request.target_ref_parts.type) | |
105 |
|
|
105 | response.mustcontain(pull_request.target_ref_parts.name) | |
106 | target_clone_url = pull_request.target_repo.clone_url() |
|
|||
107 | assert target_clone_url in response |
|
|||
108 |
|
106 | |||
109 |
|
|
107 | response.mustcontain('class="pull-request-merge"') | |
|
108 | ||||
110 | if pr_merge_enabled: |
|
109 | if pr_merge_enabled: | |
111 | response.mustcontain('Pull request reviewer approval is pending') |
|
110 | response.mustcontain('Pull request reviewer approval is pending') | |
112 | else: |
|
111 | else: | |
@@ -536,9 +535,9 b' class TestPullrequestsView(object):' | |||||
536 |
|
535 | |||
537 | # Check generated diff contents |
|
536 | # Check generated diff contents | |
538 | response = response.follow() |
|
537 | response = response.follow() | |
539 | assert 'content_of_ancestor' not in response.body |
|
538 | response.mustcontain(no=['content_of_ancestor']) | |
540 |
|
|
539 | response.mustcontain(no=['content_of_ancestor-child']) | |
541 |
|
|
540 | response.mustcontain('content_of_change') | |
542 |
|
541 | |||
543 | def test_merge_pull_request_enabled(self, pr_util, csrf_token): |
|
542 | def test_merge_pull_request_enabled(self, pr_util, csrf_token): | |
544 | # Clear any previous calls to rcextensions |
|
543 | # Clear any previous calls to rcextensions | |
@@ -689,8 +688,8 b' class TestPullrequestsView(object):' | |||||
689 | pull_request_id=pull_request.pull_request_id)) |
|
688 | pull_request_id=pull_request.pull_request_id)) | |
690 |
|
689 | |||
691 | assert response.status_int == 200 |
|
690 | assert response.status_int == 200 | |
692 |
|
|
691 | response.mustcontain('Pull request updated to') | |
693 |
|
|
692 | response.mustcontain('with 1 added, 0 removed commits.') | |
694 |
|
693 | |||
695 | # check that we have now both revisions |
|
694 | # check that we have now both revisions | |
696 | pull_request = PullRequest.get(pull_request_id) |
|
695 | pull_request = PullRequest.get(pull_request_id) | |
@@ -752,8 +751,8 b' class TestPullrequestsView(object):' | |||||
752 | repo_name=target.repo_name, |
|
751 | repo_name=target.repo_name, | |
753 | pull_request_id=pull_request.pull_request_id)) |
|
752 | pull_request_id=pull_request.pull_request_id)) | |
754 | assert response.status_int == 200 |
|
753 | assert response.status_int == 200 | |
755 |
|
|
754 | response.mustcontain('Pull request updated to') | |
756 |
|
|
755 | response.mustcontain('with 1 added, 1 removed commits.') | |
757 |
|
756 | |||
758 | def test_update_target_revision_with_removal_of_1_commit_git(self, backend_git, csrf_token): |
|
757 | def test_update_target_revision_with_removal_of_1_commit_git(self, backend_git, csrf_token): | |
759 | backend = backend_git |
|
758 | backend = backend_git | |
@@ -994,12 +993,13 b' class TestPullrequestsView(object):' | |||||
994 | pull_request_id=pull_request.pull_request_id)) |
|
993 | pull_request_id=pull_request.pull_request_id)) | |
995 | assert response.status_int == 200 |
|
994 | assert response.status_int == 200 | |
996 |
|
995 | |||
997 |
|
|
996 | source = response.assert_response().get_element('.pr-source-info') | |
998 |
|
|
997 | source_parent = source.getparent() | |
999 |
assert len( |
|
998 | assert len(source_parent) == 1 | |
1000 | target = response.assert_response().get_element('.pr-targetinfo .tag') |
|
999 | ||
1001 | target_children = target.getchildren() |
|
1000 | target = response.assert_response().get_element('.pr-target-info') | |
1002 | assert len(target_children) == 1 |
|
1001 | target_parent = target.getparent() | |
|
1002 | assert len(target_parent) == 1 | |||
1003 |
|
1003 | |||
1004 | expected_origin_link = route_path( |
|
1004 | expected_origin_link = route_path( | |
1005 | 'repo_commits', |
|
1005 | 'repo_commits', | |
@@ -1009,10 +1009,8 b' class TestPullrequestsView(object):' | |||||
1009 | 'repo_commits', |
|
1009 | 'repo_commits', | |
1010 | repo_name=pull_request.target_repo.scm_instance().name, |
|
1010 | repo_name=pull_request.target_repo.scm_instance().name, | |
1011 | params=dict(branch='target')) |
|
1011 | params=dict(branch='target')) | |
1012 |
assert |
|
1012 | assert source_parent.attrib['href'] == expected_origin_link | |
1013 | assert origin_children[0].text == 'branch: origin' |
|
1013 | assert target_parent.attrib['href'] == expected_target_link | |
1014 | assert target_children[0].attrib['href'] == expected_target_link |
|
|||
1015 | assert target_children[0].text == 'branch: target' |
|
|||
1016 |
|
1014 | |||
1017 | def test_bookmark_is_not_a_link(self, pr_util): |
|
1015 | def test_bookmark_is_not_a_link(self, pr_util): | |
1018 | pull_request = pr_util.create_pull_request() |
|
1016 | pull_request = pr_util.create_pull_request() | |
@@ -1027,13 +1025,13 b' class TestPullrequestsView(object):' | |||||
1027 | pull_request_id=pull_request.pull_request_id)) |
|
1025 | pull_request_id=pull_request.pull_request_id)) | |
1028 | assert response.status_int == 200 |
|
1026 | assert response.status_int == 200 | |
1029 |
|
1027 | |||
1030 |
|
|
1028 | source = response.assert_response().get_element('.pr-source-info') | |
1031 |
assert |
|
1029 | assert source.text.strip() == 'bookmark:origin' | |
1032 | assert origin.getchildren() == [] |
|
1030 | assert source.getparent().attrib.get('href') is None | |
1033 |
|
1031 | |||
1034 |
target = response.assert_response().get_element('.pr-targetinfo |
|
1032 | target = response.assert_response().get_element('.pr-target-info') | |
1035 |
assert target.text.strip() == 'bookmark: |
|
1033 | assert target.text.strip() == 'bookmark:target' | |
1036 |
assert target.get |
|
1034 | assert target.getparent().attrib.get('href') is None | |
1037 |
|
1035 | |||
1038 | def test_tag_is_not_a_link(self, pr_util): |
|
1036 | def test_tag_is_not_a_link(self, pr_util): | |
1039 | pull_request = pr_util.create_pull_request() |
|
1037 | pull_request = pr_util.create_pull_request() | |
@@ -1048,13 +1046,13 b' class TestPullrequestsView(object):' | |||||
1048 | pull_request_id=pull_request.pull_request_id)) |
|
1046 | pull_request_id=pull_request.pull_request_id)) | |
1049 | assert response.status_int == 200 |
|
1047 | assert response.status_int == 200 | |
1050 |
|
1048 | |||
1051 |
|
|
1049 | source = response.assert_response().get_element('.pr-source-info') | |
1052 |
assert |
|
1050 | assert source.text.strip() == 'tag:origin' | |
1053 | assert origin.getchildren() == [] |
|
1051 | assert source.getparent().attrib.get('href') is None | |
1054 |
|
1052 | |||
1055 |
target = response.assert_response().get_element('.pr-targetinfo |
|
1053 | target = response.assert_response().get_element('.pr-target-info') | |
1056 |
assert target.text.strip() == 'tag: |
|
1054 | assert target.text.strip() == 'tag:target' | |
1057 |
assert target.get |
|
1055 | assert target.getparent().attrib.get('href') is None | |
1058 |
|
1056 | |||
1059 | @pytest.mark.parametrize('mergeable', [True, False]) |
|
1057 | @pytest.mark.parametrize('mergeable', [True, False]) | |
1060 | def test_shadow_repository_link( |
|
1058 | def test_shadow_repository_link( |
@@ -726,7 +726,7 b' import tzlocal' | |||||
726 | local_timezone = tzlocal.get_localzone() |
|
726 | local_timezone = tzlocal.get_localzone() | |
727 |
|
727 | |||
728 |
|
728 | |||
729 | def age_component(datetime_iso, value=None, time_is_local=False): |
|
729 | def age_component(datetime_iso, value=None, time_is_local=False, tooltip=True): | |
730 | title = value or format_date(datetime_iso) |
|
730 | title = value or format_date(datetime_iso) | |
731 | tzinfo = '+00:00' |
|
731 | tzinfo = '+00:00' | |
732 |
|
732 | |||
@@ -740,9 +740,11 b' def age_component(datetime_iso, value=No' | |||||
740 | tzinfo = '{}:{}'.format(offset[:-2], offset[-2:]) |
|
740 | tzinfo = '{}:{}'.format(offset[:-2], offset[-2:]) | |
741 |
|
741 | |||
742 | return literal( |
|
742 | return literal( | |
743 | '<time class="timeago tooltip" ' |
|
743 | '<time class="timeago {cls}" title="{tt_title}" datetime="{dt}{tzinfo}">{title}</time>'.format( | |
744 | 'title="{1}{2}" datetime="{0}{2}">{1}</time>'.format( |
|
744 | cls='tooltip' if tooltip else '', | |
745 | datetime_iso, title, tzinfo)) |
|
745 | tt_title=('{title}{tzinfo}'.format(title=title, tzinfo=tzinfo)) if tooltip else '', | |
|
746 | title=title, dt=datetime_iso, tzinfo=tzinfo | |||
|
747 | )) | |||
746 |
|
748 | |||
747 |
|
749 | |||
748 | def _shorten_commit_id(commit_id, commit_len=None): |
|
750 | def _shorten_commit_id(commit_id, commit_len=None): |
@@ -379,8 +379,9 b' ul.auth_plugins {' | |||||
379 | font-family: @text-bold; |
|
379 | font-family: @text-bold; | |
380 | } |
|
380 | } | |
381 |
|
381 | |||
382 | .pr-origininfo, .pr-targetinfo { |
|
382 | .pr-commit-flow { | |
383 | position: relative; |
|
383 | position: relative; | |
|
384 | font-weight: 600; | |||
384 |
|
385 | |||
385 | .tag { |
|
386 | .tag { | |
386 | display: inline-block; |
|
387 | display: inline-block; | |
@@ -413,7 +414,6 b' ul.auth_plugins {' | |||||
413 | padding: 0 0; |
|
414 | padding: 0 0; | |
414 | } |
|
415 | } | |
415 |
|
416 | |||
416 |
|
||||
417 | .pr-title-input { |
|
417 | .pr-title-input { | |
418 | width: 80%; |
|
418 | width: 80%; | |
419 | font-size: 1em; |
|
419 | font-size: 1em; | |
@@ -438,6 +438,19 b' ul.auth_plugins {' | |||||
438 | } |
|
438 | } | |
439 | } |
|
439 | } | |
440 |
|
440 | |||
|
441 | .pr-title-closed-tag { | |||
|
442 | font-size: 16px; | |||
|
443 | } | |||
|
444 | ||||
|
445 | #pr-desc { | |||
|
446 | padding: 10px 0; | |||
|
447 | ||||
|
448 | .markdown-block { | |||
|
449 | padding: 0; | |||
|
450 | margin-bottom: -30px; | |||
|
451 | } | |||
|
452 | } | |||
|
453 | ||||
441 | #pullrequest_title { |
|
454 | #pullrequest_title { | |
442 | width: 100%; |
|
455 | width: 100%; | |
443 | box-sizing: border-box; |
|
456 | box-sizing: border-box; | |
@@ -451,6 +464,31 b' ul.auth_plugins {' | |||||
451 | overflow: hidden; |
|
464 | overflow: hidden; | |
452 | } |
|
465 | } | |
453 |
|
466 | |||
|
467 | .pr-details-title { | |||
|
468 | height: 16px | |||
|
469 | } | |||
|
470 | ||||
|
471 | .pr-details-title-author-pref { | |||
|
472 | padding-right: 10px | |||
|
473 | } | |||
|
474 | ||||
|
475 | .label-pr-detail { | |||
|
476 | display: table-cell; | |||
|
477 | width: 120px; | |||
|
478 | padding-top: 7.5px; | |||
|
479 | padding-bottom: 7.5px; | |||
|
480 | padding-right: 7.5px; | |||
|
481 | } | |||
|
482 | ||||
|
483 | .source-details ul { | |||
|
484 | padding: 10px 16px; | |||
|
485 | } | |||
|
486 | ||||
|
487 | .source-details-action { | |||
|
488 | color: @grey4; | |||
|
489 | font-size: 11px | |||
|
490 | } | |||
|
491 | ||||
454 | .pr-submit-button { |
|
492 | .pr-submit-button { | |
455 | float: right; |
|
493 | float: right; | |
456 | margin: 0 0 0 5px; |
|
494 | margin: 0 0 0 5px; | |
@@ -469,6 +507,15 b' ul.auth_plugins {' | |||||
469 | vertical-align: top; |
|
507 | vertical-align: top; | |
470 | } |
|
508 | } | |
471 |
|
509 | |||
|
510 | #close_edit_pullrequest { | |||
|
511 | padding-left: 1em | |||
|
512 | } | |||
|
513 | ||||
|
514 | #delete_pullrequest { | |||
|
515 | clear: inherit; | |||
|
516 | padding: 0 | |||
|
517 | } | |||
|
518 | ||||
472 | .perms_section_head { |
|
519 | .perms_section_head { | |
473 | min-width: 625px; |
|
520 | min-width: 625px; | |
474 |
|
521 | |||
@@ -1880,9 +1927,10 b' BIN_FILENODE = 7' | |||||
1880 |
|
1927 | |||
1881 | .pr-versions { |
|
1928 | .pr-versions { | |
1882 | font-size: 1.1em; |
|
1929 | font-size: 1.1em; | |
|
1930 | padding: 7.5px; | |||
1883 |
|
1931 | |||
1884 | table { |
|
1932 | table { | |
1885 | padding: 0px 5px; |
|
1933 | ||
1886 | } |
|
1934 | } | |
1887 |
|
1935 | |||
1888 | td { |
|
1936 | td { |
@@ -558,6 +558,21 b' VersionController = function () {' | |||||
558 | } |
|
558 | } | |
559 |
|
559 | |||
560 | return false |
|
560 | return false | |
|
561 | }; | |||
|
562 | ||||
|
563 | this.toggleElement = function (elem, target) { | |||
|
564 | var $elem = $(elem); | |||
|
565 | var $target = $(target); | |||
|
566 | ||||
|
567 | if ($target.is(':visible')) { | |||
|
568 | $target.hide(); | |||
|
569 | $elem.html($elem.data('toggleOn')) | |||
|
570 | } else { | |||
|
571 | $target.show(); | |||
|
572 | $elem.html($elem.data('toggleOff')) | |||
|
573 | } | |||
|
574 | ||||
|
575 | return false | |||
561 | } |
|
576 | } | |
562 |
|
577 | |||
563 | }; |
|
578 | }; |
@@ -10,14 +10,12 b'' | |||||
10 | </%def> |
|
10 | </%def> | |
11 |
|
11 | |||
12 | <%def name="breadcrumbs_links()"> |
|
12 | <%def name="breadcrumbs_links()"> | |
13 | <% |
|
|||
14 | pr_title = c.pull_request.title |
|
|||
15 | if c.pull_request.is_closed(): |
|
|||
16 | pr_title = '[{}] {}'.format(_('Closed'), pr_title) |
|
|||
17 | %> |
|
|||
18 |
|
13 | |||
19 | <div id="pr-title"> |
|
14 | <div id="pr-title"> | |
20 | <input class="pr-title-input large disabled" disabled="disabled" name="pullrequest_title" type="text" value="${pr_title}"> |
|
15 | % if c.pull_request.is_closed(): | |
|
16 | <span class="pr-title-closed-tag tag">${_('Closed')}</span> | |||
|
17 | % endif | |||
|
18 | <input class="pr-title-input large disabled" disabled="disabled" name="pullrequest_title" type="text" value="${c.pull_request.title}"> | |||
21 | </div> |
|
19 | </div> | |
22 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
20 | <div id="pr-title-edit" class="input" style="display: none;"> | |
23 | <input class="pr-title-input large" id="pr-title-input" name="pullrequest_title" type="text" value="${c.pull_request.title}"> |
|
21 | <input class="pr-title-input large" id="pr-title-input" name="pullrequest_title" type="text" value="${c.pull_request.title}"> | |
@@ -39,6 +37,7 b'' | |||||
39 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; |
|
37 | AJAX_COMMENT_DELETE_URL = "${h.route_path('pullrequest_comment_delete',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id,comment_id='__COMMENT_ID__')}"; | |
40 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
38 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; | |
41 | </script> |
|
39 | </script> | |
|
40 | ||||
42 | <div class="box"> |
|
41 | <div class="box"> | |
43 |
|
42 | |||
44 | ${self.breadcrumbs()} |
|
43 | ${self.breadcrumbs()} | |
@@ -48,9 +47,19 b'' | |||||
48 |
|
|
47 | <div class="summary-details block-left"> | |
49 |
|
|
48 | <% summary = lambda n:{False:'summary-short'}.get(n) %> | |
50 |
|
|
49 | <div class="pr-details-title"> | |
51 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request !{}').format(c.pull_request.pull_request_id)}</a> ${_('From')} ${h.format_date(c.pull_request.created_on)} |
|
50 | <div class="pull-left"> | |
|
51 | <a href="${h.route_path('pull_requests_global', pull_request_id=c.pull_request.pull_request_id)}">${_('Pull request !{}').format(c.pull_request.pull_request_id)}</a> | |||
|
52 | ${_('Created on')} | |||
|
53 | <span class="tooltip" title="${_('Last updated on')} ${h.format_date(c.pull_request.updated_on)}">${h.format_date(c.pull_request.created_on)},</span> | |||
|
54 | <span class="pr-details-title-author-pref">${_('by')}</span> | |||
|
55 | </div> | |||
|
56 | ||||
|
57 | <div class="pull-left"> | |||
|
58 | ${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)} | |||
|
59 | </div> | |||
|
60 | ||||
52 |
|
|
61 | %if c.allowed_to_update: | |
53 |
|
|
62 | <div id="delete_pullrequest" class="pull-right action_button ${('' if c.allowed_to_delete else 'disabled' )}" > | |
54 |
|
|
63 | % if c.allowed_to_delete: | |
55 |
|
|
64 | ${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)} | |
56 |
|
|
65 | ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), | |
@@ -61,124 +70,131 b'' | |||||
61 |
|
|
70 | % endif | |
62 |
|
|
71 | </div> | |
63 |
|
|
72 | <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div> | |
64 |
|
|
73 | <div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;">${_('Cancel')}</div> | |
|
74 | <div id="edit_pull_request" class="pull-right action_button pr-save" style="display: none;">${_('Save Changes')}</div> | |||
65 |
|
|
75 | %endif | |
66 |
|
|
76 | </div> | |
67 |
|
77 | |||
|
78 | <div id="pr-desc" class="input" title="${_('Rendered using {} renderer').format(c.renderer)}"> | |||
|
79 | ${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name)} | |||
|
80 | </div> | |||
|
81 | ||||
|
82 | <div id="pr-desc-edit" class="input textarea" style="display: none;"> | |||
|
83 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> | |||
|
84 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} | |||
|
85 | </div> | |||
|
86 | ||||
68 |
|
|
87 | <div id="summary" class="fields pr-details-content"> | |
|
88 | ||||
|
89 | ## review | |||
69 |
|
|
90 | <div class="field"> | |
70 |
|
|
91 | <div class="label-pr-detail"> | |
71 |
|
|
92 | <label>${_('Review status')}:</label> | |
|
93 | </div> | |||
|
94 | <div class="input"> | |||
|
95 | %if c.pull_request_review_status: | |||
|
96 | <div class="tag status-tag-${c.pull_request_review_status}"> | |||
|
97 | <i class="icon-circle review-status-${c.pull_request_review_status}"></i> | |||
|
98 | <span class="changeset-status-lbl"> | |||
|
99 | %if c.pull_request.is_closed(): | |||
|
100 | ${_('Closed')}, | |||
|
101 | %endif | |||
|
102 | ||||
|
103 | ${h.commit_status_lbl(c.pull_request_review_status)} | |||
|
104 | ||||
|
105 | </span> | |||
|
106 | </div> | |||
|
107 | - ${_ungettext('calculated based on {} reviewer vote', 'calculated based on {} reviewers votes', len(c.pull_request_reviewers)).format(len(c.pull_request_reviewers))} | |||
|
108 | %endif | |||
|
109 | </div> | |||
|
110 | </div> | |||
|
111 | ||||
|
112 | ## source | |||
|
113 | <div class="field"> | |||
|
114 | <div class="label-pr-detail"> | |||
|
115 | <label>${_('Commit flow')}:</label> | |||
72 |
|
|
116 | </div> | |
73 |
|
|
117 | <div class="input"> | |
74 |
|
|
118 | <div class="pr-commit-flow"> | |
75 | ## branch link is only valid if it is a branch |
|
119 | ## Source | |
76 | <span class="tag"> |
|
|||
77 |
|
|
120 | %if c.pull_request.source_ref_parts.type == 'branch': | |
78 |
|
|
121 | <a href="${h.route_path('repo_commits', repo_name=c.pull_request.source_repo.repo_name, _query=dict(branch=c.pull_request.source_ref_parts.name))}"><code class="pr-source-info">${c.pull_request.source_ref_parts.type}:${c.pull_request.source_ref_parts.name}</code></a> | |
79 |
|
|
122 | %else: | |
80 |
|
|
123 | <code class="pr-source-info">${'{}:{}'.format(c.pull_request.source_ref_parts.type, c.pull_request.source_ref_parts.name)}</code> | |
|
124 | %endif | |||
|
125 | ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.repo_name}</a> | |||
|
126 | → | |||
|
127 | ## Target | |||
|
128 | %if c.pull_request.target_ref_parts.type == 'branch': | |||
|
129 | <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}"><code class="pr-target-info">${c.pull_request.target_ref_parts.type}:${c.pull_request.target_ref_parts.name}</code></a> | |||
|
130 | %else: | |||
|
131 | <code class="pr-target-info">${'{}:{}'.format(c.pull_request.target_ref_parts.type, c.pull_request.target_ref_parts.name)}</code> | |||
81 |
|
|
132 | %endif | |
82 | </span> |
|
133 | ||
83 | <span class="clone-url"> |
|
134 | ${_('of')} <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.repo_name}</a> | |
84 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.source_repo.repo_name)}">${c.pull_request.source_repo.clone_url()}</a> |
|
135 | ||
85 | </span> |
|
136 | <a class="source-details-action" href="#expand-source-details" onclick="return versionController.toggleElement(this, '.source-details')" data-toggle-on='<i class="icon-angle-down">more details</i>' data-toggle-off='<i class="icon-angle-up">less details</i>'> | |
86 | <br/> |
|
137 | <i class="icon-angle-down">more details</i> | |
|
138 | </a> | |||
|
139 | ||||
|
140 | </div> | |||
|
141 | ||||
|
142 | <div class="source-details" style="display: none"> | |||
|
143 | ||||
|
144 | <ul> | |||
|
145 | ||||
|
146 | ## common ancestor | |||
|
147 | <li> | |||
|
148 | ${_('Common ancestor')}: | |||
87 | % if c.ancestor_commit: |
|
149 | % if c.ancestor_commit: | |
88 | ${_('Common ancestor')}: |
|
150 | <a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a> | |
89 | <code><a href="${h.route_path('repo_commit', repo_name=c.target_repo.repo_name, commit_id=c.ancestor_commit.raw_id)}">${h.show_id(c.ancestor_commit)}</a></code> |
|
151 | % else: | |
|
152 | ${_('not available')} | |||
90 | % endif |
|
153 | % endif | |
91 |
</ |
|
154 | </li> | |
|
155 | ||||
|
156 | ## pull url | |||
|
157 | <li> | |||
92 | %if h.is_hg(c.pull_request.source_repo): |
|
158 | %if h.is_hg(c.pull_request.source_repo): | |
93 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
159 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> | |
94 | %elif h.is_git(c.pull_request.source_repo): |
|
160 | %elif h.is_git(c.pull_request.source_repo): | |
95 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
161 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> | |
96 | %endif |
|
162 | %endif | |
97 |
|
163 | |||
98 | <div class=""> |
|
164 | <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> | |
99 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> |
|
|||
100 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> |
|
165 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i> | |
101 |
</ |
|
166 | </li> | |
102 |
|
167 | |||
103 | </div> |
|
168 | ## Shadow repo | |
104 |
< |
|
169 | <li> | |
105 | <div class="field"> |
|
|||
106 | <div class="label-summary"> |
|
|||
107 | <label>${_('Target')}:</label> |
|
|||
108 | </div> |
|
|||
109 | <div class="input"> |
|
|||
110 | <div class="pr-targetinfo"> |
|
|||
111 | ## branch link is only valid if it is a branch |
|
|||
112 | <span class="tag"> |
|
|||
113 | %if c.pull_request.target_ref_parts.type == 'branch': |
|
|||
114 | <a href="${h.route_path('repo_commits', repo_name=c.pull_request.target_repo.repo_name, _query=dict(branch=c.pull_request.target_ref_parts.name))}">${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}</a> |
|
|||
115 | %else: |
|
|||
116 | ${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name} |
|
|||
117 | %endif |
|
|||
118 | </span> |
|
|||
119 | <span class="clone-url"> |
|
|||
120 | <a href="${h.route_path('repo_summary', repo_name=c.pull_request.target_repo.repo_name)}">${c.pull_request.target_repo.clone_url()}</a> |
|
|||
121 | </span> |
|
|||
122 | </div> |
|
|||
123 | </div> |
|
|||
124 | </div> |
|
|||
125 |
|
||||
126 | ## Link to the shadow repository. |
|
|||
127 | <div class="field"> |
|
|||
128 | <div class="label-summary"> |
|
|||
129 | <label>${_('Merge')}:</label> |
|
|||
130 | </div> |
|
|||
131 | <div class="input"> |
|
|||
132 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
170 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: | |
133 | %if h.is_hg(c.pull_request.target_repo): |
|
171 | %if h.is_hg(c.pull_request.target_repo): | |
134 | <% 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) %> |
|
172 | <% 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) %> | |
135 | %elif h.is_git(c.pull_request.target_repo): |
|
173 | %elif h.is_git(c.pull_request.target_repo): | |
136 | <% 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) %> |
|
174 | <% 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) %> | |
137 | %endif |
|
175 | %endif | |
138 | <div class=""> |
|
176 | ||
139 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> |
|
177 | <span class="tooltip" title="${_('Clone repository in its merged state using shadow repository')}">${_('Clone from shadow repository')}</span>: <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> | |
140 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> |
|
178 | <i class="tooltip icon-clipboard clipboard-action pull-right pr-mergeinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the clone url')}"></i> | |
141 | </div> |
|
179 | ||
142 | % else: |
|
180 | % else: | |
143 | <div class=""> |
|
181 | <div class=""> | |
144 | ${_('Shadow repository data not available')}. |
|
182 | ${_('Shadow repository data not available')}. | |
145 | </div> |
|
183 | </div> | |
146 | % endif |
|
184 | % endif | |
147 |
</ |
|
185 | </li> | |
|
186 | ||||
|
187 | </ul> | |||
|
188 | ||||
148 | </div> |
|
189 | </div> | |
149 |
|
190 | |||
150 | <div class="field"> |
|
|||
151 | <div class="label-summary"> |
|
|||
152 | <label>${_('Review')}:</label> |
|
|||
153 |
|
|
191 | </div> | |
154 | <div class="input"> |
|
192 | ||
155 | %if c.pull_request_review_status: |
|
|||
156 | <i class="icon-circle review-status-${c.pull_request_review_status}"></i> |
|
|||
157 | <span class="changeset-status-lbl"> |
|
|||
158 | %if c.pull_request.is_closed(): |
|
|||
159 | ${_('Closed')}, |
|
|||
160 | %endif |
|
|||
161 | ${h.commit_status_lbl(c.pull_request_review_status)} |
|
|||
162 | </span> |
|
|||
163 | - ${_ungettext('calculated based on %s reviewer vote', 'calculated based on %s reviewers votes', len(c.pull_request_reviewers)) % len(c.pull_request_reviewers)} |
|
|||
164 | %endif |
|
|||
165 | </div> |
|
|||
166 | </div> |
|
|||
167 | <div class="field"> |
|
|||
168 | <div class="pr-description-label label-summary" title="${_('Rendered using {} renderer').format(c.renderer)}"> |
|
|||
169 | <label>${_('Description')}:</label> |
|
|||
170 | </div> |
|
|||
171 | <div id="pr-desc" class="input"> |
|
|||
172 | <div class="pr-description">${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name)}</div> |
|
|||
173 | </div> |
|
|||
174 | <div id="pr-desc-edit" class="input textarea editor" style="display: none;"> |
|
|||
175 | <input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}"> |
|
|||
176 | ${dt.markup_form('pr-description-input', form_text=c.pull_request.description)} |
|
|||
177 | </div> |
|
|||
178 |
|
|
193 | </div> | |
179 |
|
194 | |||
|
195 | ## versions | |||
180 |
|
|
196 | <div class="field"> | |
181 |
|
|
197 | <div class="label-pr-detail"> | |
182 |
|
|
198 | <label>${_('Versions')}:</label> | |
183 |
|
|
199 | </div> | |
184 |
|
200 | |||
@@ -189,10 +205,11 b'' | |||||
189 |
|
|
205 | % if c.show_version_changes: | |
190 |
|
|
206 | <% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %> | |
191 |
|
|
207 | <% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %> | |
192 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" |
|
208 | ${_ungettext('{} version available for this pull request, ', '{} versions available for this pull request, ', len(c.versions)).format(len(c.versions))} | |
193 | data-toggle-on="${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))}" |
|
209 | <a id="show-pr-versions" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" | |
194 |
|
|
210 | data-toggle-on="${_('show versions')}." | |
195 | ${_ungettext('{} version available for this pull request, show it.', '{} versions available for this pull request, show them.', len(c.versions)).format(len(c.versions))} |
|
211 | data-toggle-off="${_('hide versions')}."> | |
|
212 | ${_('show versions')}. | |||
196 |
|
|
213 | </a> | |
197 |
|
|
214 | <table> | |
198 |
|
|
215 | ## SHOW ALL VERSIONS OF PR | |
@@ -221,9 +238,9 b'' | |||||
221 |
|
|
238 | </td> | |
222 |
|
|
239 | <td> | |
223 |
|
|
240 | % if c.at_version_num != ver_pr: | |
224 | <i class="icon-comment"></i> |
|
241 | <i class="tooltip icon-comment" title="${_('Comments from pull request version v{0}').format(ver_pos)}"></i> | |
225 | <code class="tooltip" title="${_('Comment from pull request version v{0}, general:{1} inline:{2}').format(ver_pos, len(c.comment_versions[ver_pr]['at']), len(c.inline_versions[ver_pr]['at']))}"> |
|
242 | <code> | |
226 |
|
|
243 | General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${len(c.inline_versions[ver_pr]['at'])} | |
227 |
|
|
244 | </code> | |
228 |
|
|
245 | % endif | |
229 |
|
|
246 | </td> | |
@@ -231,7 +248,7 b'' | |||||
231 |
|
|
248 | ##<code>${ver.source_ref_parts.commit_id[:6]}</code> | |
232 |
|
|
249 | </td> | |
233 |
|
|
250 | <td> | |
234 |
|
|
251 | <code>${h.age_component(ver.updated_on, time_is_local=True, tooltip=False)}</code> | |
235 |
|
|
252 | </td> | |
236 |
|
|
253 | </tr> | |
237 |
|
|
254 | % endfor | |
@@ -256,27 +273,8 b'' | |||||
256 |
|
|
273 | </div> | |
257 |
|
|
274 | </div> | |
258 |
|
275 | |||
259 | <div id="pr-save" class="field" style="display: none;"> |
|
|||
260 | <div class="label-summary"></div> |
|
|||
261 | <div class="input"> |
|
|||
262 | <span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span> |
|
|||
263 |
|
|
276 | </div> | |
264 | </div> |
|
277 | ||
265 | </div> |
|
|||
266 | </div> |
|
|||
267 | <div> |
|
|||
268 | ## AUTHOR |
|
|||
269 | <div class="reviewers-title block-right"> |
|
|||
270 | <div class="pr-details-title"> |
|
|||
271 | ${_('Author of this pull request')} |
|
|||
272 | </div> |
|
|||
273 | </div> |
|
|||
274 | <div class="block-right pr-details-content reviewers"> |
|
|||
275 | <ul class="group_members"> |
|
|||
276 | <li> |
|
|||
277 | ${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)} |
|
|||
278 | </li> |
|
|||
279 | </ul> |
|
|||
280 |
|
|
278 | </div> | |
281 |
|
279 | |||
282 |
|
|
280 | ## REVIEW RULES | |
@@ -351,12 +349,28 b'' | |||||
351 |
|
|
349 | </div> | |
352 |
|
|
350 | %endif | |
353 |
|
|
351 | </div> | |
354 | </div> |
|
352 | ||
|
353 | ## ## TODOs will be listed here | |||
|
354 | ## <div class="reviewers-title block-right"> | |||
|
355 | ## <div class="pr-details-title"> | |||
|
356 | ## ${_('TODOs')} | |||
|
357 | ## </div> | |||
|
358 | ## </div> | |||
|
359 | ## <div class="block-right pr-details-content reviewers"> | |||
|
360 | ## <ul class="group_members"> | |||
|
361 | ## <li> | |||
|
362 | ## XXXX | |||
|
363 | ## </li> | |||
|
364 | ## </ul> | |||
|
365 | ## </div> | |||
|
366 | ## </div> | |||
|
367 | ||||
355 | </div> |
|
368 | </div> | |
356 |
|
369 | |||
357 | <div class="box"> |
|
370 | <div class="box"> | |
358 |
|
371 | |||
359 | % if c.state_progressing: |
|
372 | % if c.state_progressing: | |
|
373 | ||||
360 | <h2 style="text-align: center"> |
|
374 | <h2 style="text-align: center"> | |
361 | ${_('Cannot show diff when pull request state is changing. Current progress state')}: <span class="tag tag-merge-state-${c.pull_request.state}">${c.pull_request.state}</span> |
|
375 | ${_('Cannot show diff when pull request state is changing. Current progress state')}: <span class="tag tag-merge-state-${c.pull_request.state}">${c.pull_request.state}</span> | |
362 | </h2> |
|
376 | </h2> | |
@@ -420,7 +434,7 b'' | |||||
420 | ${_('Update commits')} |
|
434 | ${_('Update commits')} | |
421 | </a> |
|
435 | </a> | |
422 |
|
436 | |||
423 | <a id="update_commits_switcher" class="btn btn-primary" style="margin-left: -1px" data-toggle="dropdown" aria-pressed="false" role="button"> |
|
437 | <a id="update_commits_switcher" class="tooltip btn btn-primary" style="margin-left: -1px" data-toggle="dropdown" aria-pressed="false" role="button" title="${_('more update options')}"> | |
424 | <i class="icon-down"></i> |
|
438 | <i class="icon-down"></i> | |
425 | </a> |
|
439 | </a> | |
426 |
|
440 | |||
@@ -631,12 +645,16 b'' | |||||
631 | closeButton: $('#close_edit_pullrequest'), |
|
645 | closeButton: $('#close_edit_pullrequest'), | |
632 | deleteButton: $('#delete_pullrequest'), |
|
646 | deleteButton: $('#delete_pullrequest'), | |
633 | viewFields: $('#pr-desc, #pr-title'), |
|
647 | viewFields: $('#pr-desc, #pr-title'), | |
634 |
editFields: $('#pr-desc-edit, #pr-title-edit, |
|
648 | editFields: $('#pr-desc-edit, #pr-title-edit, .pr-save'), | |
635 |
|
649 | |||
636 | init: function() { |
|
650 | init: function () { | |
637 | var that = this; |
|
651 | var that = this; | |
638 |
this.editButton.on('click', function(e) { |
|
652 | this.editButton.on('click', function (e) { | |
639 | this.closeButton.on('click', function(e) { that.view(); }); |
|
653 | that.edit(); | |
|
654 | }); | |||
|
655 | this.closeButton.on('click', function (e) { | |||
|
656 | that.view(); | |||
|
657 | }); | |||
640 | }, |
|
658 | }, | |
641 |
|
659 | |||
642 | edit: function(event) { |
|
660 | edit: function (event) { | |
@@ -665,8 +683,12 b'' | |||||
665 |
|
683 | |||
666 | init: function() { |
|
684 | init: function () { | |
667 | var self = this; |
|
685 | var self = this; | |
668 |
this.editButton.on('click', function(e) { |
|
686 | this.editButton.on('click', function (e) { | |
669 | this.closeButton.on('click', function(e) { self.close(); }); |
|
687 | self.edit(); | |
|
688 | }); | |||
|
689 | this.closeButton.on('click', function (e) { | |||
|
690 | self.close(); | |||
|
691 | }); | |||
670 | }, |
|
692 | }, | |
671 |
|
693 | |||
672 | edit: function(event) { |
|
694 | edit: function (event) { | |
@@ -814,6 +836,7 b'' | |||||
814 |
|
|
836 | }) | |
815 |
|
837 | |||
816 |
|
|
838 | </script> | |
|
839 | ||||
817 | </div> |
|
840 | </div> | |
818 |
|
841 | |||
819 | </%def> |
|
842 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now