{% extends "base.html" %}
{% block headers %}
<h2>Manage files of {{ name }}</h2>
{% endblock headers %}
{% block content %}
<p>{{ object.html() }} </p>
<form action="" method="POST" enctype="multipart/form-data">
<table>
<tr><th>file</th><th>flags</th><th>description</th><th>action</th></tr>
{% for document in documents %}
<tr><td><input type="hidden" name="id" value="{{ document.pk }}" /><a href='{{ document.file.url }}'>{{ document.filename }}</a></td>
  <td><select name="flag">
      <option {% if not document.hidden %}selected{% endif %} value="public">public</option>
      <option {% if document.hidden %}selected{% endif %} value="hidden">hidden</option>
  </select></td>
  <td><input name="description" size="60" value="{{ document.description }}" /></td>
  <td><select name="action">
      <option selected value="keep">keep</option>
      <option value="delete">delete</option>
      </select></td></tr>
{% endfor %}
<tr><th>add file</th></tr>
<tr>
<td><input type="hidden" name="id" value="" /><input type="file" name="file" /></td>
<td><select name="flag">
      <option selected value="public">public</option>
      <option value="hidden">hidden</option>
  </select></td>
<td><input name="description" size="60" /></td>
<td></td></tr>
<tr><td></td><td><input type="submit" value="proceed" /></td></tr>
</table>

<p>If you mark a file as <i>hidden</i> it will not be listed in the {{ name }} page. However the file can be accessed by anyone which knows its name, by pointing its browser at the correct URL.</p>
<p><a href="{{ object.url() }}">[back to {{ name }}]</a></p>
</form>
{% endblock %}
