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

/* madeshop/template/extension/module/madeshop_review.twig */
class __TwigTemplate_86aff503d08bdfc5af4ef3bd6d4007dbc28010e3a628b1d4ce0c0c5d18cd38c5 extends \Twig\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 1
        echo "<div id=\"madeshop-review\" class=\"module\">
  <h3>";
        // line 2
        echo ($context["title"] ?? null);
        echo "</h3>
  ";
        // line 3
        if (($context["reviews"] ?? null)) {
            // line 4
            echo "  <a href=\"";
            echo ($context["link"] ?? null);
            echo "\" class=\"bann-btn small cathref\"><span>";
            echo ($context["text_all"] ?? null);
            echo "</span><i class=\"fa fa-caret-right\"></i></a>
  <div class=\"row-rev animate animate-op\">
    <div class=\"slick-rev\">
      ";
            // line 7
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable(($context["reviews"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["review"]) {
                // line 8
                echo "      <div class=\"review-block rev";
                echo twig_get_attribute($this->env, $this->source, $context["review"], "mreview_id", [], "any", false, false, false, 8);
                echo "\">
        <div class=\"rev-info\">
\t\t  <ul class=\"list-unstyled\">
\t\t  ";
                // line 11
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable(range(1, 5));
                foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                    // line 12
                    echo "\t\t  ";
                    if ((twig_get_attribute($this->env, $this->source, $context["review"], "rating", [], "any", false, false, false, 12) < $context["i"])) {
                        // line 13
                        echo "\t\t  <li class=\"nocheck\"></li>
\t\t  ";
                    } else {
                        // line 15
                        echo "\t\t  <li class=\"\"></li>
\t\t  ";
                    }
                    // line 17
                    echo "\t\t  ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 18
                echo "\t\t  </ul>
\t      <div class=\"rev-autor\">";
                // line 19
                echo twig_get_attribute($this->env, $this->source, $context["review"], "author", [], "any", false, false, false, 19);
                echo "</div>
\t    </div>
        <div>
\t      <p>";
                // line 22
                echo twig_get_attribute($this->env, $this->source, $context["review"], "text", [], "any", false, false, false, 22);
                echo "</p>
\t      <div class=\"over\">
\t        <div class=\"pull-left rev-data\">";
                // line 24
                echo twig_get_attribute($this->env, $this->source, $context["review"], "date_added", [], "any", false, false, false, 24);
                echo "</div>
\t        <div class=\"pull-right\">
\t          <div class=\"r-vote\">
                <div class=\"block-plus\" onclick=\"vote('";
                // line 27
                echo twig_get_attribute($this->env, $this->source, $context["review"], "mreview_id", [], "any", false, false, false, 27);
                echo "','like');\"><i class=\"fa fa-thumbs-up\"></i><div class=\"r-num like\">";
                echo twig_get_attribute($this->env, $this->source, $context["review"], "yes", [], "any", false, false, false, 27);
                echo "</div></div>
                <div class=\"block-minus\" onclick=\"vote('";
                // line 28
                echo twig_get_attribute($this->env, $this->source, $context["review"], "mreview_id", [], "any", false, false, false, 28);
                echo "','unlike');\"><i class=\"fa fa-thumbs-down\"></i><div class=\"r-num unlike\">";
                echo twig_get_attribute($this->env, $this->source, $context["review"], "unlike", [], "any", false, false, false, 28);
                echo "</div></div>
              </div>
\t        </div>
\t      </div>

        </div>
       </div>
      ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['review'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 36
            echo "    </div>
  </div>
  <script type=\"text/javascript\"><!--
\$(document).ready(function(\$) {
\$('.slick-rev').slick({
 \t    infinite: true,
 \t    slidesToShow: 3,
        nextArrow: '<i class=\"slick-arrow arrow-right fa fa-caret-right\"></i>',
        prevArrow: '<i class=\"slick-arrow arrow-left fa fa-caret-left\"></i>',
        responsive: [
    {
      breakpoint: 1200,
      settings: {
        slidesToShow: 2,
      }
    },

    {
      breakpoint: 767,
      settings: {
        slidesToShow: 1,
      }
    }

  ]
});
});
--></script>
  ";
        } else {
            // line 65
            echo "  <div class=\"empty\">";
            echo ($context["text_no_reviews"] ?? null);
            echo "</div>
  ";
        }
        // line 66
        echo " 
</div>
";
        // line 68
        if (($context["review_status"] ?? null)) {
            // line 69
            if (($context["review_guest"] ?? null)) {
                // line 70
                echo "<div class=\"panel-url border-btn\" data-spanel=\"#review-panel\">";
                echo ($context["text_write"] ?? null);
                echo "</div>
";
            } else {
                // line 72
                echo "<div class=\"rev-guest border-btn\">";
                echo ($context["text_write"] ?? null);
                echo "</div>
";
            }
            // line 73
            echo " 

";
        }
        // line 75
        echo " 

<div id=\"review-panel\" class=\"spanel\">
<div class=\"close-panel\"><div class=\"container\"><i class=\"fa fa-arrow-up\"></i>";
        // line 78
        echo ($context["text_close"] ?? null);
        echo "</div></div>
\t  <div class=\"container\">
\t    <div class=\"table\">
\t\t  <div class=\"table-cell\">
\t\t\t<div class=\"w65\">
\t\t\t<form class=\"form-horizontal\" id=\"freview\">
\t\t\t  <div class=\"form-group required\">
\t\t\t\t<div class=\"col-sm-12\">
\t\t\t\t  <input type=\"text\" name=\"name\" value=\"";
        // line 86
        echo ($context["customer_name"] ?? null);
        echo "\" placeholder=\"";
        echo ($context["entry_name"] ?? null);
        echo "\" id=\"input-name\" class=\"form-control no-border\" />
\t\t\t\t </div>
\t\t\t  </div>
\t\t\t  <div class=\"form-group required\">
\t\t\t\t<div class=\"col-sm-12\">
\t\t\t\t  <textarea name=\"text\" rows=\"1\" placeholder=\"";
        // line 91
        echo ($context["entry_review"] ?? null);
        echo "\" id=\"input-review\" class=\"form-control no-border\" onkeyup=\"textarea_resize(event)\"></textarea>
\t\t\t\t</div>
\t\t\t  </div>
\t\t\t  <div class=\"form-group\">
\t\t\t\t<div class=\"col-sm-6\">";
        // line 95
        echo ($context["entry_rating"] ?? null);
        echo "</div>
\t\t\t\t  <div class=\"col-sm-6\">
\t\t\t\t\t<div class=\"rate\">
\t\t\t\t\t<input type=\"radio\" id=\"star5\" name=\"rating\" value=\"5\">
\t\t\t\t\t<label for=\"star5\" title=\"5\"></label>
\t\t\t\t\t<input type=\"radio\" id=\"star4\" name=\"rating\" value=\"4\">
\t\t\t\t\t<label for=\"star4\" title=\"4\"></label>
\t\t\t\t\t<input type=\"radio\" id=\"star3\" name=\"rating\" value=\"3\">
\t\t\t\t\t<label for=\"star3\" title=\"3\"></label>
\t\t\t\t\t<input type=\"radio\" id=\"star2\" name=\"rating\" value=\"2\">
\t\t\t\t\t<label for=\"star2\" title=\"2\"></label>
\t\t\t\t\t<input type=\"radio\" id=\"star1\" name=\"rating\" value=\"1\">
\t\t\t\t\t<label for=\"star1\" title=\"1\"></label>
\t\t\t\t\t</div>
\t\t\t\t  </div>
\t\t\t\t</div>
\t\t\t\t<div class=\"buttons clearfix\">
\t\t\t      <button type=\"submit\" id=\"button-review\" data-loading-text=\"";
        // line 112
        echo ($context["text_loading"] ?? null);
        echo "\" class=\"btn made-btn\">
\t\t\t\t\t";
        // line 113
        echo ($context["button_continue"] ?? null);
        echo "
\t\t\t\t  </button>
\t\t\t\t</div>
\t\t\t</form>
\t\t\t</div>
\t\t  </div>
\t\t</div>
\t  </div>
</div>
<script type=\"text/javascript\"><!--
\$('#freview').submit(function(e){
    e.preventDefault();var form = this;
\t\$.ajax({
\t\turl: 'index.php?route=extension/module/madeshop_review/write',
\t\ttype: 'post',
\t\tdataType: 'json',
\t\tdata: \$(\"#freview\").serialize(),
\t\tbeforeSend: function() {
\t\t\t\$('#button-review').button('loading');
\t\t},
\t\tcomplete: function() {
\t\t\t\$('#button-review').button('reset');
\t\t},
\t\tsuccess: function(json) {
\t\t\t\$('.alert-success, .alert-danger').remove();

\t\t\tif (json['error']) {
\t\t\t    alert(json['error']);
\t\t\t}

\t\t\tif (json['success']) {
\t\t\t\t\$('#freview').slideUp();
\t\t\t\t\$('#review-panel .w65').append('<div class=\"text-center a-success\">";
        // line 145
        echo ($context["text_success"] ?? null);
        echo "</div>');

\t\t\t\t\$('input[name=\\'name\\']').val('');
\t\t\t\t\$('textarea[name=\\'text\\']').val('');
\t\t\t\t\$('input[name=\\'rating\\']:checked').prop('checked', false);
\t\t\t\t setTimeout(function () {
\t\t\t\t\t\$('body').click();\t
\t\t\t\t}, 3000);
\t\t\t}
\t\t}
\t});
});
\t\t
function vote(id,type){
\t\$.post('index.php?route=extension/module/madeshop_review/vote', {id:id, type:type}, function(data){\t\t
\t\tvar vol = parseInt(\$('.rev'+id+':not(.slick-cloned) .'+type).text());
\t\tif(data){
\t\t    \$('.rev'+id+' .'+type).text(vol+1);\t\t  
\t\t} else {
\t\t    alert('";
        // line 164
        echo ($context["text_ready"] ?? null);
        echo "');\t
\t\t}\t
\t});
}

--></script>";
    }

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

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  305 => 164,  283 => 145,  248 => 113,  244 => 112,  224 => 95,  217 => 91,  207 => 86,  196 => 78,  191 => 75,  186 => 73,  180 => 72,  174 => 70,  172 => 69,  170 => 68,  166 => 66,  160 => 65,  129 => 36,  113 => 28,  107 => 27,  101 => 24,  96 => 22,  90 => 19,  87 => 18,  81 => 17,  77 => 15,  73 => 13,  70 => 12,  66 => 11,  59 => 8,  55 => 7,  46 => 4,  44 => 3,  40 => 2,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "madeshop/template/extension/module/madeshop_review.twig", "");
    }
}
