{% extends 'core_main_app/_render/admin/theme/tools/box.html' %}

{% block box_title %}Edit {% endblock %}

{% block box_tools %}

{% url 'admin:core_composer_app_types' as type_list_url %}
{% include 'core_main_app/common/buttons/go_to.html' with url=type_list_url label='Back to Types' %}

{% endblock %}

{% block box_body %}
<div class="row">
    <div class="col-md-12">
        {% for bucket in data.buckets %}
            {% if data.version_manager in bucket.types %}
                <span class="bucket" style="background:{{ bucket.color}};" bucketid="{{bucket.id}}">
                    {{ bucket.label }}
                </span>
            {% endif %}
        {% endfor %}
        <form id="form_edit" method="post"
              action="{% url 'admin:core_composer_app_type_buckets' data.version_manager.id %}">
            {% csrf_token %}

            {{ data.form }}

            <div id="upload_errors" style="color:red;">
                {{ data.errors | safe}}
            </div>

            <br/>
            <input type="submit" class="btn btn-default" value="Save"/>
        </form>
    </div>
</div>
{% endblock %}