{% extends "template.html" %}
<?xml version="1.0" encoding="UTF-8"?>
<!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">

{% macro buttons (rows, show) %}
{% set offset = int(REQ.get('offset', 0)) %}
<div style="text-align: center">
  {% if offset>0 %}
  <a href="index.html?offset={{ prev_page }}&amp;{{ query }}"
     class="submit">&lt;</a>
  {% else %}
  <a href="#" class="submit hidden">&lt;</a>
  {% endif %}
  <input name="view" class="submit" type="submit"
         value="{{ _('View') }}"/>
  <input name="recheck" class="submit" type="submit"
         value="{{ _('Recheck') }}"/>
  {% if rows==show %}
  <a href="index.html?offset={{ next_page }}&amp;{{ query }}"
     class="submit">&gt;</a>
  {% else %}
  <a href="#" class="submit hidden">&gt;</a>
  {% endif %}
</div>
{% endmacro %}

{% block body %}
{% set index = get_index() %}
<form action="action.html">
<div class="table_buttons">{{ buttons(index.rows, SHOW_ROWS) }}</div>
<table>
<tr>
  <th></th>
  <th>{{ _('Date and time') }}</th>
  <th>{{ _('Virus name (level)') }}</th>
  <th>{{ _('Sender') }}</th><th>{{ _('Size(B)') }}</th>
  <th>{{ _('Action') }}</th>
  {% if 'A' in PERMS %}
  <th>{{ _('Recipients') }}</th>
  {% endif %}
</tr>
{% for row in index.data %}
<tr>
  {% if row[0] %}
  <td><input name="qname" value="{{ row[0]|e }}" type="checkbox"/></td>
  {% else %}
  <td>&nbsp;</td>
  {% endif %}
  <td>{{ row[1]|e }}</td>
  <td>{{ row[2]|e }} ({{ row[3]|e }})</td>
  <td>{{ row[4]|e }}</td>
  <td>{{ row[5]|e }}</td>
  <td>{{ row[6]|e }}</td>
  {% if 'A' in PERMS %}
  <td>{{ row[7]|e }}</td>
  {% endif %}
</tr>
{% endfor %}
</table>
<div class="table_buttons">{{ buttons(index.rows, SHOW_ROWS) }}</div>
</form>
{% endblock %}

</html>
