## usage: ## <%namespace name="comment" file="/changeset/changeset_file_comment.mako"/> ## ${comment.comment_block(comment)} ## <%namespace name="base" file="/base/base.mako"/> <%! from rhodecode.lib import html_filters %> <%def name="comment_block(comment, inline=False, active_pattern_entries=None, is_new=False)"> <% from rhodecode.model.comment import CommentsModel comment_model = CommentsModel() comment_ver = comment.get_index_version(getattr(c, 'versions', [])) latest_ver = len(getattr(c, 'versions', [])) visible_for_user = True if comment.draft: visible_for_user = comment.user_id == c.rhodecode_user.user_id %> % if inline: <% outdated_at_ver = comment.outdated_at_version(c.at_version_num) %> % else: <% outdated_at_ver = comment.older_than_version(c.at_version_num) %> % endif % if visible_for_user:
${'v{}'.format(comment_ver)}
|
% elif comment_ver:${'v{}'.format(comment_ver)}
|
% endif % else: % if comment_ver: % if comment.outdated: ${_('Outdated comment from pull request version v{0}, latest v{1}').format(comment_ver, latest_ver)}|
% else:${'v{}'.format(comment_ver)}
|
% endif % endif % endif|
% if outdated_at_ver: % else: % endif