<?php

/* mart/template/extension/module/category.twig */
class __TwigTemplate_35289419b3cd37fc01bcbbccdc3828ce2f996ef3a515b268d03068e73e283645 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<div class=\"list-group list-group-category\">
  ";
        // line 2
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["categories"]) ? $context["categories"] : null));
        foreach ($context['_seq'] as $context["_key"] => $context["category"]) {
            // line 3
            echo "  ";
            if (($this->getAttribute($context["category"], "category_id", array()) == (isset($context["category_id"]) ? $context["category_id"] : null))) {
                // line 4
                echo "  <a href=\"";
                echo $this->getAttribute($context["category"], "href", array());
                echo "\" class=\"list-group-item active ripplelink\">";
                echo $this->getAttribute($context["category"], "name", array());
                echo "</a>
  ";
                // line 5
                if ($this->getAttribute($context["category"], "children", array())) {
                    // line 6
                    echo "  ";
                    $context['_parent'] = $context;
                    $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["category"], "children", array()));
                    foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
                        // line 7
                        echo "  ";
                        if (($this->getAttribute($context["child"], "category_id", array()) == (isset($context["child_id"]) ? $context["child_id"] : null))) {
                            // line 8
                            echo "  <a href=\"";
                            echo $this->getAttribute($context["child"], "href", array());
                            echo "\" class=\"sub-list-group-item active ripplelink\">";
                            echo $this->getAttribute($context["child"], "name", array());
                            echo "</a>
  ";
                        } else {
                            // line 10
                            echo "  <a href=\"";
                            echo $this->getAttribute($context["child"], "href", array());
                            echo "\" class=\"sub-list-group-item ripplelink\">";
                            echo $this->getAttribute($context["child"], "name", array());
                            echo "</a>
  ";
                        }
                        // line 12
                        echo "  ";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 13
                    echo "  ";
                }
                // line 14
                echo "  ";
            } else {
                // line 15
                echo "  <a href=\"";
                echo $this->getAttribute($context["category"], "href", array());
                echo "\" class=\"list-group-item ripplelink\">";
                echo $this->getAttribute($context["category"], "name", array());
                echo "</a>
  ";
            }
            // line 17
            echo "  ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['category'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 18
        echo "</div>
<script>
\$(document).ready(function() {
  \$('.category a').each(function() {
    var qty = \$(this).text().match(/\\(([^)]+)\\)/);
    var name = \$(this).text().replace(/\\(\\d+\\)/g, \"\");

    if (qty != null) {
      if (qty[1] === \"0\") {
        qty[1] = \"\";
      }
      badge = name + '<span class=\"badge\">' + qty[1] + '</span>';
      \$(this).html(badge);
    }
  });
});
</script>
";
    }

    public function getTemplateName()
    {
        return "mart/template/extension/module/category.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  88 => 18,  82 => 17,  74 => 15,  71 => 14,  68 => 13,  62 => 12,  54 => 10,  46 => 8,  43 => 7,  38 => 6,  36 => 5,  29 => 4,  26 => 3,  22 => 2,  19 => 1,);
    }
}
/* <div class="list-group list-group-category">*/
/*   {% for category in categories %}*/
/*   {% if category.category_id == category_id %}*/
/*   <a href="{{ category.href }}" class="list-group-item active ripplelink">{{ category.name }}</a>*/
/*   {% if category.children %}*/
/*   {% for child in category.children %}*/
/*   {% if child.category_id == child_id %}*/
/*   <a href="{{ child.href }}" class="sub-list-group-item active ripplelink">{{ child.name }}</a>*/
/*   {% else %}*/
/*   <a href="{{ child.href }}" class="sub-list-group-item ripplelink">{{ child.name }}</a>*/
/*   {% endif %}*/
/*   {% endfor %}*/
/*   {% endif %}*/
/*   {% else %}*/
/*   <a href="{{ category.href }}" class="list-group-item ripplelink">{{ category.name }}</a>*/
/*   {% endif %}*/
/*   {% endfor %}*/
/* </div>*/
/* <script>*/
/* $(document).ready(function() {*/
/*   $('.category a').each(function() {*/
/*     var qty = $(this).text().match(/\(([^)]+)\)/);*/
/*     var name = $(this).text().replace(/\(\d+\)/g, "");*/
/* */
/*     if (qty != null) {*/
/*       if (qty[1] === "0") {*/
/*         qty[1] = "";*/
/*       }*/
/*       badge = name + '<span class="badge">' + qty[1] + '</span>';*/
/*       $(this).html(badge);*/
/*     }*/
/*   });*/
/* });*/
/* </script>*/
/* */
