<!--!  Copyright (C) 2008-2014 Edgewall Software

  This software is licensed as described in the file COPYING, which
  you should have received as part of this distribution. The terms
  are also available at http://trac.edgewall.com/license.html.

  This software consists of voluntary contributions made by many
  individuals. For the exact contribution history, see the revision
  history and logs, available at http://trac.edgewall.org/.

Snippet for a <th> corresponding to a sortable column.

    Expects the following variables to be set specifically:

    class_    the CSS class for the column
    title     the title attribute for the column

    e.g.  <py:with vars="class_ = 'name'; title = 'Name'">
            <xi:include href="sortable_th.html" />
          </py:with>

    Expects the following variables from the context: order, desc, href, reponame, path, stickyrev
-->
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:py="http://genshi.edgewall.org/"
    xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
  <th class="$class_${(' desc' if desc else ' asc') if order == class_ else None}">
    <a title="${_('Sort by %(col)s %(direction)s', col=class_,
                  direction=_('(descending)') if order == class_ and not desc else _('(ascending)'))}"
      href="${href.browser(reponame, path, rev=stickyrev, order=class_ if class_ != 'name' else None,
                           desc=1 if class_ == order and not desc else None)}">$title</a>
  </th>
</html>
