{% extends "base.html" %}
{% load l10n %}
{% load i18n %}
{% load dateconv %}
{% load lastpart %}
{% block content %}

<div class="container">
{% include "messages.html" %}

        <ul class="breadcrumb">
            <li><a href="{% url "containerview" %}">Containers</a></li> 
            <li><span class="divider">/</span>
                <a class="u" href="{% url "objectview" container=container %}">{{container}}</a></li>

            {% for prefix in prefixes %}
                <li>
                    <span class="divider">/</span>
                    <a href="{% url "objectview" container=container prefix=prefix.full_name %}">{{prefix.display_name}}</a>
                </li>
            {% endfor %}
       </ul> 


<form action="{{ swift_url }}" method="POST" class="form-horizontal" enctype="multipart/form-data">

    <input type="hidden" name="redirect" value="{{ redirect_url }}" />
    <input type="hidden" name="max_file_size" value="{{ max_file_size }}" />
    <input type="hidden" name="max_file_count" value="{{ max_file_count }}" />
    <input type="hidden" name="expires" value="{{ expires }}" />
    <input type="hidden" name="signature" value="{{ signature }}" />
    <input type="file" name="file1" id="file" style="display:none;" /><br />


    <fieldset>
    <legend>{% trans 'Upload a file' %}</legend>
  
    <div class="control-group">
        <label class="control-label" for="foldername">{% trans "File" %}</label>
        <div class="controls">
            <div class="input-append">
            <input id="filetmp" name="filetmp" class="input-xlarge" type="text" placeholder="Select a file">
            <a class="btn" onclick="$('input[id=file]').click();">{% trans 'Browse' %}</a>
            </div>
 
            <span class="help-block">
                {% trans "Please select a file to upload" %}
            </span>
        </div>
    </div>




    <div class="control-group">
        <div class="controls">
            <button type="submit" class="btn btn-primary">{% trans 'Start upload' %}</button>
            {% if prefix %}
        <a href="{% url "objectview" container=container prefix=prefix %}" class="btn" >
    {% else %}
        <a href="{% url "objectview" container=container %}" class="btn" >
    {% endif %}
    {% trans 'Cancel' %}</a>
         </div>
    </div>
  </fieldset>
</form>
</div>






    {% block jsadd %} <script type="text/javascript"> $('input[id=file]').change(function() { $('#filetmp').val($(this).val()); }); </script> {% endblock %}



{% endblock %}
