<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* export/index.html.twig */
class __TwigTemplate_99ee1c1e528bd6af146487aef93505da18ea2348944aa8eb25e67b32210cfc91 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'page_title' => [$this, 'block_page_title'],
            'page_subtitle' => [$this, 'block_page_subtitle'],
            'page_actions' => [$this, 'block_page_actions'],
            'main_before' => [$this, 'block_main_before'],
            'main' => [$this, 'block_main'],
            'javascripts' => [$this, 'block_javascripts'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 1
        return "base.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 2
        $macros["widgets"] = $this->macros["widgets"] = $this->loadTemplate("macros/widgets.html.twig", "export/index.html.twig", 2)->unwrap();
        // line 3
        $macros["toolbar"] = $this->macros["toolbar"] = $this->loadTemplate("macros/toolbar.html.twig", "export/index.html.twig", 3)->unwrap();
        // line 4
        $macros["tables"] = $this->macros["tables"] = $this->loadTemplate("macros/datatables.html.twig", "export/index.html.twig", 4)->unwrap();
        // line 5
        $macros["actions"] = $this->macros["actions"] = $this->loadTemplate("export/actions.html.twig", "export/index.html.twig", 5)->unwrap();
        // line 7
        $context["columns"] = ["date" => ["class" => "alwaysVisible text-nowrap", "orderBy" => false], "user" => ["class" => "hidden-xs hidden-sm", "orderBy" => false], "project" => ["class" => "hidden-xs hidden-sm", "orderBy" => false], "activity" => ["class" => "hidden-xs hidden-sm hidden-md", "orderBy" => false], "description" => ["class" => "hidden-xs hidden-sm hidden-md timesheet-description", "orderBy" => false], "unit_price" => ["class" => "hidden hidden-xs text-nowrap", "orderBy" => false], "duration" => ["class" => "text-nowrap", "orderBy" => false], "rate_internal" => ["class" => "hidden-xs text-nowrap", "orderBy" => false], "total_rate" => ["class" => "text-nowrap", "orderBy" => false], "exported" => ["class" => "alwaysVisible", "orderBy" => false]];
        // line 20
        $context["tableName"] = "export";
        // line 1
        $this->parent = $this->loadTemplate("base.html.twig", "export/index.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 22
    public function block_page_title($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("export.title"), "html", null, true);
    }

    // line 23
    public function block_page_subtitle($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("export.subtitle"), "html", null, true);
    }

    // line 24
    public function block_page_actions($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo twig_call_macro($macros["actions"], "macro_export", [((($context["preview_show"] ?? null)) ? ("preview") : ("index"))], 24, $context, $this->getSourceContext());
    }

    // line 26
    public function block_main_before($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 27
        echo "    ";
        echo twig_call_macro($macros["tables"], "macro_data_table_column_modal", [($context["tableName"] ?? null), ($context["columns"] ?? null)], 27, $context, $this->getSourceContext());
        echo "
";
    }

    // line 30
    public function block_main($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 31
        echo "
    ";
        // line 32
        $this->loadTemplate("export/index.html.twig", "export/index.html.twig", 32, "360195554")->display($context);
        // line 85
        echo "
    ";
        // line 86
        if (($context["preview_show"] ?? null)) {
            // line 87
            echo "        ";
            if (twig_test_empty(($context["entries"] ?? null))) {
                // line 88
                echo "            ";
                echo twig_call_macro($macros["widgets"], "macro_nothing_found", [], 88, $context, $this->getSourceContext());
                echo "
        ";
            } else {
                // line 90
                echo "            ";
                echo twig_call_macro($macros["tables"], "macro_datatable_header", [($context["tableName"] ?? null), ($context["columns"] ?? null), ($context["query"] ?? null), []], 90, $context, $this->getSourceContext());
                echo "
            ";
                // line 91
                $context["totalAmount"] = [];
                // line 92
                echo "            ";
                $context["totalInternalAmount"] = [];
                // line 93
                echo "            ";
                $context["totalDuration"] = 0;
                // line 94
                echo "            ";
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable(($context["entries"] ?? null));
                foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
                    // line 95
                    echo "                ";
                    $context["currency"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["entry"], "project", [], "any", false, false, false, 95), "customer", [], "any", false, false, false, 95), "currency", [], "any", false, false, false, 95);
                    // line 96
                    echo "                ";
                    $context["duration"] = $this->extensions['App\Twig\LocaleExtensions']->duration(twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 96));
                    // line 97
                    echo "                ";
                    if ( !twig_get_attribute($this->env, $this->source, ($context["totalAmount"] ?? null), ($context["currency"] ?? null), [], "array", true, true, false, 97)) {
                        // line 98
                        echo "                    ";
                        $context["totalAmount"] = twig_array_merge(($context["totalAmount"] ?? null), [($context["currency"] ?? null) => 0]);
                        // line 99
                        echo "                    ";
                        $context["totalInternalAmount"] = twig_array_merge(($context["totalInternalAmount"] ?? null), [($context["currency"] ?? null) => 0]);
                        // line 100
                        echo "                ";
                    }
                    // line 101
                    echo "                ";
                    if ( !(null === twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 101))) {
                        // line 102
                        echo "                    ";
                        $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "fixedRate", [], "any", false, false, false, 102);
                        // line 103
                        echo "                ";
                    } else {
                        // line 104
                        echo "                    ";
                        $context["rate"] = twig_get_attribute($this->env, $this->source, $context["entry"], "hourlyRate", [], "any", false, false, false, 104);
                        // line 105
                        echo "                ";
                    }
                    // line 106
                    echo "                ";
                    $context["totalDuration"] = (($context["totalDuration"] ?? null) + twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 106));
                    // line 107
                    echo "                ";
                    $context["totalAmount"] = twig_array_merge(($context["totalAmount"] ?? null), [($context["currency"] ?? null) => ((($__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4 = ($context["totalAmount"] ?? null)) && is_array($__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4) || $__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4 instanceof ArrayAccess ? ($__internal_f607aeef2c31a95a7bf963452dff024ffaeb6aafbe4603f9ca3bec57be8633f4[($context["currency"] ?? null)] ?? null) : null) + twig_get_attribute($this->env, $this->source, $context["entry"], "rate", [], "any", false, false, false, 107))]);
                    // line 108
                    echo "                ";
                    $context["totalInternalAmount"] = twig_array_merge(($context["totalInternalAmount"] ?? null), [($context["currency"] ?? null) => ((($__internal_62824350bc4502ee19dbc2e99fc6bdd3bd90e7d8dd6e72f42c35efd048542144 = ($context["totalInternalAmount"] ?? null)) && is_array($__internal_62824350bc4502ee19dbc2e99fc6bdd3bd90e7d8dd6e72f42c35efd048542144) || $__internal_62824350bc4502ee19dbc2e99fc6bdd3bd90e7d8dd6e72f42c35efd048542144 instanceof ArrayAccess ? ($__internal_62824350bc4502ee19dbc2e99fc6bdd3bd90e7d8dd6e72f42c35efd048542144[($context["currency"] ?? null)] ?? null) : null) + twig_get_attribute($this->env, $this->source, $context["entry"], "internalRate", [], "any", false, false, false, 108))]);
                    // line 109
                    echo "                <tr>
                    <td class=\"";
                    // line 110
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "date"], 110, $context, $this->getSourceContext());
                    echo "\">";
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\DateExtensions']->dateShort(twig_get_attribute($this->env, $this->source, $context["entry"], "begin", [], "any", false, false, false, 110)), "html", null, true);
                    echo "</td>
                    <td class=\"";
                    // line 111
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "user"], 111, $context, $this->getSourceContext());
                    echo "\">";
                    echo twig_call_macro($macros["widgets"], "macro_label_user", [twig_get_attribute($this->env, $this->source, $context["entry"], "user", [], "any", false, false, false, 111)], 111, $context, $this->getSourceContext());
                    echo "</td>
                    <td class=\"";
                    // line 112
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "project"], 112, $context, $this->getSourceContext());
                    echo "\">
                        ";
                    // line 113
                    echo twig_call_macro($macros["widgets"], "macro_label_project", [twig_get_attribute($this->env, $this->source, $context["entry"], "project", [], "any", false, false, false, 113)], 113, $context, $this->getSourceContext());
                    echo "
                        <br>
                        <small>";
                    // line 115
                    echo twig_call_macro($macros["widgets"], "macro_label_customer", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["entry"], "project", [], "any", false, false, false, 115), "customer", [], "any", false, false, false, 115)], 115, $context, $this->getSourceContext());
                    echo "</small>
                    </td>
                    <td class=\"";
                    // line 117
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "activity"], 117, $context, $this->getSourceContext());
                    echo "\">";
                    echo twig_call_macro($macros["widgets"], "macro_label_activity", [twig_get_attribute($this->env, $this->source, $context["entry"], "activity", [], "any", false, false, false, 117)], 117, $context, $this->getSourceContext());
                    echo "</td>
                    <td class=\"";
                    // line 118
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "description"], 118, $context, $this->getSourceContext());
                    echo "\">
                        ";
                    // line 119
                    echo $this->extensions['App\Twig\MarkdownExtension']->timesheetContent(twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "description", [], "any", false, false, false, 119)));
                    echo "
                    </td>
                    <td class=\"";
                    // line 121
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "unit_price"], 121, $context, $this->getSourceContext());
                    echo "\">
                        ";
                    // line 122
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(($context["rate"] ?? null), ($context["currency"] ?? null)), "html", null, true);
                    echo "
                    </td>
                    <td class=\"";
                    // line 124
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "duration"], 124, $context, $this->getSourceContext());
                    echo "\" data-duration=\"";
                    echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "duration", [], "any", false, false, false, 124), "html", null, true);
                    echo "\">
                        ";
                    // line 125
                    echo twig_escape_filter($this->env, ($context["duration"] ?? null), "html", null, true);
                    echo "
                    </td>
                    <td class=\"";
                    // line 127
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "rate_internal"], 127, $context, $this->getSourceContext());
                    echo "\">
                        ";
                    // line 128
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, $context["entry"], "internalRate", [], "any", false, false, false, 128), ($context["currency"] ?? null)), "html", null, true);
                    echo "
                    </td>
                    <td class=\"";
                    // line 130
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "total_rate"], 130, $context, $this->getSourceContext());
                    echo "\">
                        ";
                    // line 131
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money(twig_get_attribute($this->env, $this->source, $context["entry"], "rate", [], "any", false, false, false, 131), ($context["currency"] ?? null)), "html", null, true);
                    echo "
                    </td>
                    <td class=\"";
                    // line 133
                    echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "exported"], 133, $context, $this->getSourceContext());
                    echo "\">
                    ";
                    // line 134
                    if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("edit_export", $context["entry"])) {
                        // line 135
                        echo "                        ";
                        if (twig_get_attribute($this->env, $this->source, $context["entry"], "exported", [], "any", false, false, false, 135)) {
                            // line 136
                            echo "                            <button type=\"button\" class=\"btn btn-default exportBtn active\" data-toggle=\"button\" aria-pressed=\"true\" autocomplete=\"off\"
                                    data-exported-text=\"";
                            // line 137
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.exported"), "html", null, true);
                            echo "\" data-clean-text=\"";
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.not_exported"), "html", null, true);
                            echo "\" data-timesheet=\"";
                            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "id", [], "any", false, false, false, 137), "html", null, true);
                            echo "\">
                            ";
                            // line 138
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.exported"), "html", null, true);
                            echo "
                            </button>
                        ";
                        } else {
                            // line 141
                            echo "                            <button type=\"button\" class=\"btn btn-default exportBtn\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\"
                                    data-exported-text=\"";
                            // line 142
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.exported"), "html", null, true);
                            echo "\" data-clean-text=\"";
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.not_exported"), "html", null, true);
                            echo "\" data-timesheet=\"";
                            echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["entry"], "id", [], "any", false, false, false, 142), "html", null, true);
                            echo "\">
                            ";
                            // line 143
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.not_exported"), "html", null, true);
                            echo "
                            </button>
                        ";
                        }
                        // line 146
                        echo "                    ";
                    } else {
                        // line 147
                        echo "                        ";
                        if (twig_get_attribute($this->env, $this->source, $context["entry"], "exported", [], "any", false, false, false, 147)) {
                            // line 148
                            echo "                            ";
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.exported"), "html", null, true);
                            echo "
                        ";
                        } else {
                            // line 150
                            echo "                            ";
                            echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("entryState.not_exported"), "html", null, true);
                            echo "
                        ";
                        }
                        // line 152
                        echo "                    ";
                    }
                    // line 153
                    echo "                    </td>
                </tr>
            ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 156
                echo "            <tr>
                <th class=\"";
                // line 157
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "date"], 157, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 158
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "user"], 158, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 159
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "project"], 159, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 160
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "activity"], 160, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 161
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "description"], 161, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 162
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "unit_price"], 162, $context, $this->getSourceContext());
                echo "\"></th>
                <th class=\"";
                // line 163
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "duration"], 163, $context, $this->getSourceContext());
                echo "\">
                    ";
                // line 164
                echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->duration(($context["totalDuration"] ?? null)), "html", null, true);
                echo "
                </th>
                <th class=\"";
                // line 166
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "rate_internal"], 166, $context, $this->getSourceContext());
                echo "\">
                    ";
                // line 167
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable(($context["totalInternalAmount"] ?? null));
                $context['loop'] = [
                  'parent' => $context['_parent'],
                  'index0' => 0,
                  'index'  => 1,
                  'first'  => true,
                ];
                if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                    $length = count($context['_seq']);
                    $context['loop']['revindex0'] = $length - 1;
                    $context['loop']['revindex'] = $length;
                    $context['loop']['length'] = $length;
                    $context['loop']['last'] = 1 === $length;
                }
                foreach ($context['_seq'] as $context["currency"] => $context["amount"]) {
                    // line 168
                    echo "                        ";
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money($context["amount"], $context["currency"]), "html", null, true);
                    echo "
                        ";
                    // line 169
                    if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 169)) {
                        echo "<br>";
                    }
                    // line 170
                    echo "                    ";
                    ++$context['loop']['index0'];
                    ++$context['loop']['index'];
                    $context['loop']['first'] = false;
                    if (isset($context['loop']['length'])) {
                        --$context['loop']['revindex0'];
                        --$context['loop']['revindex'];
                        $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                    }
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['currency'], $context['amount'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 171
                echo "                </th>
                <th class=\"";
                // line 172
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "total_rate"], 172, $context, $this->getSourceContext());
                echo "\">
                    ";
                // line 173
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable(($context["totalAmount"] ?? null));
                $context['loop'] = [
                  'parent' => $context['_parent'],
                  'index0' => 0,
                  'index'  => 1,
                  'first'  => true,
                ];
                if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
                    $length = count($context['_seq']);
                    $context['loop']['revindex0'] = $length - 1;
                    $context['loop']['revindex'] = $length;
                    $context['loop']['length'] = $length;
                    $context['loop']['last'] = 1 === $length;
                }
                foreach ($context['_seq'] as $context["currency"] => $context["amount"]) {
                    // line 174
                    echo "                        ";
                    echo twig_escape_filter($this->env, $this->extensions['App\Twig\LocaleExtensions']->money($context["amount"], $context["currency"]), "html", null, true);
                    echo "
                        ";
                    // line 175
                    if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 175)) {
                        echo "<br>";
                    }
                    // line 176
                    echo "                    ";
                    ++$context['loop']['index0'];
                    ++$context['loop']['index'];
                    $context['loop']['first'] = false;
                    if (isset($context['loop']['length'])) {
                        --$context['loop']['revindex0'];
                        --$context['loop']['revindex'];
                        $context['loop']['last'] = 0 === $context['loop']['revindex0'];
                    }
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['currency'], $context['amount'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 177
                echo "                </th>
                <th class=\"";
                // line 178
                echo twig_call_macro($macros["tables"], "macro_data_table_column_class", [($context["tableName"] ?? null), ($context["columns"] ?? null), "exported"], 178, $context, $this->getSourceContext());
                echo "\"></th>
            </tr>
            ";
                // line 180
                echo twig_call_macro($macros["tables"], "macro_data_table_footer", [($context["entries"] ?? null)], 180, $context, $this->getSourceContext());
                echo "
        ";
            }
            // line 182
            echo "    ";
        }
        // line 183
        echo "
