{% embed '@theme/embeds/card.html.twig' with {'customer': customer, 'projects': projects, 'page': page} %} {% import "project/actions.html.twig" as actions %} {% import "macros/widgets.html.twig" as widgets %} {% block box_title %}{{ 'projects'|trans }}{% endblock %} {% block box_attributes %} id="project_list_box" data-reload="kimai.projectUpdate kimai.projectDelete" {% endblock %} {% block box_tools %} {%- if is_granted('report:project') and is_granted('budget_any', 'project') -%} {{ widgets.card_tool_button('reporting', {'title': 'report_project_view', 'translation_domain': 'reporting', 'url': path('report_project_view', {'customer': customer.id})}) }} {%- endif -%} {%- if customer.visible and is_granted('create_project') -%} {{ widgets.card_tool_button('create', {'class': 'modal-ajax-form open-edit', 'title': 'create', 'url': path('admin_project_create_with_customer', {'customer': customer.id})}) }} {%- endif -%} {% endblock %} {% block box_footer %} {%- if projects|length > 0 -%}
{{ pagination(projects, { css_container_class: 'pagination ms-auto m-0', routeName: 'customer_projects', routeParams: {'id': customer.id} }) }}
{%- endif -%} {% endblock %} {% block box_body_class %}{%- if projects|length > 0 -%}p-0{%- endif -%}{% endblock %} {% block box_body %} {% if projects|length == 0 %}
{{ 'error.no_entries_found'|trans }}
{% else %} {% for project in projects %} {% endfor %}
{{ 'name'|trans }} {{ 'comment'|trans }} {{ 'project_end'|trans }} {{ 'visible'|trans }} {{ 'team'|trans }}
{{ widgets.label_project(project) }} {{ project.comment|comment1line(false) }} {% if project.end is not null %} {{ project.end|date_short }} {% else %} – {% endif %} {{ widgets.label_visible(project.visible) }} {{ widgets.badge_team_access(project.teams) }} {{ actions.project(project, 'customer_details', true) }}
{% endif %} {% endblock %} {% endembed %}