<div data-batch-button class="btn-group">
    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {{ 'batch.button.action'|trans({}, 'forms') }} <span class="caret"></span>
    </button>
    <ul class="dropdown-menu">
        {# 跑for迴圈帶出onConfigAction，後面判斷是否有權限，括號內為Config設定的權限 #}
        {% for name, configItem in batchConfig if has_role_or_superadmin(configItem.security)%}
            {# 將configURL送到這邊後由前端帶slug，組出完整URL #}
            <li><a href="#" data-confirm="{{ "batch.confirm.message"|trans({message: name|trans({}, 'forms')}, 'forms') }}" data-batch-action-url="{{ path(configItem.url, {slug: app.request.attributes.get('slug')}) }}">{{ name|trans({}, 'forms') }}</a></li>
        {% endfor %}
    </ul>
</div>