";
    }

    // line 186
    public function block_javascripts($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 187
        echo "    ";
        $this->displayParentBlock("javascripts", $context, $blocks);
        echo "
    <script type=\"text/javascript\">

        function confirmToggleState(button)
        {
            var ALERT = kimai.getPlugin('alert');
            var message = '";
        // line 193
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("export.clear_all"), "html", null, true);
        echo "';
            var hasActive = true;

            if (!\$('#export-toggle-button').hasClass('export-off')) {
                message = '";
        // line 197
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("export.mark_all"), "html", null, true);
        echo "';
                hasActive = false;
            }

            ALERT.question(message, function(value) {
                if (!value) {
                    return;
                }
                var btn = \$(button);
                var exportButtons = \$('.exportBtn');
                // disabling does not yet work...
                if (exportButtons.length > 0) {
                    btn.addClass('disabled');
                }

                // ... as the clicks are asynchronous and the each comes back too early ...
                exportButtons.each(function () {
                    if (hasActive === \$(this).hasClass('active')) {
                        \$(this).click();
                    }
                });

                // ... so the button is re-enabled immediately - that should be fixed in a future update
                btn.removeClass('disabled');
                if (btn.hasClass('export-off')) {
                    btn.removeClass('export-off');
                    btn.html('<i class=\"fas fa-toggle-off\"></i>');
                } else {
                    btn.addClass('export-off');
                    btn.html('<i class=\"fas fa-toggle-on\"></i>');
                }
            });
        }

        function updateTimesheetExportState(button, id, exported)
        {
            var ALERT = kimai.getPlugin('alert');

            // FIXME use Kimai API plugin
            \$.ajax({
                url: '";
        // line 237
        echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("export_timesheet", ["id" => "-s-"]);
        echo "'.replace('-s-', id),
                headers: {
                    'X-AUTH-SESSION': true,
                    'Content-Type':'application/json'
                },
                method: 'PATCH',
                success: function(data) {
                    if (exported) {
                        button.button('exported');
                    } else {
                        button.button('clean');
                    }
                    if (\$('select#exported').val() !== '";
        // line 249
        echo twig_escape_filter($this->env, twig_constant("App\\Repository\\Query\\TimesheetQuery::STATE_ALL"), "html", null, true);
        echo "') {
                        button.closest('tr').hide('ease', function() {
                            \$(this).remove();
                            if(\$(this).closest('table').find('tbody tr:visible').length === 0) {
                                \$('#export-buttons button').prop('disabled', true);
                            }
                        });
                    }
                }, error: function(jqXHR, textStatus, errorThrown) {
                    var message = 'An error occured';
                    if (jqXHR.responseJSON !== undefined) {
                        message = jqXHR.responseJSON.message;
                        if (jqXHR.responseJSON.errors !== undefined)
                        {
                            var errors = jqXHR.responseJSON.errors.errors;
                            for (var i = 0; i < errors.length; i++) {
                                message += ' / ' + errors[i];
                            }
                        }
                    }
                    ALERT.error('";
        // line 269
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("action.update.error", [], "flashmessages"), "html", null, true);
        echo "', message);
                    button.button('reset');
                    if (exported) {
                        button.removeClass('active');
                    } else {
                        button.addClass('active');
                    }
                }
            });
        }

        document.addEventListener('kimai.initialized', function() {
            \$('body').on('click', '.exportBtn', function() {
                var button = \$(this);
                var id = button.attr('data-timesheet');
                updateTimesheetExportState(button, id, !button.hasClass('active'));
            });

            \$('#export-toggle-button').on('click', function () {
                confirmToggleState(this);
            });

            \$('body').on('click', '#export-buttons .startExportBtn', function() {
                \$('#type').val(\$(this).attr('data-type'));
                var \$form = \$(\"#export-form\");
                var prevAction = \$form.attr('action');
                var prevMethod = \$form.attr('method');
                \$form.attr('target', '_blank').attr('method', 'POST').attr('action', '";
        // line 296
        echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("export_data");
        echo "');
                \$form.submit();
                \$('#type').val('');
                \$form.removeAttr('target').attr('action', prevAction).attr('method', prevMethod);
            });
        });
    </script>
";
    }

    public function getTemplateName()
    {
        return "export/index.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  613 => 296,  583 => 269,  560 => 249,  545 => 237,  502 => 197,  495 => 193,  485 => 187,  481 => 186,  476 => 183,  473 => 182,  468 => 180,  463 => 178,  460 => 177,  446 => 176,  442 => 175,  437 => 174,  420 => 173,  416 => 172,  413 => 171,  399 => 170,  395 => 169,  390 => 168,  373 => 167,  369 => 166,  364 => 164,  360 => 163,  356 => 162,  352 => 161,  348 => 160,  344 => 159,  340 => 158,  336 => 157,  333 => 156,  325 => 153,  322 => 152,  316 => 150,  310 => 148,  307 => 147,  304 => 146,  298 => 143,  290 => 142,  287 => 141,  281 => 138,  273 => 137,  270 => 136,  267 => 135,  265 => 134,  261 => 133,  256 => 131,  252 => 130,  247 => 128,  243 => 127,  238 => 125,  232 => 124,  227 => 122,  223 => 121,  218 => 119,  214 => 118,  208 => 117,  203 => 115,  198 => 113,  194 => 112,  188 => 111,  182 => 110,  179 => 109,  176 => 108,  173 => 107,  170 => 106,  167 => 105,  164 => 104,  161 => 103,  158 => 102,  155 => 101,  152 => 100,  149 => 99,  146 => 98,  143 => 97,  140 => 96,  137 => 95,  132 => 94,  129 => 93,  126 => 92,  124 => 91,  119 => 90,  113 => 88,  110 => 87,  108 => 86,  105 => 85,  103 => 32,  100 => 31,  96 => 30,  89 => 27,  85 => 26,  78 => 24,  71 => 23,  64 => 22,  59 => 1,  57 => 20,  55 => 7,  53 => 5,  51 => 4,  49 => 3,  47 => 2,  40 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "export/index.html.twig", "/var/www/html/kimai2/templates/export/index.html.twig");
    }
}


