    {% for listing in listings %}
        <tr class="listing-row inline-item">
            <td><span style="display:none;">&nbsp;</span></td>{# vertical align with placement's first (empty) td #}
            <td class="listing-categories">
                <!-- category suggester -->
                <div class="form-row listing-category">
                    <input
                        id="id_category_{{ forloop.counter }}"
                        class="vForeignKeyRawIdAdminField hidden"
                        type="text"
                        value="{{ listing.category.pk }}"
                        name="{{ id_prefix }}"
                    />
                    <ul class="GenericSuggestField">
                        <li class="suggest-selected-item">
                            {{ listing.category }}
                            <a class="suggest-delete-link">x</a>
                        </li>
                        <li>
                            <input
                                id="id_category_{{ forloop.counter }}_suggest"
                                rel="../../../core/category/suggest/?f=__unicode__&title&f=slug&f=tree_path&q="
                            />
                        </li>
                    </ul>
                    <a href="/core/category/" class="suggest-related-lookup" id="lookup_id_category_{{ forloop.counter }}">
                        <img src="{{ NEWMAN_MEDIA_PREFIX }}ico/16/search.png" width="16" height="16" />
                    </a>
                </div>

            </td>

            <td class="listing-dates">
                <!-- Publish from -->
                <div class="publish_from">
                    <input
                        type="text"
                        id="{{ id_prefix }}-{{ forloop.counter }}-publish_from"
                        name="{{ id_prefix }}-publish_from"
                        value="{% if listing.publish_from %}{% if listing.publish_from.second %}{{ listing.publish_from }}{% else %}{{ listing.publish_from|date:"Y-m-d H:i" }}{% endif %}{% endif %}"
                        class="vDateTimeInput"
                    />
                </div>
            </td>

            {% if render_commercial_switch %}
                <td class="listing-commercial">
                    <input type="hidden"
                        id="{{ id_prefix }}-{{ forloop.counter }}-commercial"
                        name="{{ id_prefix }}-commercial"
                        value="{% if listing.commercial %}1{% else %}0{% endif %}"
                        />
                    <input
                        onClick="$('#{{ id_prefix }}-{{ forloop.counter }}-commercial').val(this.checked ? 1 : 0);"
                        type="checkbox"
                        id="{{ id_prefix }}-{{ forloop.counter }}-commercial-checkbox"
                        name="{{ id_prefix }}-commercial-checkbox"
                        {% if listing.commercial %}checked="checked"{% endif %}
                    />
                </td>
            {% endif %}

            <td class="listing-delete">
                <input
                    type="checkbox"
                    id="{{ id_prefix }}-{{ forloop.counter }}-delete"
                    name="{{ id_prefix }}-{{ forloop.counter }}-DELETE"
                />
            </td>

            <td colspan="2">&nbsp;</td>

        </tr>
    {% endfor %}

{% if id_prefix != "placement_set-__prefix__-listings" %}
    <input type="hidden" name="placement_listing_widget" value="{{ id_prefix }}" />
{# Template for creating listings #}
    <tr class="listing-row-template" style="display:none;"><!--
        <tr class="listing-row inline-item">
            <td><span style="display:none;">&nbsp;</span></td>
            <td class="listing-categories">
                <!-#- category suggester -#->
                <div class="form-row listing-category">
                    <input
                        id="id_category___NO__"
                        class="vForeignKeyRawIdAdminField hidden"
                        type="text"
                        name="{{ id_prefix }}"
                    />
                    <ul class="GenericSuggestField">
                        <li>
                            <input
                                id="id_category___NO___suggest"
                                rel="../../../core/category/suggest/?f=__unicode__&title&f=slug&f=tree_path&q="
                            />
                        </li>
                    </ul>
                    <a href="/core/category/" class="suggest-related-lookup" id="lookup_id_category___NO__">
                        <img src="{{ NEWMAN_MEDIA_PREFIX }}ico/16/search.png" width="16" height="16" />
                    </a>
                </div>

            </td>

            <td class="listing-dates">
                {#<input type="hidden" name="{{ id_prefix }}-{{ forloop.counter0 }}-listing_id" value="{{ listing.pk }}" />#}
                <!-#- Publish from -#->
                <div class="publish_from">
                    <input
                        type="text"
                        id="{{ id_prefix }}-__NO__-publish_from"
                        name="{{ id_prefix }}-publish_from"
                        class="vDateTimeInput"
                    />
                </div>
            </td>

            {% if render_commercial_switch %}
            <td class="listing-commercial">
                <input type="hidden"
                    id="{{ id_prefix }}-__NO__-commercial"
                    name="{{ id_prefix }}-commercial"
                    value="{% if listing.commercial %}1{% else %}0{% endif %}"
                    />
                <input
                    onClick="$('#{{ id_prefix }}-__NO__-commercial').val(this.checked ? 1 : 0);"
                    type="checkbox"
                    id="{{ id_prefix }}-__NO__-commercial-checkbox"
                    name="{{ id_prefix }}-commercial-checkbox"
                />
            </td>
            {% endif %}

            <td><a class="icn btn cancel remove-inline-button">{% trans 'Remove' %}</a></td>

            <td colspan="2">&nbsp;</td>

        </tr>
    --></tr>

{# End of template #}
{% endif %}
