<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:i18n="http://genshi.edgewall.org/i18n" i18n:domain="tracspamfilter">
  <xi:include href="admin.html" />
  <head>
    <title>Spam Reports</title>
    <script type="text/javascript">
      jQuery(document).ready(function($) {
        $("#reportmonitor").addSelectAllCheckboxes();
      });
    </script>
  </head>

  <body>
    <h2>Spam Filtering: Reports</h2>

    <form method="post" action="" id="spamreportform">
      <p class="hint" py:if="total" i18n:msg="start, end, total">
        Viewing entries ${offset} – ${offset + len(entries) - 1} of ${total}.
      </p>

      <ul py:def="prevnext_nav()" py:with="links = chrome.links"
           py:if="'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 Page</a>
          <span py:otherwise="" class="missing">Previous Page</span>
        </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 Page</a>
          <span py:otherwise="" class="missing">Next Page</span> &rarr;
        </li>
      </ul>

      <div class="nav" py:if="entries">
        ${prevnext_nav()}
      </div>

      <table class="listing" id="reportmonitor">
        <thead>
          <tr>
            <th class="sel">&nbsp;</th>
            <th>Path</th>
            <th>Author</th>
            <th>Date/time</th>
          </tr>
        </thead>
        <tbody id="reporttable">
          <py:for each="cls,id,time,path,author,authenticated,comment in entries">
            <tr class="${cls}">
              <td class="sel" rowspan="${2 if comment else 1}">
                <input type="checkbox" name="sel" value="${id}" />
              </td>
              <td class="path"
                  title="${len(path) > 55 and path or None}">
                <a href="${href(path)}">${shorten_line(path, 55)}</a>
              </td>
              <td class="author"
                  py:with="auth_img = authenticated and 'yes.gif' or 'no.gif'"
                  title="${len(author) > 55 and author or None}">
                <a href="${href.admin('spamfilter', 'report', id)}"><img src="${href.chrome('spamfilter', auth_img)}"
                     title="${dgettext('tracspamfilter', 'User was logged in')
                              if authenticated else dgettext('tracspamfilter', 'User was not logged in')}"
                     alt="${auth_img[:-4]}" />&nbsp;${shorten_line(author, 55) or 'anonymous'}</a>
              </td>
              <td class="time">${format_datetime(time)}</td>
            </tr>
            <tr py:if="comment" class="${cls}">
              <td>${comment}</td>
            </tr>
          </py:for>
          <tr py:if="not entries">
            <td colspan="6" style="text-align:center">No data available</td>
          </tr>
        </tbody>
      </table>

      <div class="nav" py:if="entries">
        ${prevnext_nav()}
      </div>
      <div id="boxes" py:if="entries"></div>

      <div class="buttons" py:if="entries">
        <input type="submit" name="delete" value="${dgettext('tracspamfilter', 'Delete selected')}" />
      </div>
    </form>
  </body>

</html>