/* export/index.html.twig */
class __TwigTemplate_99ee1c1e528bd6af146487aef93505da18ea2348944aa8eb25e67b32210cfc91___360195554 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->blocks = [
            'box_title' => [$this, 'block_box_title'],
            'box_before' => [$this, 'block_box_before'],
            'box_body' => [$this, 'block_box_body'],
            'box_footer' => [$this, 'block_box_footer'],
            'box_after' => [$this, 'block_box_after'],
        ];
    }

    protected function doGetParent(array $context)
    {
        // line 32
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 33
        $this->env->getRuntime("Symfony\\Component\\Form\\FormRenderer")->setTheme(($context["form"] ?? null), [0 => "@AdminLTE/layout/form-theme-horizontal.html.twig"], true);
        // line 32
        $this->parent = $this->loadTemplate("@AdminLTE/Widgets/box-widget.html.twig", "export/index.html.twig", 32);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 34
    public function block_box_title($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("export.filter"), "html", null, true);
    }

    // line 35
    public function block_box_before($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
    }

    // line 36
    public function block_box_body($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 37
        echo "            ";
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(($context["form"] ?? null), 'errors');
        echo "
            ";
        // line 38
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "searchTerm", [], "any", false, false, false, 38), 'row');
        echo "
            ";
        // line 39
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "daterange", [], "any", false, false, false, 39), 'row');
        echo "
            ";
        // line 40
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "customers", [], "any", false, false, false, 40), 'row');
        echo "
            ";
        // line 41
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "projects", [], "any", false, false, false, 41), 'row');
        echo "
            ";
        // line 42
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "activities", [], "any", false, false, false, 42), 'row');
        echo "
            ";
        // line 43
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "users", [], "any", false, false, false, 43), 'row');
        echo "
            ";
        // line 44
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "tags", [], "any", false, false, false, 44), 'row');
        echo "
            ";
        // line 45
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "exported", [], "any", false, false, false, 45), 'row');
        echo "
            ";
        // line 46
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "state", [], "any", false, false, false, 46), 'row');
        echo "
            ";
        // line 47
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "markAsExported", [], "any", false, false, false, 47), 'row');
        echo "
        ";
    }

    // line 49
    public function block_box_footer($context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 50
        echo "            ";
        $context["buttons"] = [];
        // line 51
        echo "            ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["renderer"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["button"]) {
            // line 52
            echo "                ";
            $context["title"] = twig_get_attribute($this->env, $this->source, $context["button"], "title", [], "any", false, false, false, 52);
            // line 53
            echo "                ";
            $context["group"] = [];
            // line 54
            echo "                ";
            if (twig_get_attribute($this->env, $this->source, ($context["buttons"] ?? null), ($context["title"] ?? null), [], "array", true, true, false, 54)) {
                // line 55
                echo "                    ";
                $context["group"] = (($__internal_1cfccaec8dd2e8578ccb026fbe7f2e7e29ac2ed5deb976639c5fc99a6ea8583b = ($context["buttons"] ?? null)) && is_array($__internal_1cfccaec8dd2e8578ccb026fbe7f2e7e29ac2ed5deb976639c5fc99a6ea8583b) || $__internal_1cfccaec8dd2e8578ccb026fbe7f2e7e29ac2ed5deb976639c5fc99a6ea8583b instanceof ArrayAccess ? ($__internal_1cfccaec8dd2e8578ccb026fbe7f2e7e29ac2ed5deb976639c5fc99a6ea8583b[($context["title"] ?? null)] ?? null) : null);
                // line 56
                echo "                ";
            }
            // line 57
            echo "                ";
            $context["group"] = twig_array_merge(($context["group"] ?? null), [0 => $context["button"]]);
            // line 58
            echo "                ";
            $context["buttons"] = twig_array_merge(($context["buttons"] ?? null), [($context["title"] ?? null) => ($context["group"] ?? null)]);
            // line 59
            echo "            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['button'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 60
        echo "            <div class=\"btn-group\" id=\"export-buttons\" role=\"group\">
                ";
        // line 61
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["buttons"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["group"]) {
            // line 62
            echo "                    ";
            $context["button"] = twig_get_attribute($this->env, $this->source, $context["group"], 0, [], "any", false, false, false, 62);
            // line 63
            echo "                    ";
            if (0 === twig_compare(twig_length_filter($this->env, $context["group"]), 1)) {
                // line 64
                echo "                        <button type=\"button\" id=\"export-";
                echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["button"] ?? null), "id", [], "any", false, false, false, 64), "html", null, true);
                echo "-button\" class=\"btn btn-success startExportBtn\" data-type=\"";
                echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, ($context["button"] ?? null), "id", [], "any", false, false, false, 64), "html", null, true);
                echo "\">
                            ";
                // line 65
                echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("button." . twig_get_attribute($this->env, $this->source, ($context["button"] ?? null), "title", [], "any", false, false, false, 65))), "html", null, true);
                echo "
                        </button>
                    ";
            } elseif (1 === twig_compare(twig_length_filter($this->env,             // line 67
$context["group"]), 1)) {
                // line 68
                echo "                        <div class=\"btn-group\">
                            <button type=\"button\" class=\"btn btn-success dropdown-toggle\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">
                                ";
                // line 70
                echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("button." . twig_get_attribute($this->env, $this->source, ($context["button"] ?? null), "title", [], "any", false, false, false, 70))), "html", null, true);
                echo " <span class=\"caret\"></span>
                            </button>
                            <ul class=\"dropdown-menu\">
                            ";
                // line 73
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable($context["group"]);
                foreach ($context['_seq'] as $context["_key"] => $context["button"]) {
                    // line 74
                    echo "                                <li><a href=\"#\" class=\"startExportBtn\" data-type=\"";
                    echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["button"], "id", [], "any", false, false, false, 74), "html", null, true);
                    echo "\">";
                    echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(twig_get_attribute($this->env, $this->source, $context["button"], "id", [], "any", false, false, false, 74), [], "export"), "html", null, true);
                    echo "</a></li>
                            ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['button'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 76
                echo "                            </ul>
                        </div>
                    ";
            }
            // line 79
            echo "                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['group'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 80
        echo "            </div>
            ";
        // line 81
        echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "preview", [], "any", false, false, false, 81), 'widget');
        echo "
        ";
    }

    // line 83
    public function block_box_after($context, array $blocks = [])
    {
        $macros = $this->macros;
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
    }

    public function getTemplateName()
    {
        return "export/index.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  860 => 83,  854 => 81,  851 => 80,  845 => 79,  840 => 76,  829 => 74,  825 => 73,  819 => 70,  815 => 68,  813 => 67,  808 => 65,  801 => 64,  798 => 63,  795 => 62,  791 => 61,  788 => 60,  782 => 59,  779 => 58,  776 => 57,  773 => 56,  770 => 55,  767 => 54,  764 => 53,  761 => 52,  756 => 51,  753 => 50,  749 => 49,  743 => 47,  739 => 46,  735 => 45,  731 => 44,  727 => 43,  723 => 42,  719 => 41,  715 => 40,  711 => 39,  707 => 38,  702 => 37,  698 => 36,  691 => 35,  684 => 34,  679 => 32,  677 => 33,  670 => 32,  613 => 296,  583 => 269,  560 => 249,  545 => 237,  502 => 197,  495 => 193,  485 => 187,  481 => 186,  476 => 183,  473 => 182,  468 => 180,  463 => 178,  460 => 177,  446 => 176,  442 => 175,  437 => 174,  420 => 173,  416 => 172,  413 => 171,  399 => 170,  395 => 169,  390 => 168,  373 => 167,  369 => 166,  364 => 164,  360 => 163,  356 => 162,  352 => 161,  348 => 160,  344 => 159,  340 => 158,  336 => 157,  333 => 156,  325 => 153,  322 => 152,  316 => 150,  310 => 148,  307 => 147,  304 => 146,  298 => 143,  290 => 142,  287 => 141,  281 => 138,  273 => 137,  270 => 136,  267 => 135,  265 => 134,  261 => 133,  256 => 131,  252 => 130,  247 => 128,  243 => 127,  238 => 125,  232 => 124,  227 => 122,  223 => 121,  218 => 119,  214 => 118,  208 => 117,  203 => 115,  198 => 113,  194 => 112,  188 => 111,  182 => 110,  179 => 109,  176 => 108,  173 => 107,  170 => 106,  167 => 105,  164 => 104,  161 => 103,  158 => 102,  155 => 101,  152 => 100,  149 => 99,  146 => 98,  143 => 97,  140 => 96,  137 => 95,  132 => 94,  129 => 93,  126 => 92,  124 => 91,  119 => 90,  113 => 88,  110 => 87,  108 => 86,  105 => 85,  103 => 32,  100 => 31,  96 => 30,  89 => 27,  85 => 26,  78 => 24,  71 => 23,  64 => 22,  59 => 1,  57 => 20,  55 => 7,  53 => 5,  51 => 4,  49 => 3,  47 => 2,  40 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "export/index.html.twig", "/var/www/html/kimai2/templates/export/index.html.twig");
    }
}
