##// END OF EJS Templates
pull-requests: expose TODO box in dedicated panel...
marcink -
r4140:eb578430 default
parent child
Show More
@@ -52,6 +52,16 a { cursor: pointer; }
52 }
52 }
53 }
53 }
54
54
55 .noselect {
56 -webkit-touch-callout: none; /* iOS Safari */
57 -webkit-user-select: none; /* Safari */
58 -khtml-user-select: none; /* Konqueror HTML */
59 -moz-user-select: none; /* Firefox */
60 -ms-user-select: none; /* Internet Explorer/Edge */
61 user-select: none; /* Non-prefixed version, currently
62 supported by Chrome and Opera */
63 }
64
55 //--- DEVICE-SPECIFIC CLASSES ---------------//
65 //--- DEVICE-SPECIFIC CLASSES ---------------//
56 //regular tablet and up
66 //regular tablet and up
57 @media (min-width:768px) {
67 @media (min-width:768px) {
@@ -434,7 +434,8 ul.auth_plugins {
434 input {
434 input {
435 border: 1px transparent;
435 border: 1px transparent;
436 color: black;
436 color: black;
437 opacity: 1
437 opacity: 1;
438 background: #fff;
438 }
439 }
439 }
440 }
440
441
@@ -507,13 +508,21 ul.auth_plugins {
507 vertical-align: top;
508 vertical-align: top;
508 }
509 }
509
510
511 #open_edit_pullrequest {
512 padding: 0;
513 }
514
510 #close_edit_pullrequest {
515 #close_edit_pullrequest {
511 padding-left: 1em
516
512 }
517 }
513
518
514 #delete_pullrequest {
519 #delete_pullrequest {
515 clear: inherit;
520 clear: inherit;
516 padding: 0
521
522 form {
523 display: inline;
524 }
525
517 }
526 }
518
527
519 .perms_section_head {
528 .perms_section_head {
@@ -820,6 +829,11 label {
820 padding: 0 0 0 .17em;
829 padding: 0 0 0 .17em;
821 line-height: 1em;
830 line-height: 1em;
822 }
831 }
832
833 & + .no-margin {
834 margin: 0
835 }
836
823 }
837 }
824
838
825 .user-inline-data {
839 .user-inline-data {
@@ -836,7 +850,7 label {
836 max-width: 200px;
850 max-width: 200px;
837 min-height: (@gravatar-size + @border-thickness * 2); // account for border
851 min-height: (@gravatar-size + @border-thickness * 2); // account for border
838 display: block;
852 display: block;
839 padding: 0 0 0 (@gravatar-size + @basefontsize/2 + @border-thickness * 2);
853 padding: 0 0 0 (@gravatar-size + @basefontsize/4);
840
854
841
855
842 .gravatar {
856 .gravatar {
@@ -1566,14 +1580,52 table.integrations {
1566 }
1580 }
1567 }
1581 }
1568 .pr-details-content {
1582 .pr-details-content {
1569 margin-top: @textmargin;
1583 margin-top: @textmargin - 5;
1570 margin-bottom: @textmargin;
1584 margin-bottom: @textmargin - 5;
1571 }
1585 }
1572
1586
1573 .pr-reviewer-rules {
1587 .pr-reviewer-rules {
1574 padding: 10px 0px 20px 0px;
1588 padding: 10px 0px 20px 0px;
1575 }
1589 }
1576
1590
1591 .todo-resolved {
1592 text-decoration: line-through;
1593 }
1594
1595 .todo-table {
1596 width: 100%;
1597
1598 td {
1599 padding: 5px 0px;
1600 }
1601
1602 .td-todo-number {
1603 text-align: left;
1604 white-space: nowrap;
1605 width: 15%;
1606 }
1607
1608 .td-todo-gravatar {
1609 width: 5%;
1610
1611 img {
1612 margin: -3px 0;
1613 }
1614 }
1615
1616 }
1617
1618 .todo-comment-text-wrapper {
1619 display: inline-grid;
1620 }
1621
1622 .todo-comment-text {
1623 margin-left: 5px;
1624 white-space: nowrap;
1625 overflow: hidden;
1626 text-overflow: ellipsis;
1627 }
1628
1577 .group_members {
1629 .group_members {
1578 margin-top: 0;
1630 margin-top: 0;
1579 padding: 0;
1631 padding: 0;
@@ -511,15 +511,17 var CommentsController = function() {
511 node = $('comment-current')
511 node = $('comment-current')
512 }
512 }
513 }
513 }
514
514 $wrapper = $(node).closest('div.comment');
515 $wrapper = $(node).closest('div.comment');
515 $comment = $(node).closest(klass);
516 $comments = $(klass);
517
516
518 // show hidden comment when referenced.
517 // show hidden comment when referenced.
519 if (!$wrapper.is(':visible')){
518 if (!$wrapper.is(':visible')){
520 $wrapper.show();
519 $wrapper.show();
521 }
520 }
522
521
522 $comment = $(node).closest(klass);
523 $comments = $(klass);
524
523 $('.comment-selected').removeClass('comment-selected');
525 $('.comment-selected').removeClass('comment-selected');
524
526
525 var nextIdx = $(klass).index($comment) + offset;
527 var nextIdx = $(klass).index($comment) + offset;
@@ -629,7 +631,7 var CommentsController = function() {
629 var cm = commentForm.getCmInstance();
631 var cm = commentForm.getCmInstance();
630
632
631 if (resolvesCommentId){
633 if (resolvesCommentId){
632 var placeholderText = _gettext('Leave a comment, or click resolve button to resolve TODO comment #{0}').format(resolvesCommentId);
634 var placeholderText = _gettext('Leave a resolution comment, or click resolve button to resolve TODO comment #{0}').format(resolvesCommentId);
633 }
635 }
634
636
635 setTimeout(function() {
637 setTimeout(function() {
@@ -198,7 +198,7
198
198
199 </%def>
199 </%def>
200
200
201 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None)">
201 <%def name="gravatar(email, size=16, tooltip=False, tooltip_alt=None, user=None, extra_class=None)">
202 <%
202 <%
203 if size > 16:
203 if size > 16:
204 gravatar_class = ['gravatar','gravatar-large']
204 gravatar_class = ['gravatar','gravatar-large']
@@ -210,7 +210,8
210
210
211 if tooltip:
211 if tooltip:
212 gravatar_class += ['tooltip-hovercard']
212 gravatar_class += ['tooltip-hovercard']
213
213 if extra_class:
214 gravatar_class += extra_class
214 if tooltip and user:
215 if tooltip and user:
215 if user.username == h.DEFAULT_USER:
216 if user.username == h.DEFAULT_USER:
216 gravatar_class.pop(-1)
217 gravatar_class.pop(-1)
@@ -50,7 +50,10 return '%s_%s_%i' % (h.md5_safe(commit+f
50 inline_comments=None,
50 inline_comments=None,
51
51
52 # additional menu for PRs
52 # additional menu for PRs
53 pull_request_menu=None
53 pull_request_menu=None,
54
55 # show/hide todo next to comments
56 show_todos=True,
54
57
55 )">
58 )">
56
59
@@ -128,12 +131,12 return '%s_%s_%i' % (h.md5_safe(commit+f
128 </div>
131 </div>
129
132
130 ## todos
133 ## todos
131 % if getattr(c, 'at_version', None):
134 % if show_todos and getattr(c, 'at_version', None):
132 <div class="pull-right">
135 <div class="pull-right">
133 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
136 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
134 ${_('not available in this view')}
137 ${_('not available in this view')}
135 </div>
138 </div>
136 % else:
139 % elif show_todos:
137 <div class="pull-right">
140 <div class="pull-right">
138 <div class="comments-number" style="padding-left: 10px">
141 <div class="comments-number" style="padding-left: 10px">
139 % if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
142 % if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
@@ -310,7 +313,7 return '%s_%s_%i' % (h.md5_safe(commit+f
310 <td colspan="3"></td>
313 <td colspan="3"></td>
311 <td>
314 <td>
312 <div>
315 <div>
313 ${_('Unmatched inline comments below')}
316 ${_('Unmatched/outdated inline comments below')}
314 </div>
317 </div>
315 </td>
318 </td>
316 </tr>
319 </tr>
@@ -329,13 +332,13 return '%s_%s_%i' % (h.md5_safe(commit+f
329 <td colspan="2"></td>
332 <td colspan="2"></td>
330 <td class="cb-line">
333 <td class="cb-line">
331 <div>
334 <div>
332 ${_('Unmatched inline comments below')}
335 ${_('Unmatched/outdated inline comments below')}
333 </div>
336 </div>
334 </td>
337 </td>
335 <td colspan="2"></td>
338 <td colspan="2"></td>
336 <td class="cb-line">
339 <td class="cb-line">
337 <div>
340 <div>
338 ${_('Unmatched comments below')}
341 ${_('Unmatched/outdated comments below')}
339 </div>
342 </div>
340 </td>
343 </td>
341 </tr>
344 </tr>
@@ -59,19 +59,22
59 </div>
59 </div>
60
60
61 %if c.allowed_to_update:
61 %if c.allowed_to_update:
62 <div id="delete_pullrequest" class="pull-right action_button ${('' if c.allowed_to_delete else 'disabled' )}" >
62 <div class="pull-right">
63 % if c.allowed_to_delete:
63 <div id="edit_pull_request" class="action_button pr-save" style="display: none;">${_('Update title & description')}</div>
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)}
64 <div id="delete_pullrequest" class="action_button pr-save ${('' if c.allowed_to_delete else 'disabled' )}" style="display: none;">
65 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
65 % if c.allowed_to_delete:
66 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
66 ${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)}
67 ${h.end_form()}
67 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete pull request'),
68 % else:
68 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
69 ${_('Delete')}
69 ${h.end_form()}
70 % endif
70 % else:
71 <span class="tooltip" title="${_('Not allowed to delete this pull request')}">${_('Delete pull request')}</span>
72 % endif
73 </div>
74 <div id="open_edit_pullrequest" class="action_button">${_('Edit')}</div>
75 <div id="close_edit_pullrequest" class="action_button" style="display: none;">${_('Cancel')}</div>
71 </div>
76 </div>
72 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
77
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>
75 %endif
78 %endif
76 </div>
79 </div>
77
80
@@ -266,7 +269,7
266 </tr>
269 </tr>
267 </table>
270 </table>
268 % else:
271 % else:
269 <div class="input">
272 <div>
270 ${_('Pull request versions not available')}.
273 ${_('Pull request versions not available')}.
271 </div>
274 </div>
272 % endif
275 % endif
@@ -350,20 +353,82
350 %endif
353 %endif
351 </div>
354 </div>
352
355
353 ## ## TODOs will be listed here
356 ## TODOs will be listed here
354 ## <div class="reviewers-title block-right">
357 <div class="reviewers-title block-right">
355 ## <div class="pr-details-title">
358 <div class="pr-details-title">
356 ## ${_('TODOs')}
359 ## Only show unresolved, that is only what matters
357 ## </div>
360 TODO Comments - ${len(c.unresolved_comments)} / ${(len(c.unresolved_comments) + len(c.resolved_comments))}
358 ## </div>
361
359 ## <div class="block-right pr-details-content reviewers">
362 % if not c.at_version:
360 ## <ul class="group_members">
363 % if c.resolved_comments:
361 ## <li>
364 <span class="block-right action_button last-item noselect" onclick="$('.unresolved-todo-text').toggle(); return versionController.toggleElement(this, '.unresolved-todo');" data-toggle-on="Show resolved" data-toggle-off="Hide resolved">Show resolved</span>
362 ## XXXX
365 % else:
363 ## </li>
366 <span class="block-right last-item noselect">Show resolved</span>
364 ## </ul>
367 % endif
365 ## </div>
368 % endif
366 ## </div>
369 </div>
370 </div>
371 <div class="block-right pr-details-content reviewers">
372
373 <table class="todo-table">
374 <%
375 def sorter(entry):
376 user_id = entry.author.user_id
377 resolved = '1' if entry.resolved else '0'
378 if user_id == c.rhodecode_user.user_id:
379 # own comments first
380 user_id = 0
381 return '{}_{}_{}'.format(resolved, user_id, str(entry.comment_id).zfill(100))
382 %>
383
384 % if c.at_version:
385 <tr>
386 <td class="unresolved-todo-text">${_('unresolved TODOs unavailable in this view')}.</td>
387 </tr>
388 % else:
389 % for todo_comment in sorted(c.unresolved_comments + c.resolved_comments, key=sorter):
390 <% resolved = todo_comment.resolved %>
391 % if inline:
392 <% outdated_at_ver = todo_comment.outdated_at_version(getattr(c, 'at_version_num', None)) %>
393 % else:
394 <% outdated_at_ver = todo_comment.older_than_version(getattr(c, 'at_version_num', None)) %>
395 % endif
396
397 <tr ${('class="unresolved-todo" style="display: none"' if resolved else '') |n}>
398
399 <td class="td-todo-number">
400 % if resolved:
401 <a class="permalink todo-resolved tooltip" title="${_('Resolved by comment #{}').format(todo_comment.resolved.comment_id)}" href="#comment-${todo_comment.comment_id}" onclick="return Rhodecode.comments.scrollToComment($('#comment-${todo_comment.comment_id}'), 0, ${h.json.dumps(outdated_at_ver)})">
402 <i class="icon-flag-filled"></i> ${todo_comment.comment_id}</a>
403 % else:
404 <a class="permalink" href="#comment-${todo_comment.comment_id}" onclick="return Rhodecode.comments.scrollToComment($('#comment-${todo_comment.comment_id}'), 0, ${h.json.dumps(outdated_at_ver)})">
405 <i class="icon-flag-filled"></i> ${todo_comment.comment_id}</a>
406 % endif
407 </td>
408 <td class="td-todo-gravatar">
409 ${base.gravatar(todo_comment.author.email, 16, user=todo_comment.author, tooltip=True, extra_class=['no-margin'])}
410 </td>
411 <td class="todo-comment-text-wrapper">
412 <div class="todo-comment-text">
413 <code>${h.chop_at_smart(todo_comment.text, '\n', suffix_if_chopped='...')}</code>
414 </div>
415 </td>
416
417 </tr>
418 % endfor
419
420 % if len(c.unresolved_comments) == 0:
421 <tr>
422 <td class="unresolved-todo-text">${_('No unresolved TODOs')}.</td>
423 </tr>
424 % endif
425
426 % endif
427
428 </table>
429
430 </div>
431 </div>
367
432
368 </div>
433 </div>
369
434
@@ -561,7 +626,7
561 disable_new_comments=True,
626 disable_new_comments=True,
562 deleted_files_comments=c.deleted_files_comments,
627 deleted_files_comments=c.deleted_files_comments,
563 inline_comments=c.inline_comments,
628 inline_comments=c.inline_comments,
564 pull_request_menu=pr_menu_data)}
629 pull_request_menu=pr_menu_data, show_todos=False)}
565 % endfor
630 % endfor
566 % else:
631 % else:
567 ${cbdiffs.render_diffset(
632 ${cbdiffs.render_diffset(
@@ -570,7 +635,7
570 disable_new_comments=not c.allowed_to_comment,
635 disable_new_comments=not c.allowed_to_comment,
571 deleted_files_comments=c.deleted_files_comments,
636 deleted_files_comments=c.deleted_files_comments,
572 inline_comments=c.inline_comments,
637 inline_comments=c.inline_comments,
573 pull_request_menu=pr_menu_data)}
638 pull_request_menu=pr_menu_data, show_todos=False)}
574 % endif
639 % endif
575
640
576 </div>
641 </div>
General Comments 0
You need to be logged in to leave comments. Login now