{% load static %}
{% load i18n %}

{% spaceless %}
<div class="related-widget-wrapper">
    <div class="dynamic-array-widget">
        <ul>
            {% for subwidget in widget.subwidgets %}
                <li class="array-item" {% if widget.is_none %}data-isNone="true" style="display: none"{% endif %}>
                    <input type="text"
                         id="{{ subwidget.id }}"
                         class="colorfield_field jscolor {% if subwidget.class %}{{ subwidget.class }}{% else %}form-control{% endif %}"
                         name="{{ subwidget.name }}"
                         value="{% firstof subwidget.value default '' %}"
                         placeholder="{% firstof subwidget.value default '' %}"
                         data-jscolor="{hash:true,width:225,height:150,format:'{{ subwidget.format }}',required:{% if subwidget.required %}true{% else %}false{% endif %},paletteCols:4,paletteHeight:28{% if subwidget.palette %},palette:{{ subwidget.palette|safe }}{% endif %}}"
                         {% if subwidget.disabled %}disabled{% endif %}
                         {% if subwidget.required %}required{% endif %}
                    />
                    <div class="remove">
                        <div class="inline-deletelink"></div>
                    </div>
                </li>
            {% endfor %}
        </ul>
        <div><input type="button" class="add-array-item" value="{% trans "Add another" %}"></div>
    </div>
</div>
{% endspaceless %}
