1. Alex Willmer
  2. trac-ticketlinks


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="http://www.w3.org/1999/xhtml"
     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 f.name 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_' + field.name or None}">
          <py:if test="field"><i18n:msg params="field">${field.label or field.name}:</i18n:msg></py:if>
        <td py:if="idx == 0 or not fullrow"
            headers="${field and 'h_' + field.name or None}"
            class="${field and field.name 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="$description_change.date">
        <i18n:msg params="author">(last modified by ${authorinfo(description_change.author)})</i18n:msg>
        (<a href="${href.ticket(ticket.id, 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 Tickets (<span id="linked-ticket-count">${len(linked_tickets)}</span>)</h3>
    <table id="linked-tickets" class="listing tickets">
        <tr style="white-space: nowrap;">
          <th style="width:100%;">Summary</th>
          <th>Last modified</th>
      <tbody py:if="linked_tickets or linked_rejects">
        <xi:include href="ticket_entries.html"
                    py:with="tickets = linked_tickets;
                             rejects = linked_rejects" />
  <div py:if="'TICKET_CREATE' in perm(ticket.resource)" class="linked">
    <form id="newlinked" method="get" action="${context.href.newticket()}"><div>
      <input type="hidden" id="newlinked-linked-val" class="linked-val" name="linked_val" value="${ticket.id}" />
      <label for="newlinked-linked-end">New</label>
      <select id="newlinked-linked-end" class="linked-end" name="linked_end">
        <option py:for="link_label, link_end in newticket_link_options"
                value="${link_end}">${link_label} ticket</option>
      <input type="submit" name="create" value="Create" title="Create new linked ticket" />