<!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 Monitoring</title>
  </head>

  <body>
    <div class="nav">
      <ul 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 Log Entry</a>
          <span py:otherwise="" class="missing">Previous Log Entry</span>
        </li>
        <li py:if="'up' in links">
          <a py:with="link = links.up[0]" href="${link.href}"
             title="${link.title}">Back to List</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 Log Entry</a>
          <span py:otherwise="" class="missing">Next Log Entry</span> &rarr;
        </li>
      </ul>
    </div>
    <h2>Spam Filtering: Monitoring</h2>

    <form class="mod" id="spamentry" action="" method="post">
      <fieldset>
        <legend>Log Entry:</legend>
        <h3>Information</h3>
        <table class="meta"><tr>
          <th>Time:</th>
          <td>${pretty_dateinfo(fromtimestamp(entry.time))}</td>
        </tr><tr>
          <th>Path:</th>
          <td><a href="${href(entry.path)}">${abs_href(entry.path)}</a></td>
        </tr><tr>
          <th>Author:</th>
          <td>${entry.author}</td>
        </tr><tr>
          <th>Authenticated:</th>
          <td>${entry.authenticated and dgettext('tracspamfilter', 'yes') or dgettext('tracspamfilter', 'no')}</td>
        </tr><tr>
          <th>IP address:</th>
          <td>${entry.ipnr}</td>
        </tr><tr>
          <?python # trick needed because of a Genshi limitation (see r9456)
            spam_or_ham = dgettext('tracspamfilter', 'spam') if entry.rejected else dgettext('tracspamfilter', 'ham')
          ?>
          <th>Karma:</th>
          <td i18n:msg="karma, spam_or_ham, reasons"
              py:with="">
            <strong>${entry.karma}</strong>
            (marked as ${spam_or_ham})
            <ul py:if="entry.getreasons()">
              <li py:for="reason in entry.getreasons()">$reason</li>
            </ul>
          </td>
        </tr></table>
        <div class="content" py:if="entry.content">
          <h3>Submitted content</h3>
          <pre>${entry.content}</pre>
        </div>
        <div class="headers">
          <h3>HTTP headers</h3>
          <pre>${entry.headers}</pre>
        </div>
        <div class="buttons">
          <input type="hidden" name="sel" value="${entry.id}" />
          <input py:if="train_only" class="spambutton" type="submit" name="markspam"
                 value="${dgettext('tracspamfilter', 'Mark as Spam')}" />
          <input py:if="train_only" class="hambutton" type="submit" name="markham"
                 value="${dgettext('tracspamfilter', 'Mark as Ham')}" />
          <input type="submit" name="delete" value="${dgettext('tracspamfilter', 'Delete')}" />
          <input class="spambutton" type="submit" name="markspamdel"
                 value="${dgettext('tracspamfilter', 'Delete as Spam')}" />
          <input class="hambutton" type="submit" name="markhamdel"
                 value="${dgettext('tracspamfilter', 'Delete as Ham')}" />
          <input type="submit" name="deletenostats"
                 value="${dgettext('tracspamfilter', 'Delete (No Statistics)')}" />
        </div>
      </fieldset>
    </form>
    <div class="buttons">
      <form action="${href.admin('accounts/users')}" method="post" py:if="entry.authenticated and accmgr">
        <div>
          <input type="hidden" name="sel" value="${entry.author}" />
          <input class="dangerbutton" type="submit" name="remove"
                 value="${dgettext('tracspamfilter', 'Remove registered user')}" />
        </div>
      </form>
      <form action="${href.search()}">
        <div>
          <input type="hidden" name="q" value="${entry.author}" />
          <input type="submit" value="${dgettext('tracspamfilter', 'Search for user name')}" />
        </div>
      </form>
    </div>
  </body>

</html>
