<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"
     py:strip="">

  <!--!

     WARNING: this file and the corresponding <py:def>s are going to be phased
              out soon. Please DON'T include macros.html in your own templates.

              See http://trac.edgewall.org/ticket/6374
  -->

  <!--!  Display size of a content in human friendly format (think -H)
  -
  -      We take care to not insert any extra space.
  -->
  <py:def function="sizeinfo(size)"><span title="${_('%(size)s bytes', size=size)}">${
      pretty_size(size)
  }</span></py:def>

  <!--! Add Previous/Up/Next navigation links
  -
  -     `label` the label to use after the Previous/Next words
  -     `uplabel` the label to use for the Up link
  -
  -     Assume the 'chrome' datastructure to be available from the context.
  -->
  <ul py:def="prevnext_nav(label, uplabel=None)" py:with="links = chrome.links"
      py:if="'up' in chrome.links or
             'prev' in chrome.links or
             'next' in chrome.links">
    <li class="first" py:choose="">
      &larr; <a py:when="'prev' in links" py:with="link = links.prev[0]"
                class="prev" href="${link.href}"
                title="${link.title}">Previous $label</a>
      <span py:otherwise="" class="missing">Previous $label</span>
    </li>
    <li py:if="uplabel and 'up' in links">
      <a py:with="link = links.up[0]" href="${link.href}"
         title="${link.title}">$uplabel</a>
    </li>
    <li class="last" py:choose="">
      <a py:when="'next' in links"  py:with="link = links.next[0]"
         class="next" href="${link.href}"
         title="${link.title}">Next $label</a>
      <span py:otherwise="" class="missing">Next $label</span> &rarr;
    </li>
  </ul>


  <!--! Display a div for visualizing a preview of a file content
  -
  -     'preview' is usually obtained from calling Mimeview.preview_data()
  -
  -->
  <py:def function="preview_file(preview)">
    <xi:include href="preview_file.html"/>
  </py:def>

  <!--! Display a list of attachments
  -
  -     'alist' is an AttachmentList object (see attachment.py)
  -     'compact' is used to switch between a compact list of attachments (e.g. as used for
  -       the wiki view) and an expanded list (e.g. as used for the ticket view)
  -->
  <py:def function="list_of_attachments(alist, compact=False, add_button_title=None, foldable=False)">
    <xi:include href="list_of_attachments.html"/>
  </py:def>

  <!--! Conditionally render an ''Attach File'' button
  -
  -     'alist' is an AttachmentList object (see attachment.py)
  -->
  <py:def function="attach_file_form(alist, add_button_title=None)">
    <xi:include href="attach_file_form.html"/>
  </py:def>

  <!--!  Display a generic "progress bar", for use in roadmap and milestone.
  -
  -      `stats` argument is a TicketGroupStats instance
  -       `interval_hrefs` are links to a query for each of the stats.intervals
  -->
  <py:def function="progress_bar(stats, interval_hrefs, percent=None, legend=True, style=None, stats_href=None)">
    <xi:include href="progress_bar.html"/>
  </py:def>

</div>
