{# 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/. #} ## Ticket Box (ticket fields along with description). # import 'macros.html' as jmacros with context {# Arguments: - ticket: the ticket to be shown - fields: ticket field metadata - description_change: metadata about changes in the description - can_append: True if the user is allowed to append to tickets - preview_mode: if True, show the "draft" background - hide=False: if True, hide the box - reporter_link=None: rendered link for the reporter field - owner_link=None: rendered link for the owner field #}
# if not ticket.exists and preview_mode: ${jmacros.warnings(chrome.warnings, 'trac-preview-warning')} # endif
# if ticket.exists:

${tag_("Opened %(created)s", created=pretty_dateinfo(ticket.time))}

# endif # if closetime:

${tag_("Closed %(closed)s", closed=pretty_dateinfo(closetime))}

# endif # if ticket.changetime != ticket.time and ticket.changetime != closetime:

${ tag_("Last modified %(modified)s", modified=pretty_dateinfo(ticket.changetime)) }

# endif # if not ticket.exists:

${ _("(ticket not yet created)")}

# endif
## use a placeholder if it's a new ticket

#${ticket.id} ${'status' in fields and fields.by_name('status').rendered or ticket.status} # if ticket.type: ${'type' in fields and fields.by_name('type').rendered or ticket.type} # endif # if ticket.resolution: (${'resolution' in fields and fields.by_name('resolution').rendered or ticket.resolution}) # endif

${ticket.summary} # if version is not none: # set version_link # if version == 0: ${_("Initial Version")} # else: ${ _("Version %(version)s", version=version)} # endif # endset # trans version_link — at ${version_link} # endtrans # endif

## fields = [f for f in fields if not f.skip and f.name not in ('type', 'owner')] # with # set fields = fields|rejectattr('skip') # set fields = fields|selectattr('name', 'not_in', ('type', 'owner')) # set v_reporter = (reporter_link if reporter_link else authorinfo(ticket.reporter)) # set v_owner = ((owner_link if owner_link else authorinfo(ticket.owner)) if ticket.owner) # for row in fields|groupattr(2, 'type', 'not_equalto', 'textarea'): # set fullrow = len(row) == 1 # for field in row: # if loop.first or not fullrow: # if field: ${_("%(label)s:", label=field.label or field.name)} # endif # endif # if loop.first or not fullrow: # if field: # set value = ticket[field.name] # if 'rendered' in field: ${field.rendered} # elif not value: # elif field.type == 'time': ${pretty_dateinfo(value, field.format, dateonly=field.format != 'relative')} # elif field.type == 'text' and field.format == 'wiki': ${wiki_to_oneliner(context, value)} # elif field.type == 'textarea' and field.format == 'wiki': ${wiki_to_html(context, value, escape_newlines=preserve_newlines)} # elif field.type == 'textarea': # for line in value.splitlines(): # if loop.index > 1:
# endif ${line} # endfor # else: ${value} # endif # endif # endif # endfor
# endfor # endwith
${ _("Reported by:")} ${v_reporter} ${ _("Owned by:")} ${v_owner}

${_("Description")} # if description_change: # trans author = authorinfo(description_change.author) (last modified by ${author}) # endtrans # endif

## Quote the description (only for existing tickets) # if ticket.exists and can_append:
# endif # if ticket.description:
${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}
# else:
# endif
# if chrome_info_script: ${chrome_info_script(req)} # endif