trac-ticketlinks / trac / ticket / templates / ticket_box.html

Ticket Box (ticket fields along with description).

 - 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
 - reporter_link=None: rendered link for the reporter field
 - owner_link=None: rendered link for the owner field
<div xmlns=""
     id="ticket" class="${preview_mode and 'ticketdraft' or None}">
  <div class="date">
    <p i18n:msg="created" py:if="ticket.exists">Opened ${dateinfo(ticket.time)} ago</p>
    <p i18n:msg="modified" py:if="ticket.changetime != ticket.time">Last modified ${dateinfo(ticket.changetime)} ago</p>
    <p py:if="not ticket.exists"><i>(ticket not yet created)</i></p>
  <!--! use a placeholder if it's a new ticket -->
  <h2 class="summary searchable">$ticket.summary</h2>

  <table class="properties"
         py:with="fields = [f for f in fields if not f.skip and not in ('type', 'owner')]">
      <th id="h_reporter">Reported by:</th>
      <td headers="h_reporter" class="searchable">
        ${defined('reporter_link') and reporter_link or authorinfo(ticket.reporter)}
      <th id="h_owner">Owned by:</th>
      <td headers="h_owner">
        ${ticket.owner and (defined('owner_link') and owner_link or authorinfo(ticket.owner)) or ''}
    <tr py:for="row in group(fields, 2, lambda f: f.type != 'textarea')"
      py:with="fullrow = len(row) == 1">
      <py:for each="idx, field in enumerate(row)">
        <th py:if="idx == 0 or not fullrow"
            id="${field and 'h_' + or None}">
          <py:if test="field"><i18n:msg params="field">${field.label or}:</i18n:msg></py:if>
        <td py:if="idx == 0 or not fullrow"
            headers="${field and 'h_' + or None}"
            class="${field and in ('cc', 'keywords') and 'searchable' or None}"
            colspan="${fullrow and 3 or None}">
          <py:if test="field">
            <py:choose test="">
              <py:when test="'rendered' in field">${field.rendered}</py:when>
  <div class="description">
    <h3 id="comment:description">
      <span py:if="description_change" class="lastmod" title="$">
        <i18n:msg params="author">(last modified by ${authorinfo(})</i18n:msg>
        (<a href="${href.ticket(, action='diff', version=description_change.cnum)}">diff</a>)

    <!--! Quote the description (only for existing tickets) -->
    <form py:if="ticket.exists and ticket.description and can_append"
          id="addreply" method="get" action="#comment">
      <div class="inlinebuttons">
        <input type="hidden" name="replyto" value="description" />
        <input type="submit" name="reply" value="${_('Reply')}" title="Reply, quoting this description" />
    <div py:if="ticket.description" class="searchable" xml:space="preserve">
      ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}
    <br py:if="not ticket.description" style="clear: both" />
  <div class="linked">
    <h3>Linked Issues (${len(linked_tickets)})</h3>
    <table class="listing tickets">
        <tr style="white-space: nowrap;">
          <th style="width:100%;">Summary</th>
          <th>Last modified</th>
        <tr py:for="link, tkt_id, ticket in linked_tickets">
          <td class="ticket_link">${link}</td>
          <td class="ticket">${tkt_id}</td>
          <td class="component">${ticket.component}</td>
          <td class="version">${ticket.status}</td>
          <td class="summary">${shorten_line(ticket.summary)}</td>
          <td class="date">${dateinfo(ticket.changetime)}</td>
        <tr py:for="link, tkt_id in linked_rejects">
          <td class="ticket_link">${link}</td>
          <td class="ticket">${tkt_id}</td>
          <td class="reject" colspan="4">Ticket details unavailable</td>
  <div py:if="'TICKET_CREATE' in perm(ticket.resource)">
    <form id="newlinked" method="get" action="${context.href.newticket()}">
      <input type="hidden" id="linked-val" name="linked_val" value="${}" />
      <label for="linked-end">New</label>
      <select id="linked-end" name="linked_end">
        <option py:for="link_label, link_end in newlinked_options"
                value="${link_end}">${link_label} ticket</option>
      <input type="submit" name="create" value="Create" title="Create new linked ticket" />