<div class="col-md-3 package-aside versions-wrapper">
    <ul class="versions">
        {% for version in versions %}
            {% set expanded = version.id == expandedId|default(false) %}
            <li class="details-toggler version{% if loop.last %} last{% endif %}{% if expanded %} open{% endif %}" data-version-id="{{ version.version }}" data-load-more="{{ path('view_version', {versionId: version.id, _format: 'json'}) }}">
                <a href="#{{ version.version }}" class="version-number">
                    {{- version.version -}}
                    {% if version.hasVersionAlias() %}
                        / {{ version.versionAlias }}
                    {% endif -%}
                </a>

                {% if deleteVersionCsrfToken is defined and deleteVersionCsrfToken is not empty %}
                <form class="delete-version" action="{{ path("delete_version", {"versionId": version.id}) }}" method="DELETE">
                    <input type="hidden" name="_token" value="{{ deleteVersionCsrfToken }}" />
                    <i class="submit glyphicon glyphicon-remove"></i>
                </form>
                {% endif %}
            </li>
        {% endfor %}
    </ul>
    <div class="hidden versions-expander">
        <i class="glyphicon glyphicon-chevron-down"></i>
    </div>
</div>
