Show More
@@ -101,12 +101,11 b' class TestPullrequestsView(object):' | |||
|
101 | 101 | for commit_id in pull_request.revisions: |
|
102 | 102 | response.mustcontain(commit_id) |
|
103 | 103 | |
|
104 |
|
|
|
105 |
|
|
|
106 | target_clone_url = pull_request.target_repo.clone_url() | |
|
107 | assert target_clone_url in response | |
|
104 | response.mustcontain(pull_request.target_ref_parts.type) | |
|
105 | response.mustcontain(pull_request.target_ref_parts.name) | |
|
108 | 106 | |
|
109 |
|
|
|
107 | response.mustcontain('class="pull-request-merge"') | |
|
108 | ||
|
110 | 109 | if pr_merge_enabled: |
|
111 | 110 | response.mustcontain('Pull request reviewer approval is pending') |
|
112 | 111 | else: |
@@ -536,9 +535,9 b' class TestPullrequestsView(object):' | |||
|
536 | 535 | |
|
537 | 536 | # Check generated diff contents |
|
538 | 537 | response = response.follow() |
|
539 | assert 'content_of_ancestor' not in response.body | |
|
540 |
|
|
|
541 |
|
|
|
538 | response.mustcontain(no=['content_of_ancestor']) | |
|
539 | response.mustcontain(no=['content_of_ancestor-child']) | |
|
540 | response.mustcontain('content_of_change') | |
|
542 | 541 | |
|
543 | 542 | def test_merge_pull_request_enabled(self, pr_util, csrf_token): |
|
544 | 543 | # Clear any previous calls to rcextensions |
@@ -689,8 +688,8 b' class TestPullrequestsView(object):' | |||
|
689 | 688 | pull_request_id=pull_request.pull_request_id)) |
|
690 | 689 | |
|
691 | 690 | assert response.status_int == 200 |
|
692 |
|
|
|
693 |
|
|
|
691 | response.mustcontain('Pull request updated to') | |
|
692 | response.mustcontain('with 1 added, 0 removed commits.') | |
|
694 | 693 | |
|
695 | 694 | # check that we have now both revisions |
|
696 | 695 | pull_request = PullRequest.get(pull_request_id) |
@@ -752,8 +751,8 b' class TestPullrequestsView(object):' | |||
|
752 | 751 | repo_name=target.repo_name, |
|
753 | 752 | pull_request_id=pull_request.pull_request_id)) |
|
754 | 753 | assert response.status_int == 200 |
|
755 |
|
|
|
756 |
|
|
|
754 | response.mustcontain('Pull request updated to') | |
|
755 | response.mustcontain('with 1 added, 1 removed commits.') | |
|
757 | 756 | |
|
758 | 757 | def test_update_target_revision_with_removal_of_1_commit_git(self, backend_git, csrf_token): |
|
759 | 758 | backend = backend_git |
@@ -994,12 +993,13 b' class TestPullrequestsView(object):' | |||
|
994 | 993 | pull_request_id=pull_request.pull_request_id)) |
|
995 | 994 | assert response.status_int == 200 |
|
996 | 995 | |
|
997 |
|
|
|
998 |
|
|
|
999 |
assert len( |
|
|
1000 | target = response.assert_response().get_element('.pr-targetinfo .tag') | |
|
1001 | target_children = target.getchildren() | |
|
1002 | assert len(target_children) == 1 | |
|
996 | source = response.assert_response().get_element('.pr-source-info') | |
|
997 | source_parent = source.getparent() | |
|
998 | assert len(source_parent) == 1 | |
|
999 | ||
|
1000 | target = response.assert_response().get_element('.pr-target-info') | |
|
1001 | target_parent = target.getparent() | |
|
1002 | assert len(target_parent) == 1 | |
|
1003 | 1003 | |
|
1004 | 1004 | expected_origin_link = route_path( |
|
1005 | 1005 | 'repo_commits', |
@@ -1009,10 +1009,8 b' class TestPullrequestsView(object):' | |||
|
1009 | 1009 | 'repo_commits', |
|
1010 | 1010 | repo_name=pull_request.target_repo.scm_instance().name, |
|
1011 | 1011 | params=dict(branch='target')) |
|
1012 |
assert |
|
|
1013 | assert origin_children[0].text == 'branch: origin' | |
|
1014 | assert target_children[0].attrib['href'] == expected_target_link | |
|
1015 | assert target_children[0].text == 'branch: target' | |
|
1012 | assert source_parent.attrib['href'] == expected_origin_link | |
|
1013 | assert target_parent.attrib['href'] == expected_target_link | |
|
1016 | 1014 | |
|
1017 | 1015 | def test_bookmark_is_not_a_link(self, pr_util): |
|
1018 | 1016 | pull_request = pr_util.create_pull_request() |
@@ -1027,13 +1025,13 b' class TestPullrequestsView(object):' | |||
|
1027 | 1025 | pull_request_id=pull_request.pull_request_id)) |
|
1028 | 1026 | assert response.status_int == 200 |
|
1029 | 1027 | |
|
1030 |
|
|
|
1031 |
assert |
|
|
1032 | assert origin.getchildren() == [] | |
|
1028 | source = response.assert_response().get_element('.pr-source-info') | |
|
1029 | assert source.text.strip() == 'bookmark:origin' | |
|
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 | 1033 |
assert target.text.strip() == 'bookmark: |
|
1036 |
assert target.get |
|
|
1034 | assert target.getparent().attrib.get('href') is None | |
|
1037 | 1035 | |
|
1038 | 1036 | def test_tag_is_not_a_link(self, pr_util): |
|
1039 | 1037 | pull_request = pr_util.create_pull_request() |
@@ -1048,13 +1046,13 b' class TestPullrequestsView(object):' | |||
|
1048 | 1046 | pull_request_id=pull_request.pull_request_id)) |
|
1049 | 1047 | assert response.status_int == 200 |
|
1050 | 1048 | |
|
1051 |
|
|
|
1052 |
assert |
|
|
1053 | assert origin.getchildren() == [] | |
|
1049 | source = response.assert_response().get_element('.pr-source-info') | |
|
1050 | assert source.text.strip() == 'tag:origin' | |
|
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 | 1054 |
assert target.text.strip() == 'tag: |
|
1057 |
assert target.get |
|
|
1055 | assert target.getparent().attrib.get('href') is None | |
|
1058 | 1056 | |
|
1059 | 1057 | @pytest.mark.parametrize('mergeable', [True, False]) |
|
1060 | 1058 | def test_shadow_repository_link( |
@@ -726,7 +726,7 b' import tzlocal' | |||
|
726 | 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 | 730 | title = value or format_date(datetime_iso) |
|
731 | 731 | tzinfo = '+00:00' |
|
732 | 732 | |
@@ -740,9 +740,11 b' def age_component(datetime_iso, value=No' | |||
|
740 | 740 | tzinfo = '{}:{}'.format(offset[:-2], offset[-2:]) |
|
741 | 741 | |
|
742 | 742 | return literal( |
|
743 | '<time class="timeago tooltip" ' | |
|
744 | 'title="{1}{2}" datetime="{0}{2}">{1}</time>'.format( | |
|
745 | datetime_iso, title, tzinfo)) | |
|
743 | '<time class="timeago {cls}" title="{tt_title}" datetime="{dt}{tzinfo}">{title}</time>'.format( | |
|
744 | cls='tooltip' if tooltip else '', | |
|
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 | 750 | def _shorten_commit_id(commit_id, commit_len=None): |
@@ -379,8 +379,9 b' ul.auth_plugins {' | |||
|
379 | 379 | font-family: @text-bold; |
|
380 | 380 | } |
|
381 | 381 | |
|
382 | .pr-origininfo, .pr-targetinfo { | |
|
382 | .pr-commit-flow { | |
|
383 | 383 | position: relative; |
|
384 | font-weight: 600; | |
|
384 | 385 | |
|
385 | 386 | .tag { |
|
386 | 387 | display: inline-block; |
@@ -413,7 +414,6 b' ul.auth_plugins {' | |||
|
413 | 414 | padding: 0 0; |
|
414 | 415 | } |
|
415 | 416 | |
|
416 | ||
|
417 | 417 | .pr-title-input { |
|
418 | 418 | width: 80%; |
|
419 | 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 | 454 | #pullrequest_title { |
|
442 | 455 | width: 100%; |
|
443 | 456 | box-sizing: border-box; |
@@ -451,6 +464,31 b' ul.auth_plugins {' | |||
|
451 | 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 | 492 | .pr-submit-button { |
|
455 | 493 | float: right; |
|
456 | 494 | margin: 0 0 0 5px; |
@@ -469,6 +507,15 b' ul.auth_plugins {' | |||
|
469 | 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 | 519 | .perms_section_head { |
|
473 | 520 | min-width: 625px; |
|
474 | 521 | |
@@ -1880,9 +1927,10 b' BIN_FILENODE = 7' | |||
|
1880 | 1927 | |
|
1881 | 1928 | .pr-versions { |
|
1882 | 1929 | font-size: 1.1em; |
|
1930 | padding: 7.5px; | |
|
1883 | 1931 | |
|
1884 | 1932 | table { |
|
1885 | padding: 0px 5px; | |
|
1933 | ||
|
1886 | 1934 | } |
|
1887 | 1935 | |
|
1888 | 1936 | td { |
@@ -558,6 +558,21 b' VersionController = function () {' | |||
|
558 | 558 | } |
|
559 | 559 | |
|
560 | 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 | 10 | </%def> |
|
11 | 11 | |
|
12 | 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 | 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 | 19 | </div> |
|
22 | 20 | <div id="pr-title-edit" class="input" style="display: none;"> |
|
23 | 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 | 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 | 38 | templateContext.pull_request_data.pull_request_id = ${c.pull_request.pull_request_id}; |
|
41 | 39 | </script> |
|
40 | ||
|
42 | 41 | <div class="box"> |
|
43 | 42 | |
|
44 | 43 | ${self.breadcrumbs()} |
@@ -48,9 +47,19 b'' | |||
|
48 | 47 |
|
|
49 | 48 |
|
|
50 | 49 |
|
|
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 |
|
|
53 |
|
|
|
62 | <div id="delete_pullrequest" class="pull-right action_button ${('' if c.allowed_to_delete else 'disabled' )}" > | |
|
54 | 63 |
|
|
55 | 64 |
|
|
56 | 65 |
|
@@ -61,124 +70,131 b'' | |||
|
61 | 70 |
|
|
62 | 71 |
|
|
63 | 72 |
|
|
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 |
|
|
66 | 76 |
|
|
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 |
|
|
88 | ||
|
89 | ## review | |
|
69 | 90 |
|
|
70 |
|
|
|
71 |
|
|
|
91 | <div class="label-pr-detail"> | |
|
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 |
|
|
73 | 117 |
|
|
74 |
|
|
|
75 | ## branch link is only valid if it is a branch | |
|
76 | <span class="tag"> | |
|
118 | <div class="pr-commit-flow"> | |
|
119 | ## Source | |
|
77 | 120 |
|
|
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 |
|
|
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 |
|
|
82 | </span> | |
|
83 | <span class="clone-url"> | |
|
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> | |
|
85 | </span> | |
|
86 | <br/> | |
|
133 | ||
|
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> | |
|
135 | ||
|
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>'> | |
|
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 | 149 | % if c.ancestor_commit: |
|
88 | ${_('Common ancestor')}: | |
|
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> | |
|
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> | |
|
151 | % else: | |
|
152 | ${_('not available')} | |
|
90 | 153 | % endif |
|
91 |
</ |
|
|
154 | </li> | |
|
155 | ||
|
156 | ## pull url | |
|
157 | <li> | |
|
92 | 158 | %if h.is_hg(c.pull_request.source_repo): |
|
93 | 159 | <% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %> |
|
94 | 160 | %elif h.is_git(c.pull_request.source_repo): |
|
95 | 161 | <% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %> |
|
96 | 162 | %endif |
|
97 | 163 | |
|
98 | <div class=""> | |
|
99 | <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> | |
|
164 | <span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly"> | |
|
100 | 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> | |
|
104 |
< |
|
|
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"> | |
|
168 | ## Shadow repo | |
|
169 | <li> | |
|
132 | 170 | % if not c.pull_request.is_closed() and c.pull_request.shadow_merge_ref: |
|
133 | 171 | %if h.is_hg(c.pull_request.target_repo): |
|
134 | 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 | 173 | %elif h.is_git(c.pull_request.target_repo): |
|
136 | 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 | 175 | %endif |
|
138 | <div class=""> | |
|
139 | <input type="text" class="input-monospace pr-mergeinfo" value="${clone_url}" readonly="readonly"> | |
|
176 | ||
|
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 | 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 | 180 | % else: |
|
143 | 181 | <div class=""> |
|
144 | 182 | ${_('Shadow repository data not available')}. |
|
145 | 183 | </div> |
|
146 | 184 | % endif |
|
147 |
</ |
|
|
185 | </li> | |
|
186 | ||
|
187 | </ul> | |
|
188 | ||
|
148 | 189 | </div> |
|
149 | 190 | |
|
150 | <div class="field"> | |
|
151 | <div class="label-summary"> | |
|
152 | <label>${_('Review')}:</label> | |
|
153 | 191 |
|
|
154 | <div class="input"> | |
|
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> | |
|
192 | ||
|
178 | 193 |
|
|
179 | 194 | |
|
195 | ## versions | |
|
180 | 196 |
|
|
181 |
|
|
|
197 | <div class="label-pr-detail"> | |
|
182 | 198 |
|
|
183 | 199 |
|
|
184 | 200 | |
@@ -189,10 +205,11 b'' | |||
|
189 | 205 |
|
|
190 | 206 |
|
|
191 | 207 |
|
|
192 | <a id="show-pr-versions" class="input" onclick="return versionController.toggleVersionView(this)" href="#show-pr-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))}" | |
|
194 |
|
|
|
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))} | |
|
208 | ${_ungettext('{} version available for this pull request, ', '{} versions available for this pull request, ', len(c.versions)).format(len(c.versions))} | |
|
209 | <a id="show-pr-versions" onclick="return versionController.toggleVersionView(this)" href="#show-pr-versions" | |
|
210 | data-toggle-on="${_('show versions')}." | |
|
211 | data-toggle-off="${_('hide versions')}."> | |
|
212 | ${_('show versions')}. | |
|
196 | 213 |
|
|
197 | 214 |
|
|
198 | 215 |
|
@@ -221,9 +238,9 b'' | |||
|
221 | 238 |
|
|
222 | 239 |
|
|
223 | 240 |
|
|
224 | <i class="icon-comment"></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']))}"> | |
|
226 |
|
|
|
241 | <i class="tooltip icon-comment" title="${_('Comments from pull request version v{0}').format(ver_pos)}"></i> | |
|
242 | <code> | |
|
243 | General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${len(c.inline_versions[ver_pr]['at'])} | |
|
227 | 244 |
|
|
228 | 245 |
|
|
229 | 246 |
|
@@ -231,7 +248,7 b'' | |||
|
231 | 248 |
|
|
232 | 249 |
|
|
233 | 250 |
|
|
234 |
|
|
|
251 | <code>${h.age_component(ver.updated_on, time_is_local=True, tooltip=False)}</code> | |
|
235 | 252 |
|
|
236 | 253 |
|
|
237 | 254 |
|
@@ -256,27 +273,8 b'' | |||
|
256 | 273 |
|
|
257 | 274 |
|
|
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 |
|
|
264 | </div> | |
|
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> | |
|
277 | ||
|
280 | 278 |
|
|
281 | 279 | |
|
282 | 280 |
|
@@ -351,12 +349,28 b'' | |||
|
351 | 349 |
|
|
352 | 350 |
|
|
353 | 351 |
|
|
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 | 368 | </div> |
|
356 | 369 | |
|
357 | 370 | <div class="box"> |
|
358 | 371 | |
|
359 | 372 | % if c.state_progressing: |
|
373 | ||
|
360 | 374 | <h2 style="text-align: center"> |
|
361 | 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 | 376 | </h2> |
@@ -420,7 +434,7 b'' | |||
|
420 | 434 | ${_('Update commits')} |
|
421 | 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 | 438 | <i class="icon-down"></i> |
|
425 | 439 | </a> |
|
426 | 440 | |
@@ -631,12 +645,16 b'' | |||
|
631 | 645 | closeButton: $('#close_edit_pullrequest'), |
|
632 | 646 | deleteButton: $('#delete_pullrequest'), |
|
633 | 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 | 650 | init: function() { |
|
637 | 651 | var that = this; |
|
638 |
this.editButton.on('click', function(e) { |
|
|
639 | this.closeButton.on('click', function(e) { that.view(); }); | |
|
652 | this.editButton.on('click', function (e) { | |
|
653 | that.edit(); | |
|
654 | }); | |
|
655 | this.closeButton.on('click', function (e) { | |
|
656 | that.view(); | |
|
657 | }); | |
|
640 | 658 | }, |
|
641 | 659 | |
|
642 | 660 | edit: function(event) { |
@@ -665,8 +683,12 b'' | |||
|
665 | 683 | |
|
666 | 684 | init: function() { |
|
667 | 685 | var self = this; |
|
668 |
this.editButton.on('click', function(e) { |
|
|
669 | this.closeButton.on('click', function(e) { self.close(); }); | |
|
686 | this.editButton.on('click', function (e) { | |
|
687 | self.edit(); | |
|
688 | }); | |
|
689 | this.closeButton.on('click', function (e) { | |
|
690 | self.close(); | |
|
691 | }); | |
|
670 | 692 | }, |
|
671 | 693 | |
|
672 | 694 | edit: function(event) { |
@@ -814,6 +836,7 b'' | |||
|
814 | 836 |
|
|
815 | 837 | |
|
816 | 838 |
|
|
839 | ||
|
817 | 840 | </div> |
|
818 | 841 | |
|
819 | 842 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now