<?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/madeshop/news.twig */
class __TwigTemplate_be84ac2a1d4f4195dea0ccafee1d2febc8a746e53bd9d06abaa3a4c01784dc49 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 class=\"news-block\">
 <div class=\"container\">
 <div class=\"row\"><div class=\"col-sm-6\"><div class=\"h2\">";
        // line 3
        echo ($context["text_title"] ?? null);
        echo "</div><p>";
        echo ($context["text_info"] ?? null);
        echo "</p></div>
  <div class=\"col-sm-6\">
    <form id=\"fnews\">
      <input type=\"email\" pattern=\"[a-zA-Z0-9!#\$%&amp;'*+\\/=?^_`{|}~.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\" value=\"\" name=\"newsemail\" placeholder=\"";
        // line 6
        echo ($context["text_mail"] ?? null);
        echo "\" required id=\"mailnews\"><button id=\"addnews\" type=\"submit\">";
        echo ($context["text_button"] ?? null);
        echo "</button>
    </form>
  </div>
  </div>
  </div>
</div>
<script>   
\$('#fnews').submit(function(e){
e.preventDefault();
var form = this;
\$.ajax({
\t\t\turl: 'index.php?route=madeshop/news/write',
\t\t\ttype: 'post',
\t\t\tdata: \$(this).serialize(),
\t\t\tdataType: 'json',
\t\t\tbeforeSend: function() {
\t\t\t\t\$('#addnews').text('";
        // line 22
        echo ($context["text_load"] ?? null);
        echo "');
\t\t\t},
\t\t\tcomplete: function() {
\t\t\t\t\$('#addnews').text('";
        // line 25
        echo ($context["text_button"] ?? null);
        echo "');
\t\t\t},
\t\t\tsuccess: function(json) {
            if (json['error']){ 
   \t\t\t\talert('";
        // line 29
        echo ($context["text_error"] ?? null);
        echo "');
\t\t\t}
\t\t\t\tif (json['success']) {
\t\t\t\t\tform.reset();
\t\t\t\t\t\$('#fnews').replaceWith('<div class=\"nsuc\"><i class=\"fa fa-envelope\"></i>";
        // line 33
        echo ($context["text_success"] ?? null);
        echo "</div>');
\t\t\t\t}
\t\t\t},
\t\t\terror: function(xhr, ajaxOptions, thrownError) {
\t\t\talert(thrownError + \"\\r\\n\" + xhr.statusText + \"\\r\\n\" + xhr.responseText);
\t\t\t}
\t\t});
\t\t});
</script>";
    }

    public function getTemplateName()
    {
        return "madeshop/template/madeshop/news.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  90 => 33,  83 => 29,  76 => 25,  70 => 22,  49 => 6,  41 => 3,  37 => 1,);
    }

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