{% extends "templates/base.html" %}
{% block content %}
        <div id="content" class="auth">
        {% if uploaded|not-empty %}
          {% for upload in uploaded %}
            {% if upload.is-image %}
              <p>
                <img id="uploaded-image" alt="Uploaded image" src="{{upload.resource}}"/>

                <!-- TODO: i18n needed -->
                This is the {{upload.size|name}} file. {% i18n file-upload-link-text %}:

                <code>![{{upload.filename}}]({{upload.resource}})</code>
              </p>
            {% else %}
              <p>
                {% i18n file-upload-link-text %}:

                <code>[{{upload.filename}}]({{upload.resource}})</code>
              </p>
            {% endif %}
          <br clear="right"/>
          <hr/>
          {% endfor %}
        {% else %}
            <form action="{{servlet-context}}/upload" enctype="multipart/form-data" method="POST">
                {% csrf-field %}
                <p class="widget">
                    <label for="upload">{% i18n file-upload-prompt %}</label>
                    <input name="upload" id="upload" type="file" required/>
                </p>
                <p class="widget">
                    <label for="summary">{% i18n file-summary-prompt %}</label>
                    <input name="summary" id="summary" type="text" required/>
                </p>
                <p class="widget">
                    <label for="submit">{% i18n save-prompt %}</label>
                    <input name="submit" id="submit" type="submit" class="action" value="{% i18n save-label %}"/>
                </p>
            </form>
        {% endif %}
          <p>
            Your <a href="list-uploads">uploaded files are listed here</a>.
          </p>
        </div>
{% endblock %}
