<!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:py="http://genshi.edgewall.org/"
  xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="layout.html" />
<head>
<title>$title</title>
</head>

<body>
<div id="content" class="report">

<h1>$title</h1>

<py:if test="len(error_rows) > 0">
  <h3>除外されたデータ</h3>
  <p>下記のデータは登録されません。</p>
  <table class="listing tickets">
    <thead>
      <tr>
        <th py:for="header in headers">${header.lower()}</th>
        <th>エラー内容</th>
      </tr>
    </thead>
    <tbody>
      <tr py:for="row in error_rows" class="">
        <py:for each="header in headers">
          <td class="">${row[header]}</td>
        </py:for>
          <td class="">${row['err_message']}</td>
      </tr>
    </tbody>
  </table>
  <hr/>
</py:if>

<py:if test="headers and rows">
  <h3>登録可能なデータ</h3>
  <p>下記のデータが登録可能です。</p>
  <form action="importer" method="post">
  <input type="hidden" name="action" value="import" />
  <div class="buttons"><input type="submit" name="cancel"
    value="キャンセル" /> <input type="submit" value="インポート実行" /></div>
  </form>

  <table class="listing tickets">
    <thead>
      <tr>
        <th py:for="header in headers">${header.lower()}</th>
      </tr>
    </thead>

    <tbody>
      <!-- TODO: fix odd/even rows, they don't seem to be working
              <tr py:for="row in rows"
                class="${row.__idx__ % 2 and 'odd' or 'even'}"
                style="TODO">
-->
      <tr py:for="row in rows" class="">
        <py:for each="header in headers">
          <td class="">${row[header]}</td>
        </py:for>
      </tr>
    </tbody>
  </table>
</py:if>

</div>
</body>
</html>
