This diff has been collapsed as it changes many lines, (877 lines changed)
Show them
Hide them
|
|
@@
-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,324
+37,340
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()}
|
|
45
|
|
|
44
|
|
|
46
|
<div class="box pr-summary">
|
|
45
|
<div class="box pr-summary">
|
|
47
|
|
|
46
|
|
|
48
|
<div class="summary-details block-left">
|
|
47
|
<div class="summary-details block-left">
|
|
49
|
<% summary = lambda n:{False:'summary-short'}.get(n) %>
|
|
48
|
<% summary = lambda n:{False:'summary-short'}.get(n) %>
|
|
50
|
<div class="pr-details-title">
|
|
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">
|
|
52
|
%if c.allowed_to_update:
|
|
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>
|
|
53
|
<div id="delete_pullrequest" class="pull-right action_button ${'' if c.allowed_to_delete else 'disabled' }" style="clear:inherit;padding: 0">
|
|
52
|
${_('Created on')}
|
|
54
|
% if c.allowed_to_delete:
|
|
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>
|
|
55
|
${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)}
|
|
54
|
<span class="pr-details-title-author-pref">${_('by')}</span>
|
|
56
|
${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
|
|
55
|
</div>
|
|
57
|
class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
|
|
56
|
|
|
58
|
${h.end_form()}
|
|
57
|
<div class="pull-left">
|
|
59
|
% else:
|
|
58
|
${self.gravatar_with_user(c.pull_request.author.email, 16, tooltip=True)}
|
|
60
|
${_('Delete')}
|
|
|
|
|
61
|
% endif
|
|
|
|
|
62
|
</div>
|
|
|
|
|
63
|
<div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
|
|
|
|
|
64
|
<div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;padding: 0">${_('Cancel')}</div>
|
|
|
|
|
65
|
%endif
|
|
|
|
|
66
|
</div>
|
|
59
|
</div>
|
|
67
|
|
|
60
|
|
|
68
|
<div id="summary" class="fields pr-details-content">
|
|
61
|
%if c.allowed_to_update:
|
|
69
|
<div class="field">
|
|
62
|
<div id="delete_pullrequest" class="pull-right action_button ${('' if c.allowed_to_delete else 'disabled' )}" >
|
|
70
|
<div class="label-summary">
|
|
63
|
% if c.allowed_to_delete:
|
|
71
|
<label>${_('Source')}:</label>
|
|
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)}
|
|
72
|
</div>
|
|
65
|
${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
|
|
73
|
<div class="input">
|
|
66
|
class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
|
|
74
|
<div class="pr-origininfo">
|
|
67
|
${h.end_form()}
|
|
75
|
## branch link is only valid if it is a branch
|
|
68
|
% else:
|
|
76
|
<span class="tag">
|
|
69
|
${_('Delete')}
|
|
77
|
%if c.pull_request.source_ref_parts.type == 'branch':
|
|
70
|
% endif
|
|
78
|
<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))}">${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}</a>
|
|
71
|
</div>
|
|
79
|
%else:
|
|
72
|
<div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
|
|
80
|
${c.pull_request.source_ref_parts.type}: ${c.pull_request.source_ref_parts.name}
|
|
73
|
<div id="close_edit_pullrequest" class="pull-right action_button" style="display: none;">${_('Cancel')}</div>
|
|
81
|
%endif
|
|
74
|
<div id="edit_pull_request" class="pull-right action_button pr-save" style="display: none;">${_('Save Changes')}</div>
|
|
82
|
</span>
|
|
75
|
%endif
|
|
83
|
<span class="clone-url">
|
|
76
|
</div>
|
|
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>
|
|
77
|
|
|
85
|
</span>
|
|
78
|
<div id="pr-desc" class="input" title="${_('Rendered using {} renderer').format(c.renderer)}">
|
|
86
|
<br/>
|
|
79
|
${h.render(c.pull_request.description, renderer=c.renderer, repo_name=c.repo_name)}
|
|
87
|
% if c.ancestor_commit:
|
|
80
|
</div>
|
|
88
|
${_('Common ancestor')}:
|
|
81
|
|
|
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>
|
|
82
|
<div id="pr-desc-edit" class="input textarea" style="display: none;">
|
|
90
|
% endif
|
|
83
|
<input id="pr-renderer-input" type="hidden" name="description_renderer" value="${c.visual.default_renderer}">
|
|
91
|
</div>
|
|
84
|
${dt.markup_form('pr-description-input', form_text=c.pull_request.description)}
|
|
92
|
%if h.is_hg(c.pull_request.source_repo):
|
|
85
|
</div>
|
|
93
|
<% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
|
|
86
|
|
|
94
|
%elif h.is_git(c.pull_request.source_repo):
|
|
87
|
<div id="summary" class="fields pr-details-content">
|
|
95
|
<% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
|
|
88
|
|
|
|
|
|
89
|
## review
|
|
|
|
|
90
|
<div class="field">
|
|
|
|
|
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>
|
|
|
|
|
116
|
</div>
|
|
|
|
|
117
|
<div class="input">
|
|
|
|
|
118
|
<div class="pr-commit-flow">
|
|
|
|
|
119
|
## Source
|
|
|
|
|
120
|
%if c.pull_request.source_ref_parts.type == 'branch':
|
|
|
|
|
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>
|
|
|
|
|
122
|
%else:
|
|
|
|
|
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>
|
|
96
|
%endif
|
|
132
|
%endif
|
|
97
|
|
|
133
|
|
|
98
|
<div class="">
|
|
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>
|
|
99
|
<input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
|
|
135
|
|
|
100
|
<i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
|
|
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>'>
|
|
101
|
</div>
|
|
137
|
<i class="icon-angle-down">more details</i>
|
|
|
|
|
138
|
</a>
|
|
102
|
|
|
139
|
|
|
103
|
</div>
|
|
140
|
</div>
|
|
104
|
</div>
|
|
141
|
|
|
105
|
<div class="field">
|
|
142
|
<div class="source-details" style="display: none">
|
|
106
|
<div class="label-summary">
|
|
143
|
|
|
107
|
<label>${_('Target')}:</label>
|
|
144
|
<ul>
|
|
108
|
</div>
|
|
145
|
|
|
109
|
<div class="input">
|
|
146
|
## common ancestor
|
|
110
|
<div class="pr-targetinfo">
|
|
147
|
<li>
|
|
111
|
## branch link is only valid if it is a branch
|
|
148
|
${_('Common ancestor')}:
|
|
112
|
<span class="tag">
|
|
149
|
% if c.ancestor_commit:
|
|
113
|
%if c.pull_request.target_ref_parts.type == 'branch':
|
|
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>
|
|
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>
|
|
151
|
% else:
|
|
115
|
%else:
|
|
152
|
${_('not available')}
|
|
116
|
${c.pull_request.target_ref_parts.type}: ${c.pull_request.target_ref_parts.name}
|
|
153
|
% endif
|
|
117
|
%endif
|
|
154
|
</li>
|
|
118
|
</span>
|
|
155
|
|
|
119
|
<span class="clone-url">
|
|
156
|
## pull 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>
|
|
157
|
<li>
|
|
121
|
</span>
|
|
158
|
%if h.is_hg(c.pull_request.source_repo):
|
|
122
|
</div>
|
|
159
|
<% clone_url = 'hg pull -r {} {}'.format(h.short_id(c.source_ref), c.pull_request.source_repo.clone_url()) %>
|
|
123
|
</div>
|
|
160
|
%elif h.is_git(c.pull_request.source_repo):
|
|
124
|
</div>
|
|
161
|
<% clone_url = 'git pull {} {}'.format(c.pull_request.source_repo.clone_url(), c.pull_request.source_ref_parts.name) %>
|
|
|
|
|
162
|
%endif
|
|
125
|
|
|
163
|
|
|
126
|
## Link to the shadow repository.
|
|
164
|
<span>${_('Pull changes from source')}</span>: <input type="text" class="input-monospace pr-pullinfo" value="${clone_url}" readonly="readonly">
|
|
127
|
<div class="field">
|
|
165
|
<i class="tooltip icon-clipboard clipboard-action pull-right pr-pullinfo-copy" data-clipboard-text="${clone_url}" title="${_('Copy the pull url')}"></i>
|
|
128
|
<div class="label-summary">
|
|
166
|
</li>
|
|
129
|
<label>${_('Merge')}:</label>
|
|
167
|
|
|
130
|
</div>
|
|
168
|
## Shadow repo
|
|
131
|
<div class="input">
|
|
169
|
<li>
|
|
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
|
</div>
|
|
185
|
</li>
|
|
|
|
|
186
|
|
|
|
|
|
187
|
</ul>
|
|
|
|
|
188
|
|
|
148
|
</div>
|
|
189
|
</div>
|
|
149
|
|
|
190
|
|
|
150
|
<div class="field">
|
|
191
|
</div>
|
|
151
|
<div class="label-summary">
|
|
192
|
|
|
152
|
<label>${_('Review')}:</label>
|
|
193
|
</div>
|
|
153
|
</div>
|
|
194
|
|
|
154
|
<div class="input">
|
|
195
|
## versions
|
|
155
|
%if c.pull_request_review_status:
|
|
196
|
<div class="field">
|
|
156
|
<i class="icon-circle review-status-${c.pull_request_review_status}"></i>
|
|
197
|
<div class="label-pr-detail">
|
|
157
|
<span class="changeset-status-lbl">
|
|
198
|
<label>${_('Versions')}:</label>
|
|
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
|
</div>
|
|
199
|
</div>
|
|
179
|
|
|
200
|
|
|
180
|
<div class="field">
|
|
201
|
<% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
|
|
181
|
<div class="label-summary">
|
|
202
|
<% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
|
|
182
|
<label>${_('Versions')}:</label>
|
|
|
|
|
183
|
</div>
|
|
|
|
|
184
|
|
|
|
|
|
185
|
<% outdated_comm_count_ver = len(c.inline_versions[None]['outdated']) %>
|
|
|
|
|
186
|
<% general_outdated_comm_count_ver = len(c.comment_versions[None]['outdated']) %>
|
|
|
|
|
187
|
|
|
203
|
|
|
188
|
<div class="pr-versions">
|
|
204
|
<div class="pr-versions">
|
|
189
|
% if c.show_version_changes:
|
|
205
|
% if c.show_version_changes:
|
|
190
|
<% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
|
|
206
|
<% outdated_comm_count_ver = len(c.inline_versions[c.at_version_num]['outdated']) %>
|
|
191
|
<% general_outdated_comm_count_ver = len(c.comment_versions[c.at_version_num]['outdated']) %>
|
|
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
|
data-toggle-off="${_('Hide all versions of this pull request')}">
|
|
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')}.">
|
|
196
|
</a>
|
|
212
|
${_('show versions')}.
|
|
197
|
<table>
|
|
213
|
</a>
|
|
198
|
## SHOW ALL VERSIONS OF PR
|
|
214
|
<table>
|
|
199
|
<% ver_pr = None %>
|
|
215
|
## SHOW ALL VERSIONS OF PR
|
|
|
|
|
216
|
<% ver_pr = None %>
|
|
200
|
|
|
217
|
|
|
201
|
% for data in reversed(list(enumerate(c.versions, 1))):
|
|
218
|
% for data in reversed(list(enumerate(c.versions, 1))):
|
|
202
|
<% ver_pos = data[0] %>
|
|
219
|
<% ver_pos = data[0] %>
|
|
203
|
<% ver = data[1] %>
|
|
220
|
<% ver = data[1] %>
|
|
204
|
<% ver_pr = ver.pull_request_version_id %>
|
|
221
|
<% ver_pr = ver.pull_request_version_id %>
|
|
205
|
<% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
|
|
222
|
<% display_row = '' if c.at_version and (c.at_version_num == ver_pr or c.from_version_num == ver_pr) else 'none' %>
|
|
206
|
|
|
223
|
|
|
207
|
<tr class="version-pr" style="display: ${display_row}">
|
|
224
|
<tr class="version-pr" style="display: ${display_row}">
|
|
208
|
<td>
|
|
225
|
<td>
|
|
209
|
<code>
|
|
226
|
<code>
|
|
210
|
<a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
|
|
227
|
<a href="${request.current_route_path(_query=dict(version=ver_pr or 'latest'))}">v${ver_pos}</a>
|
|
211
|
</code>
|
|
228
|
</code>
|
|
212
|
</td>
|
|
229
|
</td>
|
|
213
|
<td>
|
|
230
|
<td>
|
|
214
|
<input ${('checked="checked"' if c.from_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
|
|
231
|
<input ${('checked="checked"' if c.from_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_source" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
|
|
215
|
<input ${('checked="checked"' if c.at_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
|
|
232
|
<input ${('checked="checked"' if c.at_version_num == ver_pr else '')} class="compare-radio-button" type="radio" name="ver_target" value="${ver_pr or 'latest'}" data-ver-pos="${ver_pos}"/>
|
|
216
|
</td>
|
|
233
|
</td>
|
|
217
|
<td>
|
|
234
|
<td>
|
|
218
|
<% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
|
|
235
|
<% review_status = c.review_versions[ver_pr].status if ver_pr in c.review_versions else 'not_reviewed' %>
|
|
219
|
<i class="tooltip icon-circle review-status-${review_status}" title="${_('Your review status at this version')}"></i>
|
|
236
|
<i class="tooltip icon-circle review-status-${review_status}" title="${_('Your review status at this version')}"></i>
|
|
220
|
|
|
237
|
|
|
221
|
</td>
|
|
238
|
</td>
|
|
222
|
<td>
|
|
239
|
<td>
|
|
223
|
% if c.at_version_num != ver_pr:
|
|
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
|
G:${len(c.comment_versions[ver_pr]['at'])} / I:${len(c.inline_versions[ver_pr]['at'])}
|
|
243
|
General:${len(c.comment_versions[ver_pr]['at'])} / Inline:${len(c.inline_versions[ver_pr]['at'])}
|
|
227
|
</code>
|
|
244
|
</code>
|
|
228
|
% endif
|
|
245
|
% endif
|
|
229
|
</td>
|
|
246
|
</td>
|
|
230
|
<td>
|
|
247
|
<td>
|
|
231
|
##<code>${ver.source_ref_parts.commit_id[:6]}</code>
|
|
248
|
##<code>${ver.source_ref_parts.commit_id[:6]}</code>
|
|
232
|
</td>
|
|
249
|
</td>
|
|
233
|
<td>
|
|
250
|
<td>
|
|
234
|
${h.age_component(ver.updated_on, time_is_local=True)}
|
|
251
|
<code>${h.age_component(ver.updated_on, time_is_local=True, tooltip=False)}</code>
|
|
235
|
</td>
|
|
|
|
|
236
|
</tr>
|
|
|
|
|
237
|
% endfor
|
|
|
|
|
238
|
|
|
|
|
|
239
|
<tr>
|
|
|
|
|
240
|
<td colspan="6">
|
|
|
|
|
241
|
<button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
|
|
|
|
|
242
|
data-label-text-locked="${_('select versions to show changes')}"
|
|
|
|
|
243
|
data-label-text-diff="${_('show changes between versions')}"
|
|
|
|
|
244
|
data-label-text-show="${_('show pull request for this version')}"
|
|
|
|
|
245
|
>
|
|
|
|
|
246
|
${_('select versions to show changes')}
|
|
|
|
|
247
|
</button>
|
|
|
|
|
248
|
</td>
|
|
252
|
</td>
|
|
249
|
</tr>
|
|
253
|
</tr>
|
|
250
|
</table>
|
|
254
|
% endfor
|
|
251
|
% else:
|
|
255
|
|
|
252
|
<div class="input">
|
|
256
|
<tr>
|
|
253
|
${_('Pull request versions not available')}.
|
|
257
|
<td colspan="6">
|
|
254
|
</div>
|
|
258
|
<button id="show-version-diff" onclick="return versionController.showVersionDiff()" class="btn btn-sm" style="display: none"
|
|
255
|
% endif
|
|
259
|
data-label-text-locked="${_('select versions to show changes')}"
|
|
|
|
|
260
|
data-label-text-diff="${_('show changes between versions')}"
|
|
|
|
|
261
|
data-label-text-show="${_('show pull request for this version')}"
|
|
|
|
|
262
|
>
|
|
|
|
|
263
|
${_('select versions to show changes')}
|
|
|
|
|
264
|
</button>
|
|
|
|
|
265
|
</td>
|
|
|
|
|
266
|
</tr>
|
|
|
|
|
267
|
</table>
|
|
|
|
|
268
|
% else:
|
|
|
|
|
269
|
<div class="input">
|
|
|
|
|
270
|
${_('Pull request versions not available')}.
|
|
256
|
</div>
|
|
271
|
</div>
|
|
|
|
|
272
|
% endif
|
|
257
|
</div>
|
|
273
|
</div>
|
|
|
|
|
274
|
</div>
|
|
258
|
|
|
275
|
|
|
259
|
<div id="pr-save" class="field" style="display: none;">
|
|
276
|
</div>
|
|
260
|
<div class="label-summary"></div>
|
|
277
|
|
|
261
|
<div class="input">
|
|
278
|
</div>
|
|
262
|
<span id="edit_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</span>
|
|
279
|
|
|
263
|
</div>
|
|
280
|
## REVIEW RULES
|
|
264
|
</div>
|
|
281
|
<div id="review_rules" style="display: none" class="reviewers-title block-right">
|
|
|
|
|
282
|
<div class="pr-details-title">
|
|
|
|
|
283
|
${_('Reviewer rules')}
|
|
|
|
|
284
|
%if c.allowed_to_update:
|
|
|
|
|
285
|
<span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
|
|
|
|
|
286
|
%endif
|
|
265
|
</div>
|
|
287
|
</div>
|
|
266
|
</div>
|
|
288
|
<div class="pr-reviewer-rules">
|
|
267
|
<div>
|
|
289
|
## review rules will be appended here, by default reviewers logic
|
|
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
|
</div>
|
|
290
|
</div>
|
|
281
|
|
|
291
|
<input id="review_data" type="hidden" name="review_data" value="">
|
|
282
|
## REVIEW RULES
|
|
292
|
</div>
|
|
283
|
<div id="review_rules" style="display: none" class="reviewers-title block-right">
|
|
|
|
|
284
|
<div class="pr-details-title">
|
|
|
|
|
285
|
${_('Reviewer rules')}
|
|
|
|
|
286
|
%if c.allowed_to_update:
|
|
|
|
|
287
|
<span id="close_edit_reviewers" class="block-right action_button last-item" style="display: none;">${_('Close')}</span>
|
|
|
|
|
288
|
%endif
|
|
|
|
|
289
|
</div>
|
|
|
|
|
290
|
<div class="pr-reviewer-rules">
|
|
|
|
|
291
|
## review rules will be appended here, by default reviewers logic
|
|
|
|
|
292
|
</div>
|
|
|
|
|
293
|
<input id="review_data" type="hidden" name="review_data" value="">
|
|
|
|
|
294
|
</div>
|
|
|
|
|
295
|
|
|
293
|
|
|
296
|
## REVIEWERS
|
|
294
|
## REVIEWERS
|
|
297
|
<div class="reviewers-title block-right">
|
|
295
|
<div class="reviewers-title block-right">
|
|
298
|
<div class="pr-details-title">
|
|
296
|
<div class="pr-details-title">
|
|
299
|
${_('Pull request reviewers')}
|
|
297
|
${_('Pull request reviewers')}
|
|
300
|
%if c.allowed_to_update:
|
|
298
|
%if c.allowed_to_update:
|
|
301
|
<span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
|
|
299
|
<span id="open_edit_reviewers" class="block-right action_button last-item">${_('Edit')}</span>
|
|
302
|
%endif
|
|
300
|
%endif
|
|
303
|
</div>
|
|
301
|
</div>
|
|
304
|
</div>
|
|
302
|
</div>
|
|
305
|
<div id="reviewers" class="block-right pr-details-content reviewers">
|
|
303
|
<div id="reviewers" class="block-right pr-details-content reviewers">
|
|
306
|
|
|
304
|
|
|
307
|
## members redering block
|
|
305
|
## members redering block
|
|
308
|
<input type="hidden" name="__start__" value="review_members:sequence">
|
|
306
|
<input type="hidden" name="__start__" value="review_members:sequence">
|
|
309
|
<ul id="review_members" class="group_members">
|
|
307
|
<ul id="review_members" class="group_members">
|
|
310
|
|
|
308
|
|
|
311
|
% for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers:
|
|
309
|
% for review_obj, member, reasons, mandatory, status in c.pull_request_reviewers:
|
|
312
|
<script>
|
|
310
|
<script>
|
|
313
|
var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n};
|
|
311
|
var member = ${h.json.dumps(h.reviewer_as_json(member, reasons=reasons, mandatory=mandatory, user_group=review_obj.rule_user_group_data()))|n};
|
|
314
|
var status = "${(status[0][1].status if status else 'not_reviewed')}";
|
|
312
|
var status = "${(status[0][1].status if status else 'not_reviewed')}";
|
|
315
|
var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}";
|
|
313
|
var status_lbl = "${h.commit_status_lbl(status[0][1].status if status else 'not_reviewed')}";
|
|
316
|
var allowed_to_update = ${h.json.dumps(c.allowed_to_update)};
|
|
314
|
var allowed_to_update = ${h.json.dumps(c.allowed_to_update)};
|
|
317
|
|
|
315
|
|
|
318
|
var entry = renderTemplate('reviewMemberEntry', {
|
|
316
|
var entry = renderTemplate('reviewMemberEntry', {
|
|
319
|
'member': member,
|
|
317
|
'member': member,
|
|
320
|
'mandatory': member.mandatory,
|
|
318
|
'mandatory': member.mandatory,
|
|
321
|
'reasons': member.reasons,
|
|
319
|
'reasons': member.reasons,
|
|
322
|
'allowed_to_update': allowed_to_update,
|
|
320
|
'allowed_to_update': allowed_to_update,
|
|
323
|
'review_status': status,
|
|
321
|
'review_status': status,
|
|
324
|
'review_status_label': status_lbl,
|
|
322
|
'review_status_label': status_lbl,
|
|
325
|
'user_group': member.user_group,
|
|
323
|
'user_group': member.user_group,
|
|
326
|
'create': false
|
|
324
|
'create': false
|
|
327
|
});
|
|
325
|
});
|
|
328
|
$('#review_members').append(entry)
|
|
326
|
$('#review_members').append(entry)
|
|
329
|
</script>
|
|
327
|
</script>
|
|
330
|
|
|
328
|
|
|
331
|
% endfor
|
|
329
|
% endfor
|
|
332
|
|
|
|
|
|
333
|
</ul>
|
|
|
|
|
334
|
|
|
330
|
|
|
335
|
<input type="hidden" name="__end__" value="review_members:sequence">
|
|
331
|
</ul>
|
|
336
|
## end members redering block
|
|
332
|
|
|
|
|
|
333
|
<input type="hidden" name="__end__" value="review_members:sequence">
|
|
|
|
|
334
|
## end members redering block
|
|
337
|
|
|
335
|
|
|
338
|
%if not c.pull_request.is_closed():
|
|
336
|
%if not c.pull_request.is_closed():
|
|
339
|
<div id="add_reviewer" class="ac" style="display: none;">
|
|
337
|
<div id="add_reviewer" class="ac" style="display: none;">
|
|
340
|
%if c.allowed_to_update:
|
|
338
|
%if c.allowed_to_update:
|
|
341
|
% if not c.forbid_adding_reviewers:
|
|
339
|
% if not c.forbid_adding_reviewers:
|
|
342
|
<div id="add_reviewer_input" class="reviewer_ac">
|
|
340
|
<div id="add_reviewer_input" class="reviewer_ac">
|
|
343
|
${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))}
|
|
341
|
${h.text('user', class_='ac-input', placeholder=_('Add reviewer or reviewer group'))}
|
|
344
|
<div id="reviewers_container"></div>
|
|
342
|
<div id="reviewers_container"></div>
|
|
345
|
</div>
|
|
|
|
|
346
|
% endif
|
|
|
|
|
347
|
<div class="pull-right">
|
|
|
|
|
348
|
<button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button>
|
|
|
|
|
349
|
</div>
|
|
343
|
</div>
|
|
350
|
%endif
|
|
344
|
% endif
|
|
|
|
|
345
|
<div class="pull-right">
|
|
|
|
|
346
|
<button id="update_pull_request" class="btn btn-small no-margin">${_('Save Changes')}</button>
|
|
351
|
</div>
|
|
347
|
</div>
|
|
352
|
%endif
|
|
348
|
%endif
|
|
353
|
</div>
|
|
349
|
</div>
|
|
354
|
</div>
|
|
350
|
%endif
|
|
|
|
|
351
|
</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
|
|
|
@@
-611,209
+625,218
b''
|
|
611
|
% endif
|
|
625
|
% endif
|
|
612
|
</div>
|
|
626
|
</div>
|
|
613
|
|
|
627
|
|
|
614
|
<script type="text/javascript">
|
|
628
|
<script type="text/javascript">
|
|
615
|
|
|
629
|
|
|
616
|
versionController = new VersionController();
|
|
630
|
versionController = new VersionController();
|
|
617
|
versionController.init();
|
|
631
|
versionController.init();
|
|
618
|
|
|
632
|
|
|
619
|
reviewersController = new ReviewersController();
|
|
633
|
reviewersController = new ReviewersController();
|
|
620
|
commitsController = new CommitsController();
|
|
634
|
commitsController = new CommitsController();
|
|
621
|
|
|
635
|
|
|
622
|
updateController = new UpdatePrController();
|
|
636
|
updateController = new UpdatePrController();
|
|
623
|
|
|
637
|
|
|
624
|
$(function(){
|
|
638
|
$(function () {
|
|
625
|
|
|
639
|
|
|
626
|
// custom code mirror
|
|
640
|
// custom code mirror
|
|
627
|
var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
|
|
641
|
var codeMirrorInstance = $('#pr-description-input').get(0).MarkupForm.cm;
|
|
628
|
|
|
642
|
|
|
629
|
var PRDetails = {
|
|
643
|
var PRDetails = {
|
|
630
|
editButton: $('#open_edit_pullrequest'),
|
|
644
|
editButton: $('#open_edit_pullrequest'),
|
|
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, #pr-save'),
|
|
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) { that.edit(); });
|
|
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) {
|
|
643
|
this.viewFields.hide();
|
|
661
|
this.viewFields.hide();
|
|
644
|
this.editButton.hide();
|
|
662
|
this.editButton.hide();
|
|
645
|
this.deleteButton.hide();
|
|
663
|
this.deleteButton.hide();
|
|
646
|
this.closeButton.show();
|
|
664
|
this.closeButton.show();
|
|
647
|
this.editFields.show();
|
|
665
|
this.editFields.show();
|
|
648
|
codeMirrorInstance.refresh();
|
|
666
|
codeMirrorInstance.refresh();
|
|
649
|
},
|
|
667
|
},
|
|
650
|
|
|
668
|
|
|
651
|
view: function(event) {
|
|
669
|
view: function (event) {
|
|
652
|
this.editButton.show();
|
|
670
|
this.editButton.show();
|
|
653
|
this.deleteButton.show();
|
|
671
|
this.deleteButton.show();
|
|
654
|
this.editFields.hide();
|
|
672
|
this.editFields.hide();
|
|
655
|
this.closeButton.hide();
|
|
673
|
this.closeButton.hide();
|
|
656
|
this.viewFields.show();
|
|
674
|
this.viewFields.show();
|
|
657
|
}
|
|
675
|
}
|
|
658
|
};
|
|
676
|
};
|
|
659
|
|
|
677
|
|
|
660
|
var ReviewersPanel = {
|
|
678
|
var ReviewersPanel = {
|
|
661
|
editButton: $('#open_edit_reviewers'),
|
|
679
|
editButton: $('#open_edit_reviewers'),
|
|
662
|
closeButton: $('#close_edit_reviewers'),
|
|
680
|
closeButton: $('#close_edit_reviewers'),
|
|
663
|
addButton: $('#add_reviewer'),
|
|
681
|
addButton: $('#add_reviewer'),
|
|
664
|
removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'),
|
|
682
|
removeButtons: $('.reviewer_member_remove,.reviewer_member_mandatory_remove'),
|
|
665
|
|
|
683
|
|
|
666
|
init: function() {
|
|
684
|
init: function () {
|
|
667
|
var self = this;
|
|
685
|
var self = this;
|
|
668
|
this.editButton.on('click', function(e) { self.edit(); });
|
|
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) {
|
|
673
|
this.editButton.hide();
|
|
695
|
this.editButton.hide();
|
|
674
|
this.closeButton.show();
|
|
696
|
this.closeButton.show();
|
|
675
|
this.addButton.show();
|
|
697
|
this.addButton.show();
|
|
676
|
this.removeButtons.css('visibility', 'visible');
|
|
698
|
this.removeButtons.css('visibility', 'visible');
|
|
677
|
// review rules
|
|
699
|
// review rules
|
|
678
|
reviewersController.loadReviewRules(
|
|
700
|
reviewersController.loadReviewRules(
|
|
679
|
${c.pull_request.reviewer_data_json | n});
|
|
701
|
${c.pull_request.reviewer_data_json | n});
|
|
680
|
},
|
|
702
|
},
|
|
681
|
|
|
703
|
|
|
682
|
close: function(event) {
|
|
704
|
close: function (event) {
|
|
683
|
this.editButton.show();
|
|
705
|
this.editButton.show();
|
|
684
|
this.closeButton.hide();
|
|
706
|
this.closeButton.hide();
|
|
685
|
this.addButton.hide();
|
|
707
|
this.addButton.hide();
|
|
686
|
this.removeButtons.css('visibility', 'hidden');
|
|
708
|
this.removeButtons.css('visibility', 'hidden');
|
|
687
|
// hide review rules
|
|
709
|
// hide review rules
|
|
688
|
reviewersController.hideReviewRules()
|
|
710
|
reviewersController.hideReviewRules()
|
|
689
|
}
|
|
711
|
}
|
|
690
|
};
|
|
712
|
};
|
|
691
|
|
|
713
|
|
|
692
|
PRDetails.init();
|
|
714
|
PRDetails.init();
|
|
693
|
ReviewersPanel.init();
|
|
715
|
ReviewersPanel.init();
|
|
694
|
|
|
716
|
|
|
695
|
showOutdated = function(self){
|
|
717
|
showOutdated = function (self) {
|
|
696
|
$('.comment-inline.comment-outdated').show();
|
|
718
|
$('.comment-inline.comment-outdated').show();
|
|
697
|
$('.filediff-outdated').show();
|
|
719
|
$('.filediff-outdated').show();
|
|
698
|
$('.showOutdatedComments').hide();
|
|
720
|
$('.showOutdatedComments').hide();
|
|
699
|
$('.hideOutdatedComments').show();
|
|
721
|
$('.hideOutdatedComments').show();
|
|
700
|
};
|
|
722
|
};
|
|
701
|
|
|
723
|
|
|
702
|
hideOutdated = function(self){
|
|
724
|
hideOutdated = function (self) {
|
|
703
|
$('.comment-inline.comment-outdated').hide();
|
|
725
|
$('.comment-inline.comment-outdated').hide();
|
|
704
|
$('.filediff-outdated').hide();
|
|
726
|
$('.filediff-outdated').hide();
|
|
705
|
$('.hideOutdatedComments').hide();
|
|
727
|
$('.hideOutdatedComments').hide();
|
|
706
|
$('.showOutdatedComments').show();
|
|
728
|
$('.showOutdatedComments').show();
|
|
707
|
};
|
|
729
|
};
|
|
708
|
|
|
730
|
|
|
709
|
refreshMergeChecks = function(){
|
|
731
|
refreshMergeChecks = function () {
|
|
710
|
var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
|
|
732
|
var loadUrl = "${request.current_route_path(_query=dict(merge_checks=1))}";
|
|
711
|
$('.pull-request-merge').css('opacity', 0.3);
|
|
733
|
$('.pull-request-merge').css('opacity', 0.3);
|
|
712
|
$('.action-buttons-extra').css('opacity', 0.3);
|
|
734
|
$('.action-buttons-extra').css('opacity', 0.3);
|
|
713
|
|
|
735
|
|
|
714
|
$('.pull-request-merge').load(
|
|
736
|
$('.pull-request-merge').load(
|
|
715
|
loadUrl, function() {
|
|
737
|
loadUrl, function () {
|
|
716
|
$('.pull-request-merge').css('opacity', 1);
|
|
738
|
$('.pull-request-merge').css('opacity', 1);
|
|
717
|
|
|
739
|
|
|
718
|
$('.action-buttons-extra').css('opacity', 1);
|
|
740
|
$('.action-buttons-extra').css('opacity', 1);
|
|
719
|
}
|
|
741
|
}
|
|
720
|
);
|
|
742
|
);
|
|
721
|
};
|
|
743
|
};
|
|
722
|
|
|
744
|
|
|
723
|
closePullRequest = function (status) {
|
|
745
|
closePullRequest = function (status) {
|
|
724
|
if (!confirm(_gettext('Are you sure to close this pull request without merging?'))) {
|
|
746
|
if (!confirm(_gettext('Are you sure to close this pull request without merging?'))) {
|
|
725
|
return false;
|
|
747
|
return false;
|
|
726
|
}
|
|
748
|
}
|
|
727
|
// inject closing flag
|
|
749
|
// inject closing flag
|
|
728
|
$('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
|
|
750
|
$('.action-buttons-extra').append('<input type="hidden" class="close-pr-input" id="close_pull_request" value="1">');
|
|
729
|
$(generalCommentForm.statusChange).select2("val", status).trigger('change');
|
|
751
|
$(generalCommentForm.statusChange).select2("val", status).trigger('change');
|
|
730
|
$(generalCommentForm.submitForm).submit();
|
|
752
|
$(generalCommentForm.submitForm).submit();
|
|
731
|
};
|
|
753
|
};
|
|
732
|
|
|
754
|
|
|
733
|
$('#show-outdated-comments').on('click', function(e){
|
|
755
|
$('#show-outdated-comments').on('click', function (e) {
|
|
734
|
var button = $(this);
|
|
756
|
var button = $(this);
|
|
735
|
var outdated = $('.comment-outdated');
|
|
757
|
var outdated = $('.comment-outdated');
|
|
736
|
|
|
758
|
|
|
737
|
if (button.html() === "(Show)") {
|
|
759
|
if (button.html() === "(Show)") {
|
|
738
|
button.html("(Hide)");
|
|
760
|
button.html("(Hide)");
|
|
739
|
outdated.show();
|
|
761
|
outdated.show();
|
|
740
|
} else {
|
|
762
|
} else {
|
|
741
|
button.html("(Show)");
|
|
763
|
button.html("(Show)");
|
|
742
|
outdated.hide();
|
|
764
|
outdated.hide();
|
|
743
|
}
|
|
765
|
}
|
|
744
|
});
|
|
766
|
});
|
|
745
|
|
|
767
|
|
|
746
|
$('.show-inline-comments').on('change', function(e){
|
|
768
|
$('.show-inline-comments').on('change', function (e) {
|
|
747
|
var show = 'none';
|
|
769
|
var show = 'none';
|
|
748
|
var target = e.currentTarget;
|
|
770
|
var target = e.currentTarget;
|
|
749
|
if(target.checked){
|
|
771
|
if (target.checked) {
|
|
750
|
show = ''
|
|
772
|
show = ''
|
|
751
|
}
|
|
773
|
}
|
|
752
|
var boxid = $(target).attr('id_for');
|
|
774
|
var boxid = $(target).attr('id_for');
|
|
753
|
var comments = $('#{0} .inline-comments'.format(boxid));
|
|
775
|
var comments = $('#{0} .inline-comments'.format(boxid));
|
|
754
|
var fn_display = function(idx){
|
|
776
|
var fn_display = function (idx) {
|
|
755
|
$(this).css('display', show);
|
|
777
|
$(this).css('display', show);
|
|
756
|
};
|
|
778
|
};
|
|
757
|
$(comments).each(fn_display);
|
|
779
|
$(comments).each(fn_display);
|
|
758
|
var btns = $('#{0} .inline-comments-button'.format(boxid));
|
|
780
|
var btns = $('#{0} .inline-comments-button'.format(boxid));
|
|
759
|
$(btns).each(fn_display);
|
|
781
|
$(btns).each(fn_display);
|
|
760
|
});
|
|
782
|
});
|
|
761
|
|
|
783
|
|
|
762
|
$('#merge_pull_request_form').submit(function() {
|
|
784
|
$('#merge_pull_request_form').submit(function () {
|
|
763
|
if (!$('#merge_pull_request').attr('disabled')) {
|
|
785
|
if (!$('#merge_pull_request').attr('disabled')) {
|
|
764
|
$('#merge_pull_request').attr('disabled', 'disabled');
|
|
786
|
$('#merge_pull_request').attr('disabled', 'disabled');
|
|
765
|
}
|
|
787
|
}
|
|
766
|
return true;
|
|
788
|
return true;
|
|
767
|
});
|
|
789
|
});
|
|
768
|
|
|
790
|
|
|
769
|
$('#edit_pull_request').on('click', function(e){
|
|
791
|
$('#edit_pull_request').on('click', function (e) {
|
|
770
|
var title = $('#pr-title-input').val();
|
|
792
|
var title = $('#pr-title-input').val();
|
|
771
|
var description = codeMirrorInstance.getValue();
|
|
793
|
var description = codeMirrorInstance.getValue();
|
|
772
|
var renderer = $('#pr-renderer-input').val();
|
|
794
|
var renderer = $('#pr-renderer-input').val();
|
|
773
|
editPullRequest(
|
|
795
|
editPullRequest(
|
|
774
|
"${c.repo_name}", "${c.pull_request.pull_request_id}",
|
|
796
|
"${c.repo_name}", "${c.pull_request.pull_request_id}",
|
|
775
|
title, description, renderer);
|
|
797
|
title, description, renderer);
|
|
776
|
});
|
|
798
|
});
|
|
777
|
|
|
799
|
|
|
778
|
$('#update_pull_request').on('click', function(e){
|
|
800
|
$('#update_pull_request').on('click', function (e) {
|
|
779
|
$(this).attr('disabled', 'disabled');
|
|
801
|
$(this).attr('disabled', 'disabled');
|
|
780
|
$(this).addClass('disabled');
|
|
802
|
$(this).addClass('disabled');
|
|
781
|
$(this).html(_gettext('Saving...'));
|
|
803
|
$(this).html(_gettext('Saving...'));
|
|
782
|
reviewersController.updateReviewers(
|
|
804
|
reviewersController.updateReviewers(
|
|
783
|
"${c.repo_name}", "${c.pull_request.pull_request_id}");
|
|
805
|
"${c.repo_name}", "${c.pull_request.pull_request_id}");
|
|
784
|
});
|
|
806
|
});
|
|
785
|
|
|
807
|
|
|
786
|
|
|
808
|
|
|
787
|
// fixing issue with caches on firefox
|
|
809
|
// fixing issue with caches on firefox
|
|
788
|
$('#update_commits').removeAttr("disabled");
|
|
810
|
$('#update_commits').removeAttr("disabled");
|
|
789
|
|
|
811
|
|
|
790
|
$('.show-inline-comments').on('click', function(e){
|
|
812
|
$('.show-inline-comments').on('click', function (e) {
|
|
791
|
var boxid = $(this).attr('data-comment-id');
|
|
813
|
var boxid = $(this).attr('data-comment-id');
|
|
792
|
var button = $(this);
|
|
814
|
var button = $(this);
|
|
793
|
|
|
815
|
|
|
794
|
if(button.hasClass("comments-visible")) {
|
|
816
|
if (button.hasClass("comments-visible")) {
|
|
795
|
$('#{0} .inline-comments'.format(boxid)).each(function(index){
|
|
817
|
$('#{0} .inline-comments'.format(boxid)).each(function (index) {
|
|
796
|
$(this).hide();
|
|
818
|
$(this).hide();
|
|
797
|
});
|
|
819
|
});
|
|
798
|
button.removeClass("comments-visible");
|
|
820
|
button.removeClass("comments-visible");
|
|
799
|
} else {
|
|
821
|
} else {
|
|
800
|
$('#{0} .inline-comments'.format(boxid)).each(function(index){
|
|
822
|
$('#{0} .inline-comments'.format(boxid)).each(function (index) {
|
|
801
|
$(this).show();
|
|
823
|
$(this).show();
|
|
802
|
});
|
|
824
|
});
|
|
803
|
button.addClass("comments-visible");
|
|
825
|
button.addClass("comments-visible");
|
|
804
|
}
|
|
826
|
}
|
|
805
|
});
|
|
827
|
});
|
|
806
|
|
|
828
|
|
|
807
|
// register submit callback on commentForm form to track TODOs
|
|
829
|
// register submit callback on commentForm form to track TODOs
|
|
808
|
window.commentFormGlobalSubmitSuccessCallback = function(){
|
|
830
|
window.commentFormGlobalSubmitSuccessCallback = function () {
|
|
809
|
refreshMergeChecks();
|
|
831
|
refreshMergeChecks();
|
|
810
|
};
|
|
832
|
};
|
|
811
|
|
|
833
|
|
|
812
|
ReviewerAutoComplete('#user');
|
|
834
|
ReviewerAutoComplete('#user');
|
|
813
|
|
|
835
|
|
|
814
|
})
|
|
836
|
})
|
|
815
|
|
|
837
|
|
|
816
|
</script>
|
|
838
|
</script>
|
|
|
|
|
839
|
|
|
817
|
</div>
|
|
840
|
</div>
|
|
818
|
|
|
841
|
|
|
819
|
</%def>
|
|
842
|
</%def>
|