<?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;

/* timesheet/actions.html.twig */
class __TwigTemplate_397d82dba263d6f3834e90cfae7873f444df27330fabc80874156a39b7e3ac08 extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 27
        echo "
";
        // line 75
        echo "
";
    }

    // line 1
    public function macro_timesheets($__view__ = null, ...$__varargs__)
    {
        $macros = $this->macros;
        $context = $this->env->mergeGlobals([
            "view" => $__view__,
            "varargs" => $__varargs__,
        ]);

        $blocks = [];

        ob_start(function () { return ''; });
        try {
            // line 2
            echo "    ";
            $macros["widgets"] = $this->loadTemplate("macros/widgets.html.twig", "timesheet/actions.html.twig", 2)->unwrap();
            // line 3
            echo "
    ";
            // line 4
            $context["actions"] = ["search" => ["class" => "search-toggle visible-xs-inline"]];
            // line 5
            echo "    ";
            if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("export_own_timesheet")) {
                // line 6
                echo "        ";
                $context["exporterIds"] = $this->extensions['App\Twig\TimesheetExtension']->getTimesheetExporter();
                // line 7
                echo "        ";
                if (0 === twig_compare(twig_length_filter($this->env, ($context["exporterIds"] ?? null)), 1)) {
                    // line 8
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["download" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet_export", ["exporter" => twig_get_attribute($this->env, $this->source, ($context["exporterIds"] ?? null), 0, [], "any", false, false, false, 8)]), "class" => "toolbar-action"]]);
                    // line 9
                    echo "        ";
                } elseif (1 === twig_compare(twig_length_filter($this->env, ($context["exporterIds"] ?? null)), 1)) {
                    // line 10
                    echo "            ";
                    $context["children"] = [];
                    // line 11
                    echo "            ";
                    $context['_parent'] = $context;
                    $context['_seq'] = twig_ensure_traversable(($context["exporterIds"] ?? null));
                    foreach ($context['_seq'] as $context["_key"] => $context["exporter"]) {
                        // line 12
                        echo "                ";
                        $context["children"] = twig_array_merge(($context["children"] ?? null), [$context["exporter"] => ["title" => $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans(("button." . $context["exporter"])), "url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet_export", ["exporter" => $context["exporter"]]), "class" => ("toolbar-action exporter-" . $context["exporter"])]]);
                        // line 13
                        echo "            ";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['_key'], $context['exporter'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 14
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["download" => ["children" => ($context["children"] ?? null)]]);
                    // line 15
                    echo "        ";
                }
                // line 16
                echo "    ";
            }
            // line 17
            echo "    ";
            $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["visibility" => ["modal" => "#modal_timesheet"]]);
            // line 18
            echo "    ";
            if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("create_own_timesheet")) {
                // line 19
                echo "        ";
                $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["create" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet_create"), "class" => "modal-ajax-form"]]);
                // line 20
                echo "    ";
            }
            // line 21
            echo "
    ";
            // line 22
            $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["help" => ["url" => $this->extensions['App\Twig\Extensions']->documentationLink("timesheet.html"), "target" => "_blank"]]);
            // line 23
            echo "
    ";
            // line 24
            $context["event"] = $this->env->getRuntime('App\Twig\Runtime\ThemeEventExtension')->trigger("actions.timesheets", ["actions" => ($context["actions"] ?? null), "view" => ($context["view"] ?? null)]);
            // line 25
            echo "    ";
            echo twig_call_macro($macros["widgets"], "macro_page_actions", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["event"] ?? null), "payload", [], "any", false, false, false, 25), "actions", [], "any", false, false, false, 25)], 25, $context, $this->getSourceContext());
            echo "
