{% extends "./list_editor.html" %}
{% load i18n %}

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

{% block inner %}
<template #title><h3 class="title">{% translate "Track list" %}</h3></template>
{{ block.super }}
{% endblock %}

{% block row-control %}
{% if name == "tags" %}
<input type="text" class="input"
    :name="inputName"
    v-model="item.data[attr]"
    @change="emit('change', cell.col)"
>
{% else %}
<a-autocomplete
        :input-class="['input', item.error(attr) ? 'is-danger' : 'half-field']"
        url="{% url 'api:track-autocomplete' %}?{{ name }}=${query}&field={{ name }}"
        :name="inputName"
        v-model="item.data[attr]"
        @change="emit('change', cell.col)"/>
{% endif %}
{% endblock %}
