##// END OF EJS Templates
pull-requests: expose TODO box in dedicated panel...
marcink -
r4140:eb578430 default
parent child Browse files
Show More
@@ -52,6 +52,16 b' 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 65 //--- DEVICE-SPECIFIC CLASSES ---------------//
56 66 //regular tablet and up
57 67 @media (min-width:768px) {
@@ -434,7 +434,8 b' ul.auth_plugins {'
434 434 input {
435 435 border: 1px transparent;
436 436 color: black;
437 opacity: 1
437 opacity: 1;
438 background: #fff;
438 439 }
439 440 }
440 441
@@ -507,13 +508,21 b' ul.auth_plugins {'
507 508 vertical-align: top;
508 509 }
509 510
511 #open_edit_pullrequest {
512 padding: 0;
513 }
514
510 515 #close_edit_pullrequest {
511 padding-left: 1em
516
512 517 }
513 518
514 519 #delete_pullrequest {
515 520 clear: inherit;
516 padding: 0
521
522 form {
523 display: inline;
524 }
525
517 526 }
518 527
519 528 .perms_section_head {
@@ -820,6 +829,11 b' label {'
820 829 padding: 0 0 0 .17em;
821 830 line-height: 1em;
822 831 }
832
833 & + .no-margin {
834 margin: 0
835 }
836
823 837 }
824 838
825 839 .user-inline-data {
@@ -836,7 +850,7 b' label {'
836 850 max-width: 200px;
837 851 min-height: (@gravatar-size + @border-thickness * 2); // account for border
838 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 856 .gravatar {
@@ -1566,14 +1580,52 b' table.integrations {'
1566 1580 }
1567 1581 }
1568 1582 .pr-details-content {
1569 margin-top: @textmargin;
1570 margin-bottom: @textmargin;
1583 margin-top: @textmargin - 5;
1584 margin-bottom: @textmargin - 5;
1571 1585 }
1572 1586
1573 1587 .pr-reviewer-rules {
1574 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 1629 .group_members {
1578 1630 margin-top: 0;
1579 1631 padding: 0;
@@ -511,15 +511,17 b' var CommentsController = function() {'
511 511 node = $('comment-current')
512 512 }
513 513 }
514
514 515 $wrapper = $(node).closest('div.comment');
515 $comment = $(node).closest(klass);
516 $comments = $(klass);
517 516
518 517 // show hidden comment when referenced.
519 518 if (!$wrapper.is(':visible')){
520 519 $wrapper.show();
521 520 }
522 521
522 $comment = $(node).closest(klass);
523 $comments = $(klass);
524
523 525 $('.comment-selected').removeClass('comment-selected');
524 526
525 527 var nextIdx = $(klass).index($comment) + offset;
@@ -629,7 +631,7 b' var CommentsController = function() {'
629 631 var cm = commentForm.getCmInstance();
630 632
631 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 637 setTimeout(function() {
@@ -198,7 +198,7 b''
198 198
199 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 203 if size > 16:
204 204 gravatar_class = ['gravatar','gravatar-large']
@@ -210,7 +210,8 b''
210 210
211 211 if tooltip:
212 212 gravatar_class += ['tooltip-hovercard']
213
213 if extra_class:
214 gravatar_class += extra_class
214 215 if tooltip and user:
215 216 if user.username == h.DEFAULT_USER:
216 217 gravatar_class.pop(-1)
@@ -50,7 +50,10 b" return '%s_%s_%i' % (h.md5_safe(commit+f"
50 50 inline_comments=None,
51 51
52 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 b" return '%s_%s_%i' % (h.md5_safe(commit+f"
128 131 </div>
129 132
130 133 ## todos
131 % if getattr(c, 'at_version', None):
134 % if show_todos and getattr(c, 'at_version', None):
132 135 <div class="pull-right">
133 136 <i class="icon-flag-filled" style="color: #949494">TODOs:</i>
134 137 ${_('not available in this view')}
135 138 </div>
136 % else:
139 % elif show_todos:
137 140 <div class="pull-right">
138 141 <div class="comments-number" style="padding-left: 10px">
139 142 % if hasattr(c, 'unresolved_comments') and hasattr(c, 'resolved_comments'):
@@ -310,7 +313,7 b" return '%s_%s_%i' % (h.md5_safe(commit+f"
310 313 <td colspan="3"></td>
311 314 <td>
312 315 <div>
313 ${_('Unmatched inline comments below')}
316 ${_('Unmatched/outdated inline comments below')}
314 317 </div>
315 318 </td>
316 319 </tr>
@@ -329,13 +332,13 b" return '%s_%s_%i' % (h.md5_safe(commit+f"
329 332 <td colspan="2"></td>
330 333 <td class="cb-line">
331 334 <div>
332 ${_('Unmatched inline comments below')}
335 ${_('Unmatched/outdated inline comments below')}
333 336 </div>
334 337 </td>
335 338 <td colspan="2"></td>
336 339 <td class="cb-line">
337 340 <div>
338 ${_('Unmatched comments below')}
341 ${_('Unmatched/outdated comments below')}
339 342 </div>
340 343 </td>
341 344 </tr>
@@ -59,19 +59,22 b''
59 59 </div>
60 60
61 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 <div id="edit_pull_request" class="action_button pr-save" style="display: none;">${_('Update title & description')}</div>
64 <div id="delete_pullrequest" class="action_button pr-save ${('' if c.allowed_to_delete else 'disabled' )}" style="display: none;">
63 65 % if c.allowed_to_delete:
64 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)}
65 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'),
67 ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete pull request'),
66 68 class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")}
67 69 ${h.end_form()}
68 70 % else:
69 ${_('Delete')}
71 <span class="tooltip" title="${_('Not allowed to delete this pull request')}">${_('Delete pull request')}</span>
70 72 % endif
71 73 </div>
72 <div id="open_edit_pullrequest" class="pull-right action_button">${_('Edit')}</div>
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>
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>
76 </div>
77
75 78 %endif
76 79 </div>
77 80
@@ -266,7 +269,7 b''
266 269 </tr>
267 270 </table>
268 271 % else:
269 <div class="input">
272 <div>
270 273 ${_('Pull request versions not available')}.
271 274 </div>
272 275 % endif
@@ -350,20 +353,82 b''
350 353 %endif
351 354 </div>
352 355
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>
356 ## TODOs will be listed here
357 <div class="reviewers-title block-right">
358 <div class="pr-details-title">
359 ## Only show unresolved, that is only what matters
360 TODO Comments - ${len(c.unresolved_comments)} / ${(len(c.unresolved_comments) + len(c.resolved_comments))}
361
362 % if not c.at_version:
363 % if c.resolved_comments:
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>
365 % else:
366 <span class="block-right last-item noselect">Show resolved</span>
367 % endif
368 % endif
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 433 </div>
369 434
@@ -561,7 +626,7 b''
561 626 disable_new_comments=True,
562 627 deleted_files_comments=c.deleted_files_comments,
563 628 inline_comments=c.inline_comments,
564 pull_request_menu=pr_menu_data)}
629 pull_request_menu=pr_menu_data, show_todos=False)}
565 630 % endfor
566 631 % else:
567 632 ${cbdiffs.render_diffset(
@@ -570,7 +635,7 b''
570 635 disable_new_comments=not c.allowed_to_comment,
571 636 deleted_files_comments=c.deleted_files_comments,
572 637 inline_comments=c.inline_comments,
573 pull_request_menu=pr_menu_data)}
638 pull_request_menu=pr_menu_data, show_todos=False)}
574 639 % endif
575 640
576 641 </div>
General Comments 0
You need to be logged in to leave comments. Login now