{% macro print_template(template, level = 0)  %}
    <tr>
        <td class="c-template__level--child-{{ level }}">
            <a class="c-template__level--child-{{ level }} c-template__title" href="{{ path("designer_template_edit", {"id": template.id}) }}" style="text-decoration:none"> {{ template.name }}</a>
        </td>
        <td>{{ time_diff(template.publishedAt) }}</td>
        <td class="text-{{ template.enabled ? 'success estat-on' : 'danger estat-off' }}">{{ template.enabled ? 'On' : 'Off' }}</td>
        <td>
            <div class="dsropdown">
                <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {{ "cs_admin.designer.select.placeholder"|trans }}
                </button>
                <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" href="{{ path("designer_show_template", {"templateId": template.id}) }}">{{ "designer_common.action.open_editor"|trans }}</a>
                    <a class="dropdown-item" href="{{ path("designer_save_template", {"templateId": template.id}) }}">{{ "designer_common.action.publish.default"|trans }}</a>
                </div>
            </div>
        </td>
    </tr>
    {% for child in template.children %}
        {{ _self.print_template(child, level+1) }}
    {% endfor %}
{% endmacro %}