Source

bloodhound_theme / bhtheme / templates / bh_ticket_box.html

<!--!
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<!--!
Ticket Box (ticket fields along with description).

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
 - reporter_link=None: rendered link for the reporter field
 - owner_link=None: rendered link for the owner field
 - colcount=6: the number of fields to display in a row
-->
<div xmlns="http://www.w3.org/1999/xhtml"
     xmlns:py="http://genshi.edgewall.org/"
     xmlns:xi="http://www.w3.org/2001/XInclude"
     xmlns:i18n="http://genshi.edgewall.org/i18n"
     id="ticket" class="${'ticketdraft' if preview_mode else None}">

  <div class="properties" style="margin-top: 1.2em"
         py:with="fields = [f for f in fields if not f.skip and f.name not in ('type', 'owner', 'keywords')];
            small_fields = [f for f in fields if f.type not in ('text', 'textarea') and f.name != 'cc'];
            text_fields = [f for f in fields if f.type == 'text' or f.name == 'cc'];
            area_fields = [f for f in fields if f.type == 'textarea'];
            _colcount = colcount or 6">
    <py:for each="_fields, csscls, count, fontsize in 
        [(small_fields, 'span2', _colcount, '150%'),
         (text_fields, 'span4', colcount / 2, None),
         (area_fields, 'span', 1, None)]">
      <div class="row" py:for="fields_row in group(_fields, count)">
        <div py:for="idx, field in enumerate(fields_row)" py:if="field is not None"
            class="$csscls">
          <p id="${'h_' + field.name if field else None}">
            <py:if test="field"><i18n:msg params="field">${field.label or field.name}:</i18n:msg></py:if>
          </p>
          <p style="font-size: ${fontsize if field and field.name != 'cc' else '120%'}">
            <py:if test="field">
              <py:choose test="">
                <py:when test="'rendered' in field">${field.rendered}</py:when>
                <py:otherwise>${ticket[field.name]}</py:otherwise>
              </py:choose>
            </py:if>
            &nbsp;
          </p>
        </div>
      </div>
    </py:for>
  </div>
  <div class="${'well' if not preview_mode else None}">
    <!--! use a placeholder if it's a new ticket -->
    <h3 class="summary searchable">$ticket.summary</h3>
    <py:for each="field in fields">
      <py:if test="field.name == 'keywords'">
        <div title="Keywords">
          <i class="icon-tags"></i> ${field.rendered}
        </div>
      </py:if>
    </py:for>

    <div class="description">
      <h5 id="comment:description">
        Description
        <span py:if="description_change" class="lastmod pull-right"
            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>)
        </span>
      </h5>
  
      <!--! Quote the description (only for existing tickets) -->
      <div class="pull-right">
        <form py:if="ticket.exists and ticket.description and can_append"
            id="addreply" method="get" action="#comment">
          <input type="hidden" name="replyto" value="description" />
          <input type="submit" name="reply" value="${_('Reply')}"
              class="btn btn-mini"
              title="Reply, quoting this description" />
        </form>
      </div>
      <div py:if="ticket.description" class="searchable" xml:space="preserve">
        ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}
      </div>
      <br py:if="not ticket.description" style="clear: both" />
    </div>
  </div>
</div>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.