";

            return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
        } finally {
            ob_end_clean();
        }
    }

    // line 28
    public function macro_timesheet($__timesheet__ = null, $__view__ = null, $__options__ = null, ...$__varargs__)
    {
        $macros = $this->macros;
        $context = $this->env->mergeGlobals([
            "timesheet" => $__timesheet__,
            "view" => $__view__,
            "options" => $__options__,
            "varargs" => $__varargs__,
        ]);

        $blocks = [];

        ob_start(function () { return ''; });
        try {
            // line 29
            ob_start(function () { return ''; });
            // line 30
            $macros["widgets"] = $this->loadTemplate("macros/widgets.html.twig", "timesheet/actions.html.twig", 30)->unwrap();
            // line 31
            echo "    ";
            $context["actions"] = [];
            // line 32
            echo "
    ";
            // line 33
            if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 33))) {
                // line 34
                echo "        ";
                if (( !twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "end", [], "any", false, false, false, 34) && $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("stop", ($context["timesheet"] ?? null)))) {
                    // line 35
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["stop" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("stop_timesheet", ["id" => twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 35)]), "class" => "api-link", "attr" => ["data-event" => "kimai.timesheetStop kimai.timesheetUpdate", "data-method" => "PATCH", "data-msg-error" => "timesheet.stop.error", "data-msg-success" => "timesheet.stop.success"]]]);
                    // line 36
                    echo "        ";
                }
                // line 37
                echo "
        ";
                // line 38
                if ((twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "end", [], "any", false, false, false, 38) && $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("start", ($context["timesheet"] ?? null)))) {
                    // line 39
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["repeat" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("restart_timesheet", ["id" => twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 39)]), "class" => "api-link", "attr" => ["data-payload" => "{\"copy\": \"all\"}", "data-event" => "kimai.timesheetStart kimai.timesheetUpdate", "data-method" => "PATCH", "data-msg-error" => "timesheet.start.error", "data-msg-success" => "timesheet.start.success"]]]);
                    // line 40
                    echo "        ";
                }
                // line 41
                echo "
        ";
                // line 42
                if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("duplicate", ($context["timesheet"] ?? null))) {
                    // line 43
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["copy" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("duplicate_timesheet", ["id" => twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 43)]), "class" => "api-link", "attr" => ["data-payload" => "{\"copy\": \"all\"}", "data-event" => "kimai.timesheetStart kimai.timesheetUpdate", "data-method" => "PATCH", "data-msg-error" => "action.update.error", "data-msg-success" => "action.update.success"]]]);
                    // line 44
                    echo "        ";
                }
                // line 45
                echo "
        ";
                // line 46
                if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("edit", ($context["timesheet"] ?? null))) {
                    // line 47
                    echo "            ";
                    $context["class"] = "";
                    // line 48
                    echo "            ";
                    if (0 !== twig_compare(($context["view"] ?? null), "edit")) {
                        // line 49
                        echo "                ";
                        $context["class"] = "modal-ajax-form";
                        // line 50
                        echo "            ";
                    }
                    // line 51
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["edit" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet_edit", ["id" => twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 51)]), "class" => ($context["class"] ?? null)]]);
                    // line 52
                    echo "        ";
                }
                // line 53
                echo "
        ";
                // line 54
                if (1 === twig_compare(twig_length_filter($this->env, ($context["actions"] ?? null)), 0)) {
                    // line 55
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["divider" => null]);
                    // line 56
                    echo "        ";
                }
                // line 57
                echo "
        ";
                // line 58
                if ((0 === twig_compare(($context["view"] ?? null), "index") && $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("delete", ($context["timesheet"] ?? null)))) {
                    // line 59
                    echo "            ";
                    $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["trash" => ["url" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("delete_timesheet", ["id" => twig_get_attribute($this->env, $this->source, ($context["timesheet"] ?? null), "id", [], "any", false, false, false, 59)]), "class" => "api-link", "attr" => ["data-event" => "kimai.timesheetDelete kimai.timesheetUpdate", "data-method" => "DELETE", "data-question" => "confirm.delete", "data-msg-error" => "action.delete.error", "data-msg-success" => "action.delete.success"]]]);
                    // line 60
                    echo "        ";
                }
                // line 61
                echo "    ";
            }
            // line 62
            echo "
    ";
            // line 63
            if (0 !== twig_compare(($context["view"] ?? null), "index")) {
                // line 64
                echo "        ";
                $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["back" => ((twig_get_attribute($this->env, $this->source, ($context["options"] ?? null), "back", [], "any", true, true, false, 64)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["options"] ?? null), "back", [], "any", false, false, false, 64), $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet"))) : ($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet")))]);
                // line 65
                echo "    ";
            }
            // line 66
            echo "
    ";
            // line 67
            $context["event"] = $this->env->getRuntime('App\Twig\Runtime\ThemeEventExtension')->trigger("actions.timesheet", ["actions" => ($context["actions"] ?? null), "view" => ($context["view"] ?? null), "timesheet" => ($context["timesheet"] ?? null)]);
            // line 68
            echo "    ";
            if (0 === twig_compare(($context["view"] ?? null), "index")) {
                // line 69
                echo "        ";
                echo twig_call_macro($macros["widgets"], "macro_table_actions", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["event"] ?? null), "payload", [], "any", false, false, false, 69), "actions", [], "any", false, false, false, 69)], 69, $context, $this->getSourceContext());
                echo "
    ";
            } else {
                // line 71
                echo "        ";
                echo twig_call_macro($macros["widgets"], "macro_entity_actions", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["event"] ?? null), "payload", [], "any", false, false, false, 71), "actions", [], "any", false, false, false, 71)], 71, $context, $this->getSourceContext());
                echo "
    ";
            }
            $___internal_428d406ef4c538f3776dcad6b85b67bac8a2c05b6f5e6755eabcf2f2fa74296a_ = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
            // line 29
            echo twig_spaceless($___internal_428d406ef4c538f3776dcad6b85b67bac8a2c05b6f5e6755eabcf2f2fa74296a_);

            return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
        } finally {
            ob_end_clean();
        }
    }

    // line 76
    public function macro_timesheets_multi_update($__view__ = null, ...$__varargs__)
    {
        $macros = $this->macros;
        $context = $this->env->mergeGlobals([
            "view" => $__view__,
            "varargs" => $__varargs__,
        ]);

        $blocks = [];

        ob_start(function () { return ''; });
        try {
            // line 77
            echo "    ";
            $macros["widgets"] = $this->loadTemplate("macros/widgets.html.twig", "timesheet/actions.html.twig", 77)->unwrap();
            // line 78
            echo "
    ";
            // line 79
            $context["actions"] = [];
            // line 80
            echo "    ";
            $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["back" => $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("timesheet")]);
            // line 81
            echo "    ";
            $context["actions"] = twig_array_merge(($context["actions"] ?? null), ["help" => ["url" => $this->extensions['App\Twig\Extensions']->documentationLink("timesheet.html"), "target" => "_blank"]]);
            // line 82
            echo "
    ";
            // line 83
            $context["event"] = $this->env->getRuntime('App\Twig\Runtime\ThemeEventExtension')->trigger("actions.timesheets_multi_update", ["actions" => ($context["actions"] ?? null), "view" => ($context["view"] ?? null)]);
            // line 84
            echo "    ";
            echo twig_call_macro($macros["widgets"], "macro_page_actions", [twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["event"] ?? null), "payload", [], "any", false, false, false, 84), "actions", [], "any", false, false, false, 84)], 84, $context, $this->getSourceContext());
            echo "
