<input type="hidden" name="{{ name }}" value="{{ value }}">

<div
	class="elementselect js-element-select"
	id="{{ name }}"
	data-name="{{ name }}"
	data-max="{{ settings.max }}"
	data-projects="{{ settings.projects|join(',') }}"
>
	<div class="elements">
		{% for video in videos %}
			<div
				class="element small hasstatus removable"
				data-id="{{ video.id }}"
			>
				<input
					name="{{ name }}[]"
					type="hidden"
					value="{{ video.id }}"
				>
				<a class="delete icon"></a>
				<span class="status live"></span>
				<div class="label">
					<span class="title">{{ video.title }}</span>
				</div>
			</div>
		{% endfor %}
	</div>
	<div class="btn-wrapper">
		<div class="btn add icon dashed js-add{% if settings.max and videos|length >= settings.max %} disabled{% endif %}">
			Add a video
		</div>
	</div>
</div>
<input type="hidden" name="{{ name }}" value="{{ value }}">

<div
	class="elementselect js-element-select"
	id="{{ name }}"
	data-name="{{ name }}"
	data-max="{{ settings.max }}"
	data-projects="{{ settings.projects|join(',') }}"
>
	<div class="elements">
		{% for video in videos %}
			<div
				class="element small hasstatus removable"
				data-id="{{ video.id }}"
			>
				<input
					name="{{ name }}[]"
					type="hidden"
					value="{{ video.id }}"
				>
				<a class="delete icon"></a>
				<span class="status live"></span>
				<div class="label">
					<span class="title">{{ video.title }}</span>
				</div>
			</div>
		{% endfor %}
	</div>
	<div class="btn-wrapper">
		<div class="btn add icon dashed{% if settings.max and videos|length >= settings.max %} disabled{% endif %}">
			Add a video
		</div>
	</div>
</div>

{% set jsSettings = {
	id: id|namespaceInputId,
	max: settings.max,
	projectIds: settings.projects|join(',')
} %}

{% includeJsResource('wistia/js/input.js') %}

{% includejs %}
	Wistia.init({{ jsSettings|json_encode|raw }});
{% endincludejs %}
Add js template function calls
Add js template function calls
