trac-ticketlinks / trac / templates / progress_bar.html

Full commit
Display a list of attachments.

 - stats: an instance of trac.ticket.roadmap.TicketGroupStats
 - interval_hrefs: link associated to each interval in stats.intervals
 - percent=None: show that value as percentage, instead of stats.done_percent
 - legend=True: show a legend of label and count for each interval
 - style=None: explicit styling for the table.progress
 - stats_href=None: link associated to the total
<html xmlns=""
      py:with="percent = value_of('percent', None);
               legend = value_of('legend', True);
               style = value_of('style', None);
               stats_href = value_of('stats_href', None)" py:strip="">

  <table class="progress" style="$style">
      <td py:for="idx, interval in enumerate(stats.intervals)"
          style="${interval.percent > 0 and 'width: %d%%' % interval.percent or 'display: none'}">
        <a href="${interval_hrefs and interval_hrefs[idx] or None}"
           title="${_('%(count)s/%(total)s %(title)s',
                      count=interval.count, total=stats.count, title=interval.title)}"></a>

  <p class="percent">${percent is None and '%d%%' % stats.done_percent or percent}</p>

  <dl py:if="legend">
    <dt i18n:msg="unit">Number of ${stats.unit}:</dt><dd />

    <py:for each="idx, interval in enumerate(stats.intervals)">
      <py:with vars="href = interval_hrefs and interval_hrefs[idx] or None">
        <i18n:msg params="title, count">
          <dt><a href="${href}">${interval.title}:</a></dt>
          <dd><a href="${href}">${interval.count}</a></dd>

    <i18n:msg params="count">
      <dt><a href="${stats_href}" i18n:msg="num">Total:</a></dt>
      <dd><a href="${stats_href}">${stats.count}</a></dd>