##// END OF EJS Templates
commits: skip hidden/obsolete commits (on vcsserver) and display branch when DAG diverges on child/parent links
marcink -
r3852:611dc781 default
parent child Browse files
Show More
@@ -1,350 +1,356 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 <%inherit file="/base/base.mako"/>
4 4 <%namespace name="diff_block" file="/changeset/diff_block.mako"/>
5 5
6 6 <%def name="title()">
7 7 ${_('%s Commit') % c.repo_name} - ${h.show_id(c.commit)}
8 8 %if c.rhodecode_name:
9 9 &middot; ${h.branding(c.rhodecode_name)}
10 10 %endif
11 11 </%def>
12 12
13 13 <%def name="menu_bar_nav()">
14 14 ${self.menu_items(active='repositories')}
15 15 </%def>
16 16
17 17 <%def name="menu_bar_subnav()">
18 18 ${self.repo_menu(active='commits')}
19 19 </%def>
20 20
21 21 <%def name="main()">
22 22 <script>
23 23 // TODO: marcink switch this to pyroutes
24 24 AJAX_COMMENT_DELETE_URL = "${h.route_path('repo_commit_comment_delete',repo_name=c.repo_name,commit_id=c.commit.raw_id,comment_id='__COMMENT_ID__')}";
25 25 templateContext.commit_data.commit_id = "${c.commit.raw_id}";
26 26 </script>
27 27 <div class="box">
28 28
29 29 <div id="changeset_compare_view_content" class="summary changeset">
30 30 <div class="summary-detail">
31 31 <div class="fieldset">
32 32 <div class="left-label-summary">
33 33 <p>${_('Commit')}</p>
34 34 <div class="right-label-summary">
35 35 <code>
36 36 ${h.show_id(c.commit)}
37 37 </code>
38 38 <i class="tooltip icon-clipboard clipboard-action" data-clipboard-text="${c.commit.raw_id}" title="${_('Copy the full commit id')}"></i>
39 39 % if hasattr(c.commit, 'phase'):
40 40 <span class="tag phase-${c.commit.phase} tooltip" title="${_('Commit phase')}">${c.commit.phase}</span>
41 41 % endif
42 42
43 43 ## obsolete commits
44 44 % if hasattr(c.commit, 'obsolete'):
45 45 % if c.commit.obsolete:
46 46 <span class="tag obsolete-${c.commit.obsolete} tooltip" title="${_('Evolve State')}">${_('obsolete')}</span>
47 47 % endif
48 48 % endif
49 49
50 50 ## hidden commits
51 51 % if hasattr(c.commit, 'hidden'):
52 52 % if c.commit.hidden:
53 53 <span class="tag hidden-${c.commit.hidden} tooltip" title="${_('Evolve State')}">${_('hidden')}</span>
54 54 % endif
55 55 % endif
56 56
57 57
58 58 <div class="pull-right">
59 59 <span id="parent_link">
60 60 <a href="#parentCommit" title="${_('Parent Commit')}"><i class="icon-left icon-no-margin"></i>${_('parent')}</a>
61 61 </span>
62 62 |
63 63 <span id="child_link">
64 64 <a href="#childCommit" title="${_('Child Commit')}">${_('child')}<i class="icon-right icon-no-margin"></i></a>
65 65 </span>
66 66 </div>
67 67
68 68 </div>
69 69 </div>
70 70 </div>
71 71
72 72
73 73
74 74 <div class="fieldset">
75 75 <div class="left-label-summary">
76 76 <p>${_('Description')}:</p>
77 77 <div class="right-label-summary">
78 78 <div id="trimmed_message_box" class="commit">${h.urlify_commit_message(c.commit.message,c.repo_name)}</div>
79 79 <div id="message_expand" style="display:none;">
80 80 ${_('Expand')}
81 81 </div>
82 82 </div>
83 83 </div>
84 84 </div>
85 85
86 86 %if c.statuses:
87 87 <div class="fieldset">
88 88 <div class="left-label-summary">
89 89 <p>${_('Commit status')}:</p>
90 90 <div class="right-label-summary">
91 91 <div class="changeset-status-ico">
92 92 <div class="${'flag_status %s' % c.statuses[0]} pull-left"></div>
93 93 </div>
94 94 <div title="${_('Commit status')}" class="changeset-status-lbl">[${h.commit_status_lbl(c.statuses[0])}]</div>
95 95 </div>
96 96 </div>
97 97 </div>
98 98 %endif
99 99
100 100 <div class="fieldset">
101 101 <div class="left-label-summary">
102 102 <p>${_('References')}:</p>
103 103 <div class="right-label-summary">
104 104 <div class="tags">
105 105 %if c.commit.merge:
106 106 <span class="mergetag tag">
107 107 <i class="icon-merge"></i>${_('merge')}
108 108 </span>
109 109 %endif
110 110
111 111 %if h.is_hg(c.rhodecode_repo):
112 112 %for book in c.commit.bookmarks:
113 113 <span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
114 114 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
115 115 </span>
116 116 %endfor
117 117 %endif
118 118
119 119 %for tag in c.commit.tags:
120 120 <span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
121 121 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
122 122 </span>
123 123 %endfor
124 124
125 125 %if c.commit.branch:
126 126 <span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}">
127 127 <a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
128 128 </span>
129 129 %endif
130 130 </div>
131 131 </div>
132 132 </div>
133 133 </div>
134 134
135 135 <div class="fieldset">
136 136 <div class="left-label-summary">
137 137 <p>${_('Diff options')}:</p>
138 138 <div class="right-label-summary">
139 139 <div class="diff-actions">
140 140 <a href="${h.route_path('repo_commit_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
141 141 ${_('Raw Diff')}
142 142 </a>
143 143 |
144 144 <a href="${h.route_path('repo_commit_patch',repo_name=c.repo_name,commit_id=c.commit.raw_id)}" class="tooltip" title="${h.tooltip(_('Patch diff'))}">
145 145 ${_('Patch Diff')}
146 146 </a>
147 147 |
148 148 <a href="${h.route_path('repo_commit_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(diff='download'))}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
149 149 ${_('Download Diff')}
150 150 </a>
151 151 </div>
152 152 </div>
153 153 </div>
154 154 </div>
155 155
156 156 <div class="fieldset">
157 157 <div class="left-label-summary">
158 158 <p>${_('Comments')}:</p>
159 159 <div class="right-label-summary">
160 160 <div class="comments-number">
161 161 %if c.comments:
162 162 <a href="#comments">${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}</a>,
163 163 %else:
164 164 ${_ungettext("%d Commit comment", "%d Commit comments", len(c.comments)) % len(c.comments)}
165 165 %endif
166 166 %if c.inline_cnt:
167 167 <a href="#" onclick="return Rhodecode.comments.nextComment();" id="inline-comments-counter">${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}</a>
168 168 %else:
169 169 ${_ungettext("%d Inline Comment", "%d Inline Comments", c.inline_cnt) % c.inline_cnt}
170 170 %endif
171 171 </div>
172 172 </div>
173 173 </div>
174 174 </div>
175 175
176 176 <div class="fieldset">
177 177 <div class="left-label-summary">
178 178 <p>${_('Unresolved TODOs')}:</p>
179 179 <div class="right-label-summary">
180 180 <div class="comments-number">
181 181 % if c.unresolved_comments:
182 182 % for co in c.unresolved_comments:
183 183 <a class="permalink" href="#comment-${co.comment_id}" onclick="Rhodecode.comments.scrollToComment($('#comment-${co.comment_id}'))"> #${co.comment_id}</a>${'' if loop.last else ','}
184 184 % endfor
185 185 % else:
186 186 ${_('There are no unresolved TODOs')}
187 187 % endif
188 188 </div>
189 189 </div>
190 190 </div>
191 191 </div>
192 192
193 193 <div class="fieldset">
194 194 <div class="left-label-summary">
195 195 <p>${_('Author')}</p>
196 196
197 197 <div class="right-label-summary">
198 198 ${self.gravatar_with_user(c.commit.author)}
199 199 <div class="user-inline-data">- ${h.age_component(c.commit.date)}</div>
200 200 </div>
201 201 </div>
202 202
203 203 <div class="clear-fix"></div>
204 204
205 205 </div> <!-- end summary-detail -->
206 206 </div> <!-- end summary -->
207 207 </div>
208 208 <div class="cs_files">
209 209 <%namespace name="cbdiffs" file="/codeblocks/diffs.mako"/>
210 210 ${cbdiffs.render_diffset_menu(c.changes[c.commit.raw_id])}
211 211 ${cbdiffs.render_diffset(
212 212 c.changes[c.commit.raw_id], commit=c.commit, use_comments=True,inline_comments=c.inline_comments )}
213 213 </div>
214 214
215 215 ## template for inline comment form
216 216 <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/>
217 217
218 218 ## render comments
219 219 ${comment.generate_comments(c.comments)}
220 220
221 221 ## main comment form and it status
222 222 ${comment.comments(h.route_path('repo_commit_comment_create', repo_name=c.repo_name, commit_id=c.commit.raw_id),
223 223 h.commit_status(c.rhodecode_db_repo, c.commit.raw_id))}
224 224 </div>
225 225
226 226 ## FORM FOR MAKING JS ACTION AS CHANGESET COMMENTS
227 227 <script type="text/javascript">
228 228
229 229 $(document).ready(function() {
230 230
231 231 var boxmax = parseInt($('#trimmed_message_box').css('max-height'), 10);
232 232 if($('#trimmed_message_box').height() === boxmax){
233 233 $('#message_expand').show();
234 234 }
235 235
236 236 $('#message_expand').on('click', function(e){
237 237 $('#trimmed_message_box').css('max-height', 'none');
238 238 $(this).hide();
239 239 });
240 240
241 241 $('.show-inline-comments').on('click', function(e){
242 242 var boxid = $(this).attr('data-comment-id');
243 243 var button = $(this);
244 244
245 245 if(button.hasClass("comments-visible")) {
246 246 $('#{0} .inline-comments'.format(boxid)).each(function(index){
247 247 $(this).hide();
248 248 });
249 249 button.removeClass("comments-visible");
250 250 } else {
251 251 $('#{0} .inline-comments'.format(boxid)).each(function(index){
252 252 $(this).show();
253 253 });
254 254 button.addClass("comments-visible");
255 255 }
256 256 });
257 257
258 258
259 259 // next links
260 260 $('#child_link').on('click', function(e){
261 261 // fetch via ajax what is going to be the next link, if we have
262 262 // >1 links show them to user to choose
263 263 if(!$('#child_link').hasClass('disabled')){
264 264 $.ajax({
265 265 url: '${h.route_path('repo_commit_children',repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
266 266 success: function(data) {
267 267 if(data.results.length === 0){
268 268 $('#child_link').html("${_('No Child Commits')}").addClass('disabled');
269 269 }
270 270 if(data.results.length === 1){
271 271 var commit = data.results[0];
272 272 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
273 273 }
274 274 else if(data.results.length === 2){
275 275 $('#child_link').addClass('disabled');
276 276 $('#child_link').addClass('double');
277
277 278 var _html = '';
278 _html +='<a title="__title__" href="__url__">__rev__</a> '
279 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
280 .replace('__branch__', data.results[0].branch)
279 281 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
280 282 .replace('__title__', data.results[0].message)
281 283 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
282 284 _html +=' | ';
283 _html +='<a title="__title__" href="__url__">__rev__</a> '
285 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a> '
286 .replace('__branch__', data.results[1].branch)
284 287 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
285 288 .replace('__title__', data.results[1].message)
286 289 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
287 290 $('#child_link').html(_html);
288 291 }
289 292 }
290 293 });
291 294 e.preventDefault();
292 295 }
293 296 });
294 297
295 298 // prev links
296 299 $('#parent_link').on('click', function(e){
297 300 // fetch via ajax what is going to be the next link, if we have
298 301 // >1 links show them to user to choose
299 302 if(!$('#parent_link').hasClass('disabled')){
300 303 $.ajax({
301 304 url: '${h.route_path("repo_commit_parents",repo_name=c.repo_name, commit_id=c.commit.raw_id)}',
302 305 success: function(data) {
303 306 if(data.results.length === 0){
304 307 $('#parent_link').html('${_('No Parent Commits')}').addClass('disabled');
305 308 }
306 309 if(data.results.length === 1){
307 310 var commit = data.results[0];
308 311 window.location = pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': commit.raw_id});
309 312 }
310 313 else if(data.results.length === 2){
311 314 $('#parent_link').addClass('disabled');
312 315 $('#parent_link').addClass('double');
316
313 317 var _html = '';
314 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
318 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
319 .replace('__branch__', data.results[0].branch)
315 320 .replace('__rev__','r{0}:{1}'.format(data.results[0].revision, data.results[0].raw_id.substr(0,6)))
316 321 .replace('__title__', data.results[0].message)
317 322 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[0].raw_id}));
318 323 _html +=' | ';
319 _html +='<a title="__title__" href="__url__">Parent __rev__</a>'
324 _html +='<a title="__title__" href="__url__"><span class="tag branchtag"><i class="icon-code-fork"></i>__branch__</span> __rev__</a>'
325 .replace('__branch__', data.results[1].branch)
320 326 .replace('__rev__','r{0}:{1}'.format(data.results[1].revision, data.results[1].raw_id.substr(0,6)))
321 327 .replace('__title__', data.results[1].message)
322 328 .replace('__url__', pyroutes.url('repo_commit', {'repo_name': '${c.repo_name}','commit_id': data.results[1].raw_id}));
323 329 $('#parent_link').html(_html);
324 330 }
325 331 }
326 332 });
327 333 e.preventDefault();
328 334 }
329 335 });
330 336
331 337 if (location.hash) {
332 338 var result = splitDelimitedHash(location.hash);
333 339 var line = $('html').find(result.loc);
334 340 if (line.length > 0){
335 341 offsetScroll(line, 70);
336 342 }
337 343 }
338 344
339 345 // browse tree @ revision
340 346 $('#files_link').on('click', function(e){
341 347 window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
342 348 e.preventDefault();
343 349 });
344 350
345 351 // inject comments into their proper positions
346 352 var file_comments = $('.inline-comment-placeholder');
347 353 })
348 354 </script>
349 355
350 356 </%def>
General Comments 0
You need to be logged in to leave comments. Login now