{% extends "./list_editor.html" %}
{% comment %}
Context:
- object: episode
{% endcomment %}

{% block outer %}
    {% with tag_id="inline-sounds" %}
    {% with tag="a-sound-list-editor" %}
    {% with related_field="episode" %}
        {{ block.super }}
    {% endwith %}
    {% endwith %}
    {% endwith %}
{% endblock %}


{% block tag-attrs %}
{{ block.super }}
sound-list-url="{% url "api:sound-list" %}?program={{ object.parent_id }}"
sound-upload-url="{% url "api:sound-list" %}"
sound-delete-url="{% url "api:sound-detail" pk=123 %}"
{% endblock %}

{% block inner %}
{{ block.super }}

<template #upload-form>
    {% for field in sound_form %}
    {% with field.name as name %}
    {% if name in "episode" %}
        {% include "./form_field.html" with value=field.initial field=field.field hidden=True %}
    {% elif name != "file" %}
    <div class="field is-horizontal">
        <label class="label mr-3">{{ field.label }}</label>
        {% include "./form_field.html" with value=field.initial field=field.field %}
    </div>
    {% endif %}
    {% endwith %}
    {% endfor %}
</template>
<template #row-delete="{cell}">
    <input type="checkbox" :name="'{{ formset.prefix }}-' + cell.row + '-DELETE'">
</template>

{% endblock %}
