<?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;
/* TroikaRealEstateBundle:About:news.html.twig */
class __TwigTemplate_f87798f25a6118c515012ae24221cabac49b6f5107942310905f6b908ab6d531 extends \Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'description' => [$this, 'block_description'],
'main' => [$this, 'block_main'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "TroikaRealEstateBundle:Default:layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "TroikaRealEstateBundle:About:news.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "TroikaRealEstateBundle:About:news.html.twig"));
$this->parent = $this->loadTemplate("TroikaRealEstateBundle:Default:layout.html.twig", "TroikaRealEstateBundle:About:news.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 3
public function block_title($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
if ((isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 3, $this->source); })())) {
echo "Новости «Troika Estate» за ";
echo twig_escape_filter($this->env, (isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 3, $this->source); })()), "html", null, true);
echo " год";
} else {
echo "Новости «Troika Estate»";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 4
public function block_description($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "description"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "description"));
if ((isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 4, $this->source); })())) {
echo "Новости на рынке элитной недвижимости за ";
echo twig_escape_filter($this->env, (isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 4, $this->source); })()), "html", null, true);
echo " год";
} else {
echo "Узнать о последних новостях на рынке недвижимости можно легко на сайте. Здесь собраны самые актуальные предложения о строительстве, продаже или аренде недвижимости.";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 6
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 7
echo " <div id=\"content\" class=\"content\">
<div class=\"wrapper news\">
<ul class=\"hb hide__phone hbtmfix\">
<li><a href=\"/\">Элитная недвижимость</a></li>
";
// line 11
if ((isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 11, $this->source); })())) {
// line 12
echo " <li><a href=\"/news/\">Блог</a></li>
<li class=\"current\">";
// line 13
echo twig_escape_filter($this->env, (isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 13, $this->source); })()), "html", null, true);
echo "</li>
";
} else {
// line 15
echo " <li class=\"current\">Блог</li>
";
}
// line 17
echo " </ul>
<h1>Блог ";
// line 18
if ((isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 18, $this->source); })())) {
echo twig_escape_filter($this->env, (isset($context["year"]) || array_key_exists("year", $context) ? $context["year"] : (function () { throw new RuntimeError('Variable "year" does not exist.', 18, $this->source); })()), "html", null, true);
echo " год";
}
echo "</h1>
<div id=\"layout\" class=\"layout layout__column-left\">
<div class=\"layout-column-left\">
<div id=\"btn-delivery\" class=\"btn btn-orange btn__block\" style=\"margin-bottom: 12px\">подписаться</div>
<div class=\"panel panel__white panel__list hide__phone hide__tablet\">
<ul class=\"list__clean fontOpenSans lh24\">
<li><a href=\"/news/2019/\" class=\"link link__underlined\">2019 год</a></li>
<li><a href=\"/news/2020/\" class=\"link link__underlined\">2020 год</a></li>
</ul>
</div>
<div class=\"block hide__phone hide__tablet\">
";
// line 30
echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("TroikaRealEstateBundle:Banner:getBanner", ["banner" => 3]));
echo "
</div>
</div>
<div>
<div class=\"block block-select hide__desktop\">
<select name=\"\" id=\"news-select\">
<option
value=\"all\" ";
// line 37
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 37, $this->source); })()), "request", [], "any", false, false, false, 37), "attributes", [], "any", false, false, false, 37), "get", [0 => "_route"], "method", false, false, false, 37) == "troika_news")) {
echo " selected=\"selected\"";
}
echo ">
Все новости
</option>
<option value=\"2019\" ";
// line 40
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 40, $this->source); })()), "request", [], "any", false, false, false, 40), "attributes", [], "any", false, false, false, 40), "get", [0 => "year"], "method", false, false, false, 40) == "2019")) {
echo " selected=\"selected\"";
}
echo ">
2019
год
</option>
<option value=\"2020\" ";
// line 44
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 44, $this->source); })()), "request", [], "any", false, false, false, 44), "attributes", [], "any", false, false, false, 44), "get", [0 => "year"], "method", false, false, false, 44) == "2020")) {
echo " selected=\"selected\"";
}
echo ">
2020
год
</option>
</select>
</div>
<div class=\"cards cards__list cards__list__news\">
";
// line 52
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 52, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["article"]) {
// line 53
echo " <div class=\"cards-item\">
<div style=\"height: 248px;\" class=\"cards-item-image\">
";
// line 55
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["article"], "photos", [], "any", false, false, false, 55));
foreach ($context['_seq'] as $context["_key"] => $context["photo"]) {
// line 56
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["photo"], "main", [], "any", false, false, false, 56)) {
// line 57
echo " <a style=\"text-decoration:none;\" href=\"/news/";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "slug", [], "any", false, false, false, 57), "html", null, true);
echo "-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "id", [], "any", false, false, false, 57), "html", null, true);
echo "\">
<img src=\"/cache";
// line 58
echo twig_escape_filter($this->env, twig_replace_filter(twig_get_attribute($this->env, $this->source, $context["photo"], "webPathImage", [], "any", false, false, false, 58), ["." => "_720x496."]), "html", null, true);
echo "\" alt=\"\">
</a>
";
}
// line 61
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['photo'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 62
echo " </div>
<div class=\"cards-item-text\">
<h2>";
// line 64
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "name", [], "any", false, false, false, 64), "html", null, true);
echo "</h2>
<!--noindex-->
<span class=\"text\">
";
// line 67
echo twig_get_attribute($this->env, $this->source, $context["article"], "shortText", [], "any", false, false, false, 67);
echo "
</span>
<!--/noindex-->
<p>
<a href=\"/news/";
// line 71
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "slug", [], "any", false, false, false, 71), "html", null, true);
echo "-";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "id", [], "any", false, false, false, 71), "html", null, true);
echo "\" class=\"link orange\"><i
class=\"fa fa-file-text-o\"></i> читать статью полностью ›</a>
<span class=\"gray-dark pull-right small-text font12\">";
// line 73
echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["article"], "date", [], "any", false, false, false, 73), "d.m.Y"), "html", null, true);
echo "</span>
</p>
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['article'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 78
echo " </div>
<div class=\"pages\">
";
// line 80
echo $this->extensions['Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension']->render($this->env, (isset($context["news"]) || array_key_exists("news", $context) ? $context["news"] : (function () { throw new RuntimeError('Variable "news" does not exist.', 80, $this->source); })()));
echo "
</div>
</div>
</div>
</div>
</div>
<div class=\"modal fade\" id=\"deliveryNews\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\" style=\"font-size: 18px; font-weight: 100;\">подписаться на аналитику</h4>
</div>
<div class=\"modal-body\">
<div id=\"newsModalError\" class=\"panel-container error-content ModalError\">
<p></p>
</div>
<div class=\"panel-container__left\">
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"Имя\" id=\"dName\">
<i class=\"fa fa__control fa-user pull-left gray-dark\"></i>
</div>
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"Компания\" id=\"dCompany\">
<i class=\"fa fa__control fa-home pull-left gray-dark\"></i>
</div>
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"E-mail\" id=\"dMail\">
<i class=\"fa fa__control fa-envelope pull-left gray-dark\"></i>
</div>
</div>
</div>
<div class=\"modal-footer\">
<div class=\"btn\" id=\"btn-ok\" style=\"width: 280px;\">подписаться</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
\$('#btn-delivery').on('click', function () {
\$('#deliveryNews').modal();
\$('#deliveryNews h4.modal-title').text('подписаться на новости');
\$('#btn-ok').on('click', function () {
\$('.error').each(function () {
\$(this).removeClass('error');
});
error = 0;
errorText = '';
if (\$.trim(\$('#dName').val()) == '') {
error = 1;
errorText += 'Не заполнено поле \"Имя\" \\n';
\$('#dName').addClass('error');
}
if (\$.trim(\$('#dCompany').val()) == '') {
error = 1;
errorText += 'Не заполнено поле \"Компания\" \\n';
\$('#dCompany').addClass('error');
}
if (!isValidMail(\$('#dMail').val())) {
error = 1;
errorText += 'Не заполнено поле \"E-mail\" \\n';
\$('#dMail').addClass('error');
}
console.log(errorText);
if (error != 1) {
\$('#newsModalError').html('');
\$('#newsModalError').hide();
\$.ajax({
url: '/api/newsClient',
type: 'POST',
data: {
name: \$('#dName').val(),
company: \$('#dCompany').val(),
mail: \$('#dMail').val()
}
}).done(function () {
\$('#deliveryNews').modal('hide');
\$('#questionSuccessModal').modal();
\$('#questionSuccessModal h4.modal-title').text('вы подписаны');
\$('#questionSuccessModal .modal-body').text('Спасибо!');
\$('#quest-close').click(function () {
\$('#questionSuccessModal').modal('hide');
});
\$('#btn-ok').off('click');
});
} else {
\$('#newsModalError').html(errorText);
\$('#newsModalError').html(\$('#newsModalError').html().replace(/\\n/g, '<br/>'));
\$('#newsModalError').show();
}
});
});
</script>
<style>
@media (max-width: 700px) {
.cards.cards__list.cards__list__news .cards-item .cards-item-text p {
text-align: left;
font-size: 12px;
line-height: 18px;
letter-spacing: 0.3px;
}
.cards.cards__list.cards__list__news .cards-item .cards-item-text h4 {
font-size: 18px;
}
}
@media (min-width: 700px) {
.cards.cards__list.cards__list__news .cards-item .cards-item-text p {
text-align: justify;
font-size: 15px;
line-height: 18px;
}
.cards.cards__list.cards__list__news .cards-item .cards-item-text h4 {
font-size: 17px;
}
}
</style>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "TroikaRealEstateBundle:About:news.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 274 => 80, 270 => 78, 259 => 73, 252 => 71, 245 => 67, 239 => 64, 235 => 62, 229 => 61, 223 => 58, 216 => 57, 213 => 56, 209 => 55, 205 => 53, 201 => 52, 188 => 44, 179 => 40, 171 => 37, 161 => 30, 143 => 18, 140 => 17, 136 => 15, 131 => 13, 128 => 12, 126 => 11, 120 => 7, 110 => 6, 85 => 4, 60 => 3, 37 => 1,);
}
public function getSourceContext()
{
return new Source("{% extends 'TroikaRealEstateBundle:Default:layout.html.twig' %}
{% block title %}{% if year %}Новости «Troika Estate» за {{ year }} год{% else %}Новости «Troika Estate»{% endif %}{% endblock %}
{% block description %}{% if year %}Новости на рынке элитной недвижимости за {{ year }} год{% else %}Узнать о последних новостях на рынке недвижимости можно легко на сайте. Здесь собраны самые актуальные предложения о строительстве, продаже или аренде недвижимости.{% endif %}
{% endblock %}
{% block main %}
<div id=\"content\" class=\"content\">
<div class=\"wrapper news\">
<ul class=\"hb hide__phone hbtmfix\">
<li><a href=\"/\">Элитная недвижимость</a></li>
{% if year %}
<li><a href=\"/news/\">Блог</a></li>
<li class=\"current\">{{ year }}</li>
{% else %}
<li class=\"current\">Блог</li>
{% endif %}
</ul>
<h1>Блог {% if year %}{{ year }} год{% endif %}</h1>
<div id=\"layout\" class=\"layout layout__column-left\">
<div class=\"layout-column-left\">
<div id=\"btn-delivery\" class=\"btn btn-orange btn__block\" style=\"margin-bottom: 12px\">подписаться</div>
<div class=\"panel panel__white panel__list hide__phone hide__tablet\">
<ul class=\"list__clean fontOpenSans lh24\">
<li><a href=\"/news/2019/\" class=\"link link__underlined\">2019 год</a></li>
<li><a href=\"/news/2020/\" class=\"link link__underlined\">2020 год</a></li>
</ul>
</div>
<div class=\"block hide__phone hide__tablet\">
{{ render(controller('TroikaRealEstateBundle:Banner:getBanner', { 'banner': 3 })) }}
</div>
</div>
<div>
<div class=\"block block-select hide__desktop\">
<select name=\"\" id=\"news-select\">
<option
value=\"all\" {% if app.request.attributes.get('_route') == \"troika_news\" %} selected=\"selected\"{% endif %}>
Все новости
</option>
<option value=\"2019\" {% if app.request.attributes.get('year') == \"2019\" %} selected=\"selected\"{% endif %}>
2019
год
</option>
<option value=\"2020\" {% if app.request.attributes.get('year') == \"2020\" %} selected=\"selected\"{% endif %}>
2020
год
</option>
</select>
</div>
<div class=\"cards cards__list cards__list__news\">
{% for article in news %}
<div class=\"cards-item\">
<div style=\"height: 248px;\" class=\"cards-item-image\">
{% for photo in article.photos %}
{% if photo.main %}
<a style=\"text-decoration:none;\" href=\"/news/{{ article.slug }}-{{ article.id }}\">
<img src=\"/cache{{ photo.webPathImage|replace({\".\" : \"_720x496.\"}) }}\" alt=\"\">
</a>
{% endif %}
{% endfor %}
</div>
<div class=\"cards-item-text\">
<h2>{{ article.name }}</h2>
<!--noindex-->
<span class=\"text\">
{{ article.shortText | raw }}
</span>
<!--/noindex-->
<p>
<a href=\"/news/{{ article.slug }}-{{ article.id }}\" class=\"link orange\"><i
class=\"fa fa-file-text-o\"></i> читать статью полностью ›</a>
<span class=\"gray-dark pull-right small-text font12\">{{ article.date | date(\"d.m.Y\") }}</span>
</p>
</div>
</div>
{% endfor %}
</div>
<div class=\"pages\">
{{ knp_pagination_render(news) }}
</div>
</div>
</div>
</div>
</div>
<div class=\"modal fade\" id=\"deliveryNews\">
<div class=\"modal-dialog\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\" style=\"font-size: 18px; font-weight: 100;\">подписаться на аналитику</h4>
</div>
<div class=\"modal-body\">
<div id=\"newsModalError\" class=\"panel-container error-content ModalError\">
<p></p>
</div>
<div class=\"panel-container__left\">
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"Имя\" id=\"dName\">
<i class=\"fa fa__control fa-user pull-left gray-dark\"></i>
</div>
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"Компания\" id=\"dCompany\">
<i class=\"fa fa__control fa-home pull-left gray-dark\"></i>
</div>
<div class=\"panel-container modal-panel\">
<input type=\"text\" class=\"control control__icon-before\" placeholder=\"E-mail\" id=\"dMail\">
<i class=\"fa fa__control fa-envelope pull-left gray-dark\"></i>
</div>
</div>
</div>
<div class=\"modal-footer\">
<div class=\"btn\" id=\"btn-ok\" style=\"width: 280px;\">подписаться</div>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script>
\$('#btn-delivery').on('click', function () {
\$('#deliveryNews').modal();
\$('#deliveryNews h4.modal-title').text('подписаться на новости');
\$('#btn-ok').on('click', function () {
\$('.error').each(function () {
\$(this).removeClass('error');
});
error = 0;
errorText = '';
if (\$.trim(\$('#dName').val()) == '') {
error = 1;
errorText += 'Не заполнено поле \"Имя\" \\n';
\$('#dName').addClass('error');
}
if (\$.trim(\$('#dCompany').val()) == '') {
error = 1;
errorText += 'Не заполнено поле \"Компания\" \\n';
\$('#dCompany').addClass('error');
}
if (!isValidMail(\$('#dMail').val())) {
error = 1;
errorText += 'Не заполнено поле \"E-mail\" \\n';
\$('#dMail').addClass('error');
}
console.log(errorText);
if (error != 1) {
\$('#newsModalError').html('');
\$('#newsModalError').hide();
\$.ajax({
url: '/api/newsClient',
type: 'POST',
data: {
name: \$('#dName').val(),
company: \$('#dCompany').val(),
mail: \$('#dMail').val()
}
}).done(function () {
\$('#deliveryNews').modal('hide');
\$('#questionSuccessModal').modal();
\$('#questionSuccessModal h4.modal-title').text('вы подписаны');
\$('#questionSuccessModal .modal-body').text('Спасибо!');
\$('#quest-close').click(function () {
\$('#questionSuccessModal').modal('hide');
});
\$('#btn-ok').off('click');
});
} else {
\$('#newsModalError').html(errorText);
\$('#newsModalError').html(\$('#newsModalError').html().replace(/\\n/g, '<br/>'));
\$('#newsModalError').show();
}
});
});
</script>
<style>
@media (max-width: 700px) {
.cards.cards__list.cards__list__news .cards-item .cards-item-text p {
text-align: left;
font-size: 12px;
line-height: 18px;
letter-spacing: 0.3px;
}
.cards.cards__list.cards__list__news .cards-item .cards-item-text h4 {
font-size: 18px;
}
}
@media (min-width: 700px) {
.cards.cards__list.cards__list__news .cards-item .cards-item-text p {
text-align: justify;
font-size: 15px;
line-height: 18px;
}
.cards.cards__list.cards__list__news .cards-item .cards-item-text h4 {
font-size: 17px;
}
}
</style>
{% endblock %}", "TroikaRealEstateBundle:About:news.html.twig", "/home/troikaestate/public_html/src/Troika/RealEstateBundle/Resources/views/About/news.html.twig");
}
}