{% extends app.request.xmlHttpRequest ? 'form.html.twig' : 'base.html.twig' %}
{% import "project/actions.html.twig" as actions %}

{% block page_title %}{{ 'admin_project.title'|trans }}{% endblock %}
{% block page_actions %}{{ actions.project(project, 'delete') }}{% endblock %}

{% block main %}

    {% set inUse = (stats.recordAmount > 0) %}

    {% set params = {
        '%project%': '<strong>' ~ project.name ~ '</strong>',
        '%customer%': '<strong>' ~ project.customer.name ~ '</strong>',
        '%records%': '<strong>' ~ stats.recordAmount ~ '</strong>',
        '%activities%': '<strong>' ~ stats.activityAmount ~ '</strong>',
        '%duration%': '<strong>' ~ stats.recordDuration|duration ~ '</strong>'
    } %}

    {% set message = '<p>' ~ ("admin_project.short_stats"|trans(params)|raw) ~ '</p><p>' ~ ("admin_entity.delete_confirm"|trans|raw) ~ '</p>' %}

    {{ include(app.request.xmlHttpRequest ? 'default/_form_delete_modal.html.twig' : 'default/_form_delete.html.twig', {
        'message': message|raw,
        'form': form,
        'used': inUse,
        'back': path('admin_project')
    }) }}

{% endblock %}
