{# Copyright (C) 2010-2023 Edgewall Software This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at https://trac.edgewall.org/wiki/TracLicense. This software consists of voluntary contributions made by many individuals. For the exact contribution history, see the revision history and logs, available at https://trac.edgewall.org/. #} ## Renders a ticket comment. {# Arguments: - change: the change data - hide_buttons=False: hide all buttons (Edit, Reply) - cnum_edit=None: the comment number being edited - edited_comment: the current value of the comment editor - cnum_hist=None: the comment number for which to show a historical content - can_append=False: True if the user is allowed to append to tickets - preview=False: True if rendering a change preview #} # import 'macros.html' as jmacros with context # with # set cnum = to_unicode(change.get('cnum')) # set hide_buttons = hide_buttons|default(false) # set cnum_edit = cnum_edit|default('') # set cnum_hist = cnum_hist|default('') # set can_append = can_append|default(false) # set comment_resource = Resource('comment', cnum, parent=ticket.resource) # set can_edit_comment = 'TICKET_EDIT_COMMENT' in perm(comment_resource) # set preview = preview|default(false) # set show_editor = can_edit_comment and cnum == cnum_edit # set show_history = cnum is equalto(cnum_hist) # set max_version = change.comment_history|max(0) # set comment_version = (as_int(cversion, max_version, 0, max_version) if show_history else max_version) # set show_buttons = (not hide_buttons and not show_editor and comment_version == max_version) # macro commentref(prefix, cnum, cls=none) ${prefix}${cnum} # endmacro ## jinjacheck: "(a h3 div form div div div div )" OK
${ _("%(label)s:", label=field.label)} | # if field_name == 'attachment': # set attachment_link ${ field.new} # endset # trans attachment_link ${attachment_link} added # endtrans # else: ${field.rendered} # endif # if preview and field.by == 'user': # set old = (ticket.get_default(field_name) if field.old is sameas(empty) else field.old) () # endif |
---|