{% extends 'layout/page.html' %}

{% block head_title %}
  {{ i18n.gettext('File display') }}
{% endblock %}

{% block page_header %}
  {{ i18n.gettext('File display') }}
{% endblock %}

{% block content %}

  {% include 'layout/permission.html' %}

  {% if context.is_view_ok() %}
    <form method="POST"
      enctype="multipart/form-data" action='{{ context.designator() }}'>

      <dl class='dl-horizontal'>
        <dt>{{ i18n.gettext('Name') }}</dt>
        <dd>{{ context.name.field() }}</dd>
        <dt>{{ i18n.gettext('Content Type') }}</dt>
        <dd>{{ context.type.field() }}</dd>
      </dl>

      <input type="hidden" name="@template" value="item">
      <input type="hidden" name="@required" value="name,type">
      {% if request.form.has_key('@multilink') %}
        <input type="hidden" name="@multilink"
          value='request.form.@multilink.value()'>
      {% endif %}
      <div class='form-actions'>
        {{ context.submit() }}
      </div>
    </form>
  {% endif %}

  {% if context.id and context.is_view_ok() %}
    <div class='row-fluid'>
      <a href='file{{ context.id }}/{{ context.name }}'>{{ i18n.gettext('Download') }}</a>
    </div>
  {% endif %}

  <div class='vspace-five'></div>
  {{ context.history() }}

{% endblock %}
