{% extends 'base.html.twig' %} {% import "macros/widgets.html.twig" as widgets %} {% import "macros/datatables.html.twig" as tables %} {% import "macros/actions.html.twig" as actions %} {% block page_title %}{{ 'admin_invoice_template.title'|trans }}{% endblock %} {% block page_subtitle %}{{ 'admin_invoice_template.subtitle'|trans }}{% endblock %} {% block page_actions %}{{ actions.invoice_templates('index') }}{% endblock %} {% block main %} {% if entries.count == 0 %} {{ widgets.callout('warning', 'error.no_entries_found') }} {% endif %} {% set columns = { 'name': 'alwaysVisible', 'title': 'hidden-xs', 'due_days': 'hidden-xs hidden-sm', 'vat': 'hidden-xs hidden-sm', 'actions': 'actions alwaysVisible', } %} {% set tableName = 'invoice_template' %} {{ tables.data_table_header(tableName, columns) }} {% for entry in entries %} {{ entry.name }} {{ entry.title }} {{ entry.dueDays }} {{ entry.vat }} {# TODO move me to actions macro #} {% set actions = {} %} {% if is_granted('edit', entry) %} {% set actions = {'edit': {'url': path('admin_invoice_template_edit', {'id' : entry.id, 'page': page}), 'class': 'modal-ajax-form'}} %} {% endif %} {% if is_granted('create_invoice_template') %} {% set actions = actions|merge({'copy': path('admin_invoice_template_copy', {'id' : entry.id, 'page': page})}) %} {% endif %} {% if is_granted('delete', entry) %} {% set actions = actions|merge({'trash': path('admin_invoice_template_delete', {'id' : entry.id, 'page': page})}) %} {% endif %} {% set event = trigger('actions.invoice_templates', {'actions': actions, 'view': 'index', 'template': entry}) %} {{ widgets.table_actions(actions) }} {% endfor %} {{ tables.data_table_footer(entries, 'admin_invoice_template_paginated') }} {% endblock %}