";

            return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
        } finally {
            ob_end_clean();
        }
    }

    public function getTemplateName()
    {
        return "timesheet/actions.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  320 => 84,  318 => 83,  315 => 82,  312 => 81,  309 => 80,  307 => 79,  304 => 78,  301 => 77,  288 => 76,  279 => 29,  272 => 71,  266 => 69,  263 => 68,  261 => 67,  258 => 66,  255 => 65,  252 => 64,  250 => 63,  247 => 62,  244 => 61,  241 => 60,  238 => 59,  236 => 58,  233 => 57,  230 => 56,  227 => 55,  225 => 54,  222 => 53,  219 => 52,  216 => 51,  213 => 50,  210 => 49,  207 => 48,  204 => 47,  202 => 46,  199 => 45,  196 => 44,  193 => 43,  191 => 42,  188 => 41,  185 => 40,  182 => 39,  180 => 38,  177 => 37,  174 => 36,  171 => 35,  168 => 34,  166 => 33,  163 => 32,  160 => 31,  158 => 30,  156 => 29,  141 => 28,  129 => 25,  127 => 24,  124 => 23,  122 => 22,  119 => 21,  116 => 20,  113 => 19,  110 => 18,  107 => 17,  104 => 16,  101 => 15,  98 => 14,  92 => 13,  89 => 12,  84 => 11,  81 => 10,  78 => 9,  75 => 8,  72 => 7,  69 => 6,  66 => 5,  64 => 4,  61 => 3,  58 => 2,  45 => 1,  40 => 75,  37 => 27,);
    }

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