bloodhound-trac / 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
 - 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
<div xmlns=""
     id="ticket" class="trac-content ${'ticketdraft' if preview_mode else None}"
     style="${'display: none' if value_of('hide', False) else None}">

  <div class="date">
    <p i18n:msg="created" py:if="ticket.exists">Opened ${pretty_dateinfo(ticket.time)}</p>
    <p i18n:msg="closed" py:if="closetime">Closed ${pretty_dateinfo(closetime)}</p>
    <p i18n:msg="modified" py:if="ticket.changetime != ticket.time and ticket.changetime != closetime">
      Last modified ${pretty_dateinfo(ticket.changetime)}</p>
    <p py:if="not ticket.exists"><span class="trac-loading"/><i>(ticket not yet created)</i></p>
  <!--! use a placeholder if it's a new ticket -->

    <a href="${href.ticket(}" class="trac-id">#${}</a>
    <span class="trac-status">
      ${'status' in fields_map and fields[fields_map['status']].rendered or ticket.status}
    <span class="trac-type" py:if="ticket.type">
      ${'type' in fields_map and fields[fields_map['type']].rendered or ticket.type}
    <span class="trac-resolution" py:if="ticket.resolution">
      (${'resolution' in fields_map and fields[fields_map['resolution']].rendered or ticket.resolution})

  <h1 id="trac-ticket-title" class="searchable">
    <span class="summary">$ticket.summary</span>
    <py:choose test="">
      <py:when test="version is None" />
      <py:when test="version == 0">
        &mdash; <i18n:msg>at <a href="#comment:description">Initial Version</a></i18n:msg>
        &mdash; <i18n:msg params="version">at <a href="#comment:$version">Version $version</a></i18n:msg>

  <table class="properties"
         py:with="fields = [f for f in fields if not f.skip and not in ('type', 'owner')]">
    <tr py:with="
      v_reporter = reporter_link if defined('reporter_link') else authorinfo(ticket.reporter);
      v_owner = (owner_link if defined('owner_link') else authorinfo(ticket.owner)) if ticket.owner else ''
      <th id="h_reporter" class="${classes(missing=not v_reporter)}">Reported by:</th>
      <td headers="h_reporter" class="searchable">$v_reporter</td>
      <th id="h_owner" class="${classes(missing=not v_owner)}">Owned by:</th>
      <td headers="h_owner">$v_owner</td>
    <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="${'h_' + if field else None}"
            class="${classes(missing=not field or
                              ('rendered' in field and not field.rendered) or
                               not ticket[])}" >
          <py:if test="field"><i18n:msg params="field">${field.label or}:</i18n:msg></py:if>
        <td py:if="idx == 0 or not fullrow"
            headers="${'h_' + if field else None}"
            class="${'searchable' if field and in ('cc', 'keywords') else None}"
            colspan="${3 if fullrow else 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">
      <a href="${href.ticket(, action='diff', version=description_change.cnum)}"
         py:if="description_change" class="lastmod trac-diff" title="$">
        <i18n:msg params="author">(last modified by ${authorinfo(})</i18n:msg>

    <!--! 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="${captioned_button('↳', _('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" />