File: D:/web/matomo.circ/tmp/templates_c/80/8054e260c31ee2c2b1be4c3266e0b417.php
<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;
/* @CoreVisualizations/_dataTableViz_htmlTable_comparisons.twig */
class __TwigTemplate_92344c282b0c5591c29f70c3d866c798 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 1
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 1, $this->source); })()), "columns_to_display", [], "any", false, false, false, 1))) {
// line 2
$context["lastSeenComparePeriod"] = false;
// line 3
$context["comparedPeriodPretty"] = CoreExtension::getAttribute($this->env, $this->source, Twig\Extension\CoreExtension::last($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["dataTable"]) || array_key_exists("dataTable", $context) ? $context["dataTable"] : (function () { throw new RuntimeError('Variable "dataTable" does not exist.', 3, $this->source); })()), "getRows", [], "method", false, false, false, 3)), "getMetadata", ["comparePeriodPretty"], "method", false, false, false, 3);
// line 4
$context["isComparingSegments"] = (Twig\Extension\CoreExtension::length($this->env->getCharset(), ((CoreExtension::getAttribute($this->env, $this->source, ($context["rootDataTable"] ?? null), "getMetadata", ["compareSegments"], "method", true, true, false, 4)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["rootDataTable"] ?? null), "getMetadata", ["compareSegments"], "method", false, false, false, 4), [])) : ([]))) > 1);
// line 5
$context["isComparingPeriods"] = (Twig\Extension\CoreExtension::length($this->env->getCharset(), ((CoreExtension::getAttribute($this->env, $this->source, ($context["rootDataTable"] ?? null), "getMetadata", ["comparePeriods"], "method", true, true, false, 5)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, ($context["rootDataTable"] ?? null), "getMetadata", ["comparePeriods"], "method", false, false, false, 5), [])) : ([]))) > 1);
// line 6
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["dataTable"]) || array_key_exists("dataTable", $context) ? $context["dataTable"] : (function () { throw new RuntimeError('Variable "dataTable" does not exist.', 6, $this->source); })()), "getRows", [], "method", false, false, false, 6));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["rowId"] => $context["row"]) {
// line 7
$context["comparePeriod"] = CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["comparePeriodPretty"], "method", false, false, false, 7);
// line 8
yield " ";
if (((((isset($context["lastSeenComparePeriod"]) || array_key_exists("lastSeenComparePeriod", $context) ? $context["lastSeenComparePeriod"] : (function () { throw new RuntimeError('Variable "lastSeenComparePeriod" does not exist.', 8, $this->source); })()) != (isset($context["comparePeriod"]) || array_key_exists("comparePeriod", $context) ? $context["comparePeriod"] : (function () { throw new RuntimeError('Variable "comparePeriod" does not exist.', 8, $this->source); })())) && (isset($context["isComparingSegments"]) || array_key_exists("isComparingSegments", $context) ? $context["isComparingSegments"] : (function () { throw new RuntimeError('Variable "isComparingSegments" does not exist.', 8, $this->source); })())) && (isset($context["isComparingPeriods"]) || array_key_exists("isComparingPeriods", $context) ? $context["isComparingPeriods"] : (function () { throw new RuntimeError('Variable "isComparingPeriods" does not exist.', 8, $this->source); })()))) {
// line 9
yield " <tr class=\"comparePeriod\">
<td class=\"label\">
";
// line 11
yield \Piwik\piwik_escape_filter($this->env, (isset($context["comparePeriod"]) || array_key_exists("comparePeriod", $context) ? $context["comparePeriod"] : (function () { throw new RuntimeError('Variable "comparePeriod" does not exist.', 11, $this->source); })()), "html", null, true);
yield "
</td>
";
// line 15
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 15, $this->source); })()), "columns_to_display", [], "any", false, false, false, 15));
foreach ($context['_seq'] as $context["_key"] => $context["column"]) {
// line 16
yield " ";
if (($context["column"] != "label")) {
// line 17
yield " <td class=\"column\"> </td>
";
}
// line 19
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['column'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 20
yield " </tr>
";
}
// line 22
yield " ";
$context["overrideParams"] = [];
// line 23
yield "
";
// line 24
if ( !Twig\Extension\CoreExtension::testEmpty(((CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareSegment"], "method", true, true, false, 24)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareSegment"], "method", false, false, false, 24))) : ("")))) {
$context["overrideParams"] = Twig\Extension\CoreExtension::merge((isset($context["overrideParams"]) || array_key_exists("overrideParams", $context) ? $context["overrideParams"] : (function () { throw new RuntimeError('Variable "overrideParams" does not exist.', 24, $this->source); })()), ["segment" => CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareSegment"], "method", false, false, false, 24), "compareSegments" => ""]);
}
// line 25
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(((CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["comparePeriod"], "method", true, true, false, 25)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["comparePeriod"], "method", false, false, false, 25))) : ("")))) {
$context["overrideParams"] = Twig\Extension\CoreExtension::merge((isset($context["overrideParams"]) || array_key_exists("overrideParams", $context) ? $context["overrideParams"] : (function () { throw new RuntimeError('Variable "overrideParams" does not exist.', 25, $this->source); })()), ["period" => CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["comparePeriod"], "method", false, false, false, 25), "comparePeriods" => ""]);
}
// line 26
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(((CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareDate"], "method", true, true, false, 26)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareDate"], "method", false, false, false, 26))) : ("")))) {
$context["overrideParams"] = Twig\Extension\CoreExtension::merge((isset($context["overrideParams"]) || array_key_exists("overrideParams", $context) ? $context["overrideParams"] : (function () { throw new RuntimeError('Variable "overrideParams" does not exist.', 26, $this->source); })()), ["date" => CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareDate"], "method", false, false, false, 26), "compareDates" => ""]);
}
// line 27
yield " ";
$context["idSubtable"] = CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["idsubdatatable"], "method", false, false, false, 27);
// line 28
yield " ";
$context["seriesIndex"] = CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 28);
// line 29
yield " <tr
";
// line 30
if (((isset($context["idSubtable"]) || array_key_exists("idSubtable", $context) ? $context["idSubtable"] : (function () { throw new RuntimeError('Variable "idSubtable" does not exist.', 30, $this->source); })()) != false)) {
yield "data-idsubtable=\"";
yield \Piwik\piwik_escape_filter($this->env, (isset($context["idSubtable"]) || array_key_exists("idSubtable", $context) ? $context["idSubtable"] : (function () { throw new RuntimeError('Variable "idSubtable" does not exist.', 30, $this->source); })()), "html_attr");
yield "\"";
}
// line 31
yield " data-comparison-series=\"";
yield \Piwik\piwik_escape_filter($this->env, (isset($context["seriesIndex"]) || array_key_exists("seriesIndex", $context) ? $context["seriesIndex"] : (function () { throw new RuntimeError('Variable "seriesIndex" does not exist.', 31, $this->source); })()), "html", null, true);
yield "\"
class=\"comparisonRow\"
data-param-override=\"";
// line 33
yield \Piwik\piwik_escape_filter($this->env, json_encode((isset($context["overrideParams"]) || array_key_exists("overrideParams", $context) ? $context["overrideParams"] : (function () { throw new RuntimeError('Variable "overrideParams" does not exist.', 33, $this->source); })())), "html_attr");
yield "\"
data-label=\"";
// line 34
yield \Piwik\piwik_escape_filter($this->env, ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["comparedRow"]) || array_key_exists("comparedRow", $context) ? $context["comparedRow"] : (function () { throw new RuntimeError('Variable "comparedRow" does not exist.', 34, $this->source); })()), "getColumn", [(isset($context["rowIdentifier"]) || array_key_exists("rowIdentifier", $context) ? $context["rowIdentifier"] : (function () { throw new RuntimeError('Variable "rowIdentifier" does not exist.', 34, $this->source); })())], "method", false, false, false, 34)) ? (CoreExtension::getAttribute($this->env, $this->source, (isset($context["comparedRow"]) || array_key_exists("comparedRow", $context) ? $context["comparedRow"] : (function () { throw new RuntimeError('Variable "comparedRow" does not exist.', 34, $this->source); })()), "getColumn", [(isset($context["rowIdentifier"]) || array_key_exists("rowIdentifier", $context) ? $context["rowIdentifier"] : (function () { throw new RuntimeError('Variable "rowIdentifier" does not exist.', 34, $this->source); })())], "method", false, false, false, 34)) : (CoreExtension::getAttribute($this->env, $this->source, (isset($context["comparedRow"]) || array_key_exists("comparedRow", $context) ? $context["comparedRow"] : (function () { throw new RuntimeError('Variable "comparedRow" does not exist.', 34, $this->source); })()), "getMetadata", [(isset($context["rowIdentifier"]) || array_key_exists("rowIdentifier", $context) ? $context["rowIdentifier"] : (function () { throw new RuntimeError('Variable "rowIdentifier" does not exist.', 34, $this->source); })())], "method", false, false, false, 34))), "html", null, true);
yield "\"
";
// line 35
if (((isset($context["rowIdentifier"]) || array_key_exists("rowIdentifier", $context) ? $context["rowIdentifier"] : (function () { throw new RuntimeError('Variable "rowIdentifier" does not exist.', 35, $this->source); })()) != "label")) {
yield "data-label-pretty=\"";
yield \Piwik\piwik_escape_filter($this->env, CoreExtension::getAttribute($this->env, $this->source, (isset($context["comparedRow"]) || array_key_exists("comparedRow", $context) ? $context["comparedRow"] : (function () { throw new RuntimeError('Variable "comparedRow" does not exist.', 35, $this->source); })()), "getColumn", ["label"], "method", false, false, false, 35), "html", null, true);
yield "\"";
}
// line 36
yield " ";
if ( !$this->env->getTest('false')->getCallable()(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["segment"], "method", false, false, false, 36))) {
yield "data-segment-filter=\"";
yield \Piwik\piwik_escape_filter($this->env, CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["segment"], "method", false, false, false, 36), "html_attr");
yield "\"";
}
// line 37
yield " >
<td class=\"label\">
";
// line 39
if ((isset($context["isComparingSegments"]) || array_key_exists("isComparingSegments", $context) ? $context["isComparingSegments"] : (function () { throw new RuntimeError('Variable "isComparingSegments" does not exist.', 39, $this->source); })())) {
// line 40
$context["comparisonLabel"] = CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareSegmentPretty"], "method", false, false, false, 40);
} else {
// line 42
$context["comparisonLabel"] = (isset($context["comparePeriod"]) || array_key_exists("comparePeriod", $context) ? $context["comparePeriod"] : (function () { throw new RuntimeError('Variable "comparePeriod" does not exist.', 42, $this->source); })());
}
// line 44
yield " <span class=\"label\">";
yield \Piwik\piwik_escape_filter($this->env, (isset($context["comparisonLabel"]) || array_key_exists("comparisonLabel", $context) ? $context["comparisonLabel"] : (function () { throw new RuntimeError('Variable "comparisonLabel" does not exist.', 44, $this->source); })()), "html", null, true);
yield "</span>
</td>
";
// line 46
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["dimensions"]) || array_key_exists("dimensions", $context) ? $context["dimensions"] : (function () { throw new RuntimeError('Variable "dimensions" does not exist.', 46, $this->source); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["dimension"]) {
// line 47
yield " ";
if (((CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 47) != 0) && CoreExtension::inFilter($context["dimension"], CoreExtension::getAttribute($this->env, $this->source, (isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 47, $this->source); })()), "columns_to_display", [], "any", false, false, false, 47)))) {
// line 48
yield " <td class=\"label\">
</td>
";
}
// line 52
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['dimension'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 53
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 53, $this->source); })()), "columns_to_display", [], "any", false, false, false, 53));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["column"]) {
// line 54
yield " ";
if ((($context["column"] != "label") && !CoreExtension::inFilter($context["column"], (isset($context["dimensions"]) || array_key_exists("dimensions", $context) ? $context["dimensions"] : (function () { throw new RuntimeError('Variable "dimensions" does not exist.', 54, $this->source); })())))) {
// line 55
yield " ";
$context["columnValue"] = CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getColumn", [$context["column"]], "method", false, false, false, 55);
// line 56
yield " <td class=\"column\">
";
// line 57
$context["rowComparisonTotals"] = ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["comparisonTotals"] ?? null), (isset($context["seriesIndex"]) || array_key_exists("seriesIndex", $context) ? $context["seriesIndex"] : (function () { throw new RuntimeError('Variable "seriesIndex" does not exist.', 57, $this->source); })()), [], "array", false, true, false, 57), "totals", [], "any", true, true, false, 57)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["comparisonTotals"] ?? null), (isset($context["seriesIndex"]) || array_key_exists("seriesIndex", $context) ? $context["seriesIndex"] : (function () { throw new RuntimeError('Variable "seriesIndex" does not exist.', 57, $this->source); })()), [], "array", false, true, false, 57), "totals", [], "any", false, false, false, 57), null)) : (null));
// line 58
yield "
";
// line 59
$context["comparisonTooltipSuffix"] = "";
// line 60
yield " ";
$context["columnChange"] = false;
// line 61
yield "
";
// line 62
if ( !Twig\Extension\CoreExtension::testEmpty(((CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getColumn", [($context["column"] . "_change")], "method", true, true, false, 62)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getColumn", [($context["column"] . "_change")], "method", false, false, false, 62))) : ("")))) {
// line 63
yield " ";
$context["columnChange"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getColumn", [($context["column"] . "_change")], "method", true, true, false, 63)) ? (Twig\Extension\CoreExtension::default(CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getColumn", [($context["column"] . "_change")], "method", false, false, false, 63), "+0%")) : ("+0%"));
// line 64
yield " ";
$context["comparisonTooltipSuffix"] = $this->env->getFilter('translate')->getCallable()("General_ComparisonRatioTooltip", (isset($context["columnChange"]) || array_key_exists("columnChange", $context) ? $context["columnChange"] : (function () { throw new RuntimeError('Variable "columnChange" does not exist.', 64, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, $context["row"], "getMetadata", ["compareSegmentPretty"], "method", false, false, false, 64), (isset($context["comparedPeriodPretty"]) || array_key_exists("comparedPeriodPretty", $context) ? $context["comparedPeriodPretty"] : (function () { throw new RuntimeError('Variable "comparedPeriodPretty" does not exist.', 64, $this->source); })()));
// line 65
yield " ";
}
// line 66
yield "
";
// line 67
yield from $this->loadTemplate("@CoreVisualizations/_dataTableViz_htmlTable_ratio.twig", "@CoreVisualizations/_dataTableViz_htmlTable_comparisons.twig", 67)->unwrap()->yield(CoreExtension::merge($context, ["changePercentage" => // line 68
(isset($context["columnChange"]) || array_key_exists("columnChange", $context) ? $context["columnChange"] : (function () { throw new RuntimeError('Variable "columnChange" does not exist.', 68, $this->source); })()), "totals" => // line 69
(isset($context["rowComparisonTotals"]) || array_key_exists("rowComparisonTotals", $context) ? $context["rowComparisonTotals"] : (function () { throw new RuntimeError('Variable "rowComparisonTotals" does not exist.', 69, $this->source); })()), "label" => CoreExtension::getAttribute($this->env, $this->source, // line 70
(isset($context["comparedRow"]) || array_key_exists("comparedRow", $context) ? $context["comparedRow"] : (function () { throw new RuntimeError('Variable "comparedRow" does not exist.', 70, $this->source); })()), "getColumn", ["label"], "method", false, false, false, 70), "labelColumn" => Twig\Extension\CoreExtension::first($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, // line 71
(isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 71, $this->source); })()), "columns_to_display", [], "any", false, false, false, 71)), "forceZero" => true, "tooltipSuffix" => // line 73
(isset($context["comparisonTooltipSuffix"]) || array_key_exists("comparisonTooltipSuffix", $context) ? $context["comparisonTooltipSuffix"] : (function () { throw new RuntimeError('Variable "comparisonTooltipSuffix" does not exist.', 73, $this->source); })()), "translations" => CoreExtension::getAttribute($this->env, $this->source, // line 74
(isset($context["properties"]) || array_key_exists("properties", $context) ? $context["properties"] : (function () { throw new RuntimeError('Variable "properties" does not exist.', 74, $this->source); })()), "translations", [], "any", false, false, false, 74), "segmentTitlePretty" => CoreExtension::getAttribute($this->env, $this->source, // line 75
$context["row"], "getMetadata", ["compareSegmentPretty"], "method", false, false, false, 75), "periodTitlePretty" => CoreExtension::getAttribute($this->env, $this->source, // line 76
$context["row"], "getMetadata", ["comparePeriodPretty"], "method", false, false, false, 76)]));
// line 78
yield " <span class=\"value\">";
yield $this->env->getFilter('rawSafeDecoded')->getCallable()($this->env->getFilter('number')->getCallable()(((array_key_exists("columnValue", $context)) ? (Twig\Extension\CoreExtension::default((isset($context["columnValue"]) || array_key_exists("columnValue", $context) ? $context["columnValue"] : (function () { throw new RuntimeError('Variable "columnValue" does not exist.', 78, $this->source); })()), 0)) : (0)), 2, 0));
yield "</span>
</td>
";
}
// line 81
yield " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['column'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 82
yield " </tr>
";
// line 83
$context["lastSeenComparePeriod"] = (isset($context["comparePeriod"]) || array_key_exists("comparePeriod", $context) ? $context["comparePeriod"] : (function () { throw new RuntimeError('Variable "comparePeriod" does not exist.', 83, $this->source); })());
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rowId'], $context['row'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "@CoreVisualizations/_dataTableViz_htmlTable_comparisons.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 310 => 83, 307 => 82, 293 => 81, 286 => 78, 284 => 76, 283 => 75, 282 => 74, 281 => 73, 280 => 71, 279 => 70, 278 => 69, 277 => 68, 276 => 67, 273 => 66, 270 => 65, 267 => 64, 264 => 63, 262 => 62, 259 => 61, 256 => 60, 254 => 59, 251 => 58, 249 => 57, 246 => 56, 243 => 55, 240 => 54, 222 => 53, 208 => 52, 202 => 48, 199 => 47, 182 => 46, 176 => 44, 173 => 42, 170 => 40, 168 => 39, 164 => 37, 157 => 36, 151 => 35, 147 => 34, 143 => 33, 137 => 31, 131 => 30, 128 => 29, 125 => 28, 122 => 27, 117 => 26, 112 => 25, 108 => 24, 105 => 23, 102 => 22, 98 => 20, 92 => 19, 88 => 17, 85 => 16, 80 => 15, 74 => 11, 70 => 9, 67 => 8, 65 => 7, 48 => 6, 46 => 5, 44 => 4, 42 => 3, 40 => 2, 38 => 1,);
}
public function getSourceContext()
{
return new Source("{% if properties.columns_to_display is not empty %}
{% set lastSeenComparePeriod = false %}
{% set comparedPeriodPretty = (dataTable.getRows()|last).getMetadata('comparePeriodPretty') %}
{% set isComparingSegments = rootDataTable.getMetadata('compareSegments')|default([])|length > 1 %}
{% set isComparingPeriods = rootDataTable.getMetadata('comparePeriods')|default([])|length > 1 %}
{%- for rowId, row in dataTable.getRows() -%}
{% set comparePeriod = row.getMetadata('comparePeriodPretty') %}
{% if lastSeenComparePeriod != comparePeriod and isComparingSegments and isComparingPeriods %}
<tr class=\"comparePeriod\">
<td class=\"label\">
{{ comparePeriod }}
</td>
{# add extra empty columns for sticky column scrolling to work #}
{% for column in properties.columns_to_display %}
{% if column != 'label' %}
<td class=\"column\"> </td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
{% set overrideParams = {} %}
{% if row.getMetadata('compareSegment')|default is not empty %}{% set overrideParams = overrideParams|merge({ segment: row.getMetadata('compareSegment'), compareSegments: '' }) %}{% endif %}
{% if row.getMetadata('comparePeriod')|default is not empty %}{% set overrideParams = overrideParams|merge({ period: row.getMetadata('comparePeriod'), comparePeriods: '' }) %}{% endif %}
{% if row.getMetadata('compareDate')|default is not empty %}{% set overrideParams = overrideParams|merge({ date: row.getMetadata('compareDate'), compareDates: '' }) %}{% endif %}
{% set idSubtable = row.getMetadata('idsubdatatable') %}
{% set seriesIndex = loop.index0 %}
<tr
{% if idSubtable != false %}data-idsubtable=\"{{ idSubtable|e('html_attr') }}\"{% endif %}
data-comparison-series=\"{{ seriesIndex }}\"
class=\"comparisonRow\"
data-param-override=\"{{ overrideParams|json_encode|e('html_attr') }}\"
data-label=\"{{ comparedRow.getColumn(rowIdentifier) ? comparedRow.getColumn(rowIdentifier) : comparedRow.getMetadata(rowIdentifier) }}\"
{% if rowIdentifier != 'label' %}data-label-pretty=\"{{ comparedRow.getColumn('label') }}\"{% endif %}
{% if row.getMetadata('segment') is not false %}data-segment-filter=\"{{ row.getMetadata('segment')|e('html_attr') }}\"{% endif %}
>
<td class=\"label\">
{% if isComparingSegments %}
{%- set comparisonLabel = row.getMetadata('compareSegmentPretty') -%}
{% else %}
{%- set comparisonLabel = comparePeriod -%}
{% endif %}
<span class=\"label\">{{ comparisonLabel }}</span>
</td>
{% for dimension in dimensions %}
{% if loop.index0 != 0 and dimension in properties.columns_to_display %}
<td class=\"label\">
</td>
{% endif %}
{% endfor %}
{% for column in properties.columns_to_display %}
{% if column != 'label' and column not in dimensions %}
{% set columnValue = row.getColumn(column) %}
<td class=\"column\">
{% set rowComparisonTotals = comparisonTotals[seriesIndex].totals|default(null) %}
{% set comparisonTooltipSuffix = '' %}
{% set columnChange = false %}
{% if row.getColumn(column ~ '_change')|default is not empty %}
{% set columnChange = row.getColumn(column ~ '_change')|default('+0%') %}
{% set comparisonTooltipSuffix = 'General_ComparisonRatioTooltip'|translate(columnChange, row.getMetadata('compareSegmentPretty'), comparedPeriodPretty) %}
{% endif %}
{% include \"@CoreVisualizations/_dataTableViz_htmlTable_ratio.twig\" with {
'changePercentage': columnChange,
'totals': rowComparisonTotals,
'label': comparedRow.getColumn('label'),
'labelColumn': properties.columns_to_display|first,
'forceZero': true,
'tooltipSuffix': comparisonTooltipSuffix,
'translations': properties.translations,
'segmentTitlePretty': row.getMetadata('compareSegmentPretty'),
'periodTitlePretty': row.getMetadata('comparePeriodPretty')
} %}
<span class=\"value\">{{ columnValue|default(0)|number(2,0)|rawSafeDecoded }}</span>
</td>
{% endif %}
{% endfor %}
</tr>
{% set lastSeenComparePeriod = comparePeriod %}
{%- endfor -%}
{% endif %}", "@CoreVisualizations/_dataTableViz_htmlTable_comparisons.twig", "D:\\web\\matomo.circ\\plugins\\CoreVisualizations\\templates\\_dataTableViz_htmlTable_comparisons.twig");
}
}