##// END OF EJS Templates
added delay before doing an auto merge
added delay before doing an auto merge

File last commit:

r5046:0c2a09c8 default
r5660:cba707aa default
Show More
sidebar.mako
168 lines | 6.8 KiB | application/x-mako | MakoHtmlLexer
commits/pr pages various fixes....
r4485 ## snippet for sidebar elements
## usage:
## <%namespace name="sidebar" file="/base/sidebar.mako"/>
## ${sidebar.comments_table()}
<%namespace name="base" file="/base/base.mako"/>
drafts: sidebar functionality
r4562 <%def name="comments_table(comments, counter_num, todo_comments=False, draft_comments=False, existing_ids=None, is_pr=True)">
commits/pr pages various fixes....
r4485 <%
if todo_comments:
cls_ = 'todos-content-table'
def sorter(entry):
user_id = entry.author.user_id
resolved = '1' if entry.resolved else '0'
if user_id == c.rhodecode_user.user_id:
# own comments first
user_id = 0
return '{}'.format(str(entry.comment_id).zfill(10000))
drafts: sidebar functionality
r4562 elif draft_comments:
cls_ = 'drafts-content-table'
def sorter(entry):
return '{}'.format(str(entry.comment_id).zfill(10000))
commits/pr pages various fixes....
r4485 else:
cls_ = 'comments-content-table'
def sorter(entry):
return '{}'.format(str(entry.comment_id).zfill(10000))
existing_ids = existing_ids or []
%>
<table class="todo-table ${cls_}" data-total-count="${len(comments)}" data-counter="${counter_num}">
% for loop_obj, comment_obj in h.looper(reversed(sorted(comments, key=sorter))):
<%
display = ''
_cls = ''
comments: introduce new draft comments....
r4540 ## Extra precaution to not show drafts in the sidebar for todo/comments
drafts: sidebar functionality
r4562 if comment_obj.draft and not draft_comments:
comments: introduce new draft comments....
r4540 continue
commits/pr pages various fixes....
r4485 %>
comments: introduce new draft comments....
r4540
commits/pr pages various fixes....
r4485 <%
templates: few small UI fixes
r5046 vers = getattr(c, 'versions', [])
comment_ver_index = comment_obj.get_index_version(vers)
commits/pr pages various fixes....
r4485 prev_comment_ver_index = 0
if loop_obj.previous:
templates: few small UI fixes
r5046 prev_comment_ver_index = loop_obj.previous.get_index_version(vers)
commits/pr pages various fixes....
r4485 ver_info = None
templates: few small UI fixes
r5046 if vers:
commits/pr pages various fixes....
r4485 ver_info = c.versions[comment_ver_index-1] if comment_ver_index else None
%>
<% hidden_at_ver = comment_obj.outdated_at_version_js(c.at_version_num) %>
<% is_from_old_ver = comment_obj.older_than_version_js(c.at_version_num) %>
<%
templates: few small UI fixes
r5046 if prev_comment_ver_index > comment_ver_index:
commits/pr pages various fixes....
r4485 comments_ver_divider = comment_ver_index
else:
comments_ver_divider = None
%>
% if todo_comments:
% if comment_obj.resolved:
<% _cls = 'resolved-todo' %>
<% display = 'none' %>
% endif
% else:
## SKIP TODOs we display them in other area
drafts: show TODO drafts properly....
r4746 % if comment_obj.is_todo and not comment_obj.draft:
commits/pr pages various fixes....
r4485 <% display = 'none' %>
% endif
## Skip outdated comments
% if comment_obj.outdated:
<% display = 'none' %>
<% _cls = 'hidden-comment' %>
% endif
% endif
% if not todo_comments and comments_ver_divider:
<tr class="old-comments-marker">
<td colspan="3">
% if ver_info:
<code>v${comments_ver_divider} ${h.age_component(ver_info.created_on, time_is_local=True, tooltip=False)}</code>
% else:
<code>v${comments_ver_divider}</code>
% endif
</td>
</tr>
% endif
<tr class="${_cls}" style="display: ${display};" data-sidebar-comment-id="${comment_obj.comment_id}">
drafts: sidebar functionality
r4562 % if draft_comments:
<td style="width: 15px;">
${h.checkbox('submit_draft', id=None, value=comment_obj.comment_id)}
</td>
% endif
commits/pr pages various fixes....
r4485 <td class="td-todo-number">
<%
version_info = ''
if is_pr:
version_info = (' made in older version (v{})'.format(comment_ver_index) if is_from_old_ver == 'true' else ' made in this version')
%>
sidebar: changed new comment color indicator.
r4502 ## new comments, since refresh
reviewers: added observers as another way to define reviewers....
r4500 % if existing_ids and comment_obj.comment_id not in existing_ids:
sidebar: changed new comment color indicator.
r4502 <div class="tooltip" style="position: absolute; left: 8px; color: #682668" title="New comment">
reviewers: added observers as another way to define reviewers....
r4500 !
</div>
commits/pr pages various fixes....
r4485 % endif
reviewers: added observers as another way to define reviewers....
r4500 <%
json: fixed calls to json after orjson implementation
r4974 data = h.str_json({
reviewers: added observers as another way to define reviewers....
r4500 'comment_id': comment_obj.comment_id,
'version_info': version_info,
'file_name': comment_obj.f_path,
'line_no': comment_obj.line_no,
'outdated': comment_obj.outdated,
'inline': comment_obj.is_inline,
'is_todo': comment_obj.is_todo,
'created_on': h.format_date(comment_obj.created_on),
'datetime': '{}{}'.format(comment_obj.created_on, h.get_timezone(comment_obj.created_on, time_is_local=True)),
'review_status': (comment_obj.review_status or '')
})
drafts: show TODO drafts properly....
r4746 icon = ''
reviewers: added observers as another way to define reviewers....
r4500 if comment_obj.outdated:
drafts: show TODO drafts properly....
r4746 icon += ' icon-comment-toggle'
reviewers: added observers as another way to define reviewers....
r4500 elif comment_obj.is_inline:
drafts: show TODO drafts properly....
r4746 icon += ' icon-code'
reviewers: added observers as another way to define reviewers....
r4500 else:
drafts: show TODO drafts properly....
r4746 icon += ' icon-comment'
if comment_obj.draft:
if comment_obj.is_todo:
icon = 'icon-flag-filled icon-draft'
else:
icon = 'icon-comment icon-draft'
reviewers: added observers as another way to define reviewers....
r4500 %>
<i id="commentHovercard${comment_obj.comment_id}"
class="${icon} tooltip-hovercard"
data-hovercard-url="javascript:sidebarComment(${comment_obj.comment_id})"
data-comment-json-b64='${h.b64(data)}'>
</i>
commits/pr pages various fixes....
r4485 </td>
<td class="td-todo-gravatar">
${base.gravatar(comment_obj.author.email, 16, user=comment_obj.author, tooltip=True, extra_class=['no-margin'])}
</td>
<td class="todo-comment-text-wrapper">
sidebar: fixes to comment links, and new hovercard info about a comment.
r4488 <div class="todo-comment-text ${('todo-resolved' if comment_obj.resolved else '')}">
<a class="${('todo-resolved' if comment_obj.resolved else '')} permalink"
href="#comment-${comment_obj.comment_id}"
onclick="return Rhodecode.comments.scrollToComment($('#comment-${comment_obj.comment_id}'), 0, ${hidden_at_ver})">
${h.chop_at_smart(comment_obj.text, '\n', suffix_if_chopped='...')}
</a>
commits/pr pages various fixes....
r4485 </div>
</td>
</tr>
% endfor
</table>
</%def>