{% extends 'core_main_app/admin/templates/list/available.html' %}


{% 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' %}

<a href="{% url 'admin:core_composer_app_upload_bucket' %}" class="pull-right btn btn-default">
    <i class="fa fa-plus"></i> Add {{ data.object_name }}
</a>
{% endblock %}

{% block box_body %}
<table class="table table-bordered table-striped table-hover">
    <tr>
        <th>{{ data.object_name }}</th>
        <th>Actions</th>
    </tr>

    {% for bucket in data.buckets %}
        <tr>
            <td>
                <span class="bucket" style="background:{{ bucket.color}};" bucketid="{{bucket.id}}">
                    {{ bucket.label }}
                </span>
            </td>
            <td>
                {% url 'admin:core_composer_app_edit_bucket' bucket.id as edit_url %}
                {% include 'core_main_app/common/buttons/edit.html' %}
               <span class='icon legend delete'>
                   <a class="btn btn-danger delete" bucketid='{{ bucket.id }}' href="#">
                       <i class="fa fa-trash"></i> Delete</a>
               </span>
            </td>
        </tr>
    {% empty %}
        <tr>
            <td class="empty" colspan="2">
                No {{ data.object_name }} created yet.
            </td>
        </tr>
    {% endfor %}
</table>

{% endblock %}
