Part-DB.Part-DB-server/templates/projects/info/_bom.html.twig
Jan Böhmer 7d834ac8d7 Include the query part of the request, when generating the url for the datatables via a custom twig function.
This fixes issue #735, as without this the query gets not passed to the datatable
2024-10-16 23:57:02 +02:00

22 lines
No EOL
1.1 KiB
Twig

{% import "components/datatables.macro.html.twig" as datatables %}
<div class="btn-group mb-2 mt-2">
<a class="btn btn-success" {% if not is_granted('@projects.edit') %}disabled{% endif %}
href="{{ path('project_add_parts', {"id": project.id, "_redirect": uri_without_host(app.request)}) }}">
<i class="fa-solid fa-square-plus fa-fw"></i>
{% trans %}project.info.bom_add_parts{% endtrans %}
</a>
<button type="button" class="btn btn-success dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="{{ path('project_import_bom', {'id': project.id}) }}" {% if not is_granted('edit', project) %}disabled="disabled"{% endif %}>
<i class="fa-solid fa-file-import fa-fw"></i>
{% trans %}project.edit.bom.import_bom{% endtrans %}
</a>
</li>
</ul>
</div>
{{ datatables.datatable(datatable, 'elements/datatables/datatables', 'projects') }}