{% extends "admin/base.html" %}

{% block main %}
{% include "admin/snippets/path.html" %}

<h2>Choose document ({{ total }} total)</h2>
<a href="{% url couchdb:document_add app=app.name doc_type=doc_type %}">New</a>
<table border=1>
    <thead>
      <tr>
          <th>Key</th>
          <th>Value</th>
          <th></th>
          <th></th>
      </tr>
    </thead>
    <tbody>
        {% for row in rows %}
        <tr>
            <td><a href="{% url couchdb:document app=app.name doc_type=doc_type doc_id=row.id %}">{{ row.key }}</td>
            <td>{{ row.value }}</td>
            <td><a href="{% url couchdb:document app=app.name doc_type=doc_type doc_id=row.id %}">Edit</a></td>
            <td><a href="{% url couchdb:document_delete app=app.name doc_type=doc_type doc_id=row.id %}">Delete</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>

<a href="{% url couchdb:document_add app=app.name doc_type=doc_type %}">New</a>
{% endblock %}
