From 46a7b13293e2bc966ee6ce3fdda2b4d7f0196343 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sat, 25 Apr 2020 16:34:15 +0200 Subject: [PATCH] display more columns in invoice template listing (#1663) --- templates/invoice/actions.html.twig | 2 ++ templates/invoice/templates.html.twig | 45 ++++++++++++++++++--------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/templates/invoice/actions.html.twig b/templates/invoice/actions.html.twig index 69b6491f..d84d966c 100644 --- a/templates/invoice/actions.html.twig +++ b/templates/invoice/actions.html.twig @@ -30,6 +30,8 @@ {% set actions = actions|merge({'back': path('invoice')}) %} {% endif %} + {% set actions = actions|merge({'visibility': '#modal_invoice_template'}) %} + {% if is_granted('manage_invoice_template') %} {% set actions = actions|merge({'create': path('admin_invoice_template_create')}) %} {% endif %} diff --git a/templates/invoice/templates.html.twig b/templates/invoice/templates.html.twig index 5388b9d3..641398f5 100644 --- a/templates/invoice/templates.html.twig +++ b/templates/invoice/templates.html.twig @@ -3,33 +3,50 @@ {% import "macros/datatables.html.twig" as tables %} {% import "invoice/actions.html.twig" as actions %} +{% set columns = { + 'name': {'class': 'alwaysVisible text-nowrap', 'orderBy': false}, + 'title': {'class': 'hidden-xs text-nowrap', 'orderBy': false}, + 'company': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false}, + 'vat_id': {'class': 'hidden-xs hidden-sm text-nowrap', 'orderBy': false}, + 'vat': {'class': 'hidden-xs hidden-sm hidden-md text-nowrap', 'orderBy': false}, + 'due_days': {'class': 'hidden-xs hidden-sm hidden-md text-nowrap', 'orderBy': false}, + 'address': {'class': 'hidden', 'orderBy': false}, + 'contact': {'class': 'hidden', 'orderBy': false}, + 'calculator': {'title': 'label.invoice_calculator'|trans({}, 'invoice-calculator'), 'class': 'hidden', 'orderBy': false}, + 'renderer': {'title': 'label.invoice_renderer'|trans({}, 'invoice-renderer'), 'class': 'hidden', 'orderBy': false}, + 'language': {'class': 'text-nowrap', 'orderBy': false}, + 'actions': {'class': 'actions alwaysVisible', 'orderBy': false}, +} %} + +{% set tableName = 'invoice_template' %} + {% block page_title %}{{ 'admin_invoice_template.title'|trans }}{% endblock %} {% block page_actions %}{{ actions.invoice_templates('index') }}{% endblock %} +{% block main_before %} + {{ tables.data_table_column_modal(tableName, columns) }} +{% 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.datatable_header(tableName, columns, null, {'reload': 'kimai.invoiceTemplateUpdate'}) }} - {% for entry in entries %} - {{ entry.name }} + {{ entry.name }} {{ entry.title }} - {{ entry.dueDays }} + {{ entry.company }} + {{ entry.vatId }} {{ entry.vat }} - + {{ entry.dueDays }} + {{ entry.address|nl2br }} + {{ entry.contact|nl2br }} + {{ entry.calculator|trans({}, 'invoice-calculator') }} + {{ entry.renderer|trans({}, 'invoice-renderer') }} + {% if entry.language is not empty %}{{ entry.language|language }}{% endif %} + {{- actions.invoice_template(entry, 'index') -}}