<?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;
use Twig\TemplateWrapper;
/* debug/hobit.html.twig */
class __TwigTemplate_1332b2402c6102e7401d31b1422b73aa extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "debug/hobit.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "debug/hobit.html.twig"));
$this->parent = $this->load("base.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 4
yield " <div class=\"page\">
<div class=\"container\">
<div class=\"row animated fadeIn delay-0-2s\">
<div class=\"col-12 mb-3 mb-lg-5\">
<div class=\"\">
<h2>Magic hobit</h2>
</div>
<div class=\"\">
";
// line 13
if ((($tmp = (isset($context["debugAndFlush"]) || array_key_exists("debugAndFlush", $context) ? $context["debugAndFlush"] : (function () { throw new RuntimeError('Variable "debugAndFlush" does not exist.', 13, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 14
yield " <p>Debug and flush : Yes</p>
";
} else {
// line 16
yield " <p>Debug and flush : No</p>
";
}
// line 18
yield " </div>
<hr></hr>
</div>
</div>
</div>
";
// line 25
if ((($tmp = (isset($context["tabHobit"]) || array_key_exists("tabHobit", $context) ? $context["tabHobit"] : (function () { throw new RuntimeError('Variable "tabHobit" does not exist.', 25, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 26
yield " ";
if ((($tmp = (isset($context["debugAndFlush"]) || array_key_exists("debugAndFlush", $context) ? $context["debugAndFlush"] : (function () { throw new RuntimeError('Variable "debugAndFlush" does not exist.', 26, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 27
yield " <div class=\"container\">
<div class=\"row\">
";
// line 29
$context["i"] = 3;
// line 30
yield " ";
$context["number"] = 1;
// line 31
yield "
";
// line 32
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["tabHobit"]) || array_key_exists("tabHobit", $context) ? $context["tabHobit"] : (function () { throw new RuntimeError('Variable "tabHobit" does not exist.', 32, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["hobit"]) {
// line 33
yield " <div class=\"col-12 col-lg-4 mb-3 mb-lg-5\">
<div class=\"card animated fadeIn delay-0-";
// line 34
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["i"]) || array_key_exists("i", $context) ? $context["i"] : (function () { throw new RuntimeError('Variable "i" does not exist.', 34, $this->source); })()), "html", null, true);
yield "s\" style=\"width: 100%;\">
<div class=\"card-img-top animated fadeIn delay-0-8s\" style='text-align:center;'><iframe
width='100%'
height='300'
frameborder='0' style='border:0'
src='https://www.google.com/maps/embed/v1/place?key=AIzaSyAmbx9RsGi01srCnH_-2TVdH26TpjwvFDs
&q=";
// line 40
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 40), "latitude", [], "any", false, false, false, 40), "html", null, true);
yield ",";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 40), "longitude", [], "any", false, false, false, 40), "html", null, true);
yield "'
allowfullscreen>
</iframe>
</div>
<div class=\"card-body\">
<h5 class=\"card-title\">Hobit ";
// line 45
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 45, $this->source); })()), "html", null, true);
yield "</h5>
<p class=\"card-text\">Date start : ";
// line 46
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "startDateTime", [], "array", false, false, false, 46), "d/m/Y H:i"), "html", null, true);
yield "</p>
<p class=\"card-text\">Date end : ";
// line 47
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "endDateTime", [], "array", false, false, false, 47), "d/m/Y H:i"), "html", null, true);
yield "</p>
<p class=\"card-text\">Latitude : ";
// line 48
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 48), "latitude", [], "any", false, false, false, 48), "html", null, true);
yield "</p>
<p class=\"card-text\">Longitude : ";
// line 49
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 49), "longitude", [], "any", false, false, false, 49), "html", null, true);
yield "</p>
<p class=\"card-text\">Number : ";
// line 50
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "number", [], "array", false, false, false, 50), "html", null, true);
yield "</p>
</div>
</div>
</div>
";
// line 54
$context["i"] = ((isset($context["i"]) || array_key_exists("i", $context) ? $context["i"] : (function () { throw new RuntimeError('Variable "i" does not exist.', 54, $this->source); })()) + 1);
// line 55
yield " ";
$context["number"] = ((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 55, $this->source); })()) + 1);
// line 56
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['hobit'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
yield "
</div>
</div>
";
} else {
// line 60
yield " <div class=\"container\">
<div class=\"row\">
";
// line 62
$context["number"] = 1;
// line 63
yield " ";
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["tabHobit"]) || array_key_exists("tabHobit", $context) ? $context["tabHobit"] : (function () { throw new RuntimeError('Variable "tabHobit" does not exist.', 63, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["hobit"]) {
// line 64
yield " <div class=\"col-12 col-lg-6\">
<div class=\"accordion\" id=\"accordionExample\">
<div class=\"accordion-item\">
<div class=\"title\">
";
// line 70
if ((CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "activityType", [], "array", false, false, false, 70) == "still")) {
// line 71
yield " <i class=\"fas fa-chair\"></i>
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, // line 72
$context["hobit"], "activityType", [], "array", false, false, false, 72) == "on_foot")) {
// line 73
yield " <i class=\"fas fa-walking\"></i>
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, // line 74
$context["hobit"], "activityType", [], "array", false, false, false, 74) == "on_bicycle")) {
// line 75
yield " <i class=\"fas fa-bicycle\"></i>
";
} elseif ((CoreExtension::getAttribute($this->env, $this->source, // line 76
$context["hobit"], "activityType", [], "array", false, false, false, 76) == "in_vehicle")) {
// line 77
yield " <i class=\"fas fa-car\"></i>
";
}
// line 79
yield "
";
// line 80
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "activityType", [], "array", false, false, false, 80), "html", null, true);
yield "
</div>
";
// line 83
if (((CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", true, true, false, 83) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 83), "latitude", [], "any", false, false, false, 83)) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 83), "longitude", [], "any", false, false, false, 83))) {
// line 84
yield " <div>
<iframe
width='100%'
height='300'
frameborder='0' style='border:0'
src='https://www.google.com/maps/embed/v1/place?key=AIzaSyAmbx9RsGi01srCnH_-2TVdH26TpjwvFDs
&q=";
// line 90
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 90), "latitude", [], "any", false, false, false, 90), "html", null, true);
yield ",";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "data", [], "array", false, false, false, 90), "longitude", [], "any", false, false, false, 90), "html", null, true);
yield "'
allowfullscreen>
</iframe>
</div>
";
} else {
// line 95
yield " <div data-positions='";
yield json_encode(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "positions", [], "array", false, false, false, 95));
yield "' id=\"map-multi-";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 95, $this->source); })()), "html", null, true);
yield "\" class=\"animated fadeIn delay-0-8s map-multi\" style=\"width: 100%; height: 300px;\"></div>
";
}
// line 97
yield "
<div>
<button class=\"accordion-button button black mt-3 mb-3\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#tab-";
// line 99
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 99, $this->source); })()), "html", null, true);
yield "-main\" aria-expanded=\"true\" aria-controls=\"collapseOne\">Open</button>
</div>
<div id=\"tab-";
// line 102
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 102, $this->source); })()), "html", null, true);
yield "-main\" class=\"accordion-collapse collapse\" aria-labelledby=\"tab-";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 102, $this->source); })()), "html", null, true);
yield "-main-label\" data-bs-parent=\"#accordionExample\">
<div class=\"accordion-body\">
<div class=\"line\"><strong>Start date time : </strong><code>";
// line 104
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "startDateTime", [], "array", false, false, false, 104), "d/m/Y H:i", "Europe/Paris"), "html", null, true);
yield "</code></div>
<div class=\"line\"><strong>Start date time server : </strong><code>";
// line 105
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "startDateTimeServer", [], "array", false, false, false, 105), "d/m/Y H:i", "Europe/Paris"), "html", null, true);
yield "</code></div>
<div class=\"line\"><strong>End date time hobbit : </strong><code>";
// line 106
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "endDateTime", [], "array", false, false, false, 106), "d/m/Y H:i", "Europe/Paris"), "html", null, true);
yield "</code></div>
<div class=\"line\"><strong>Type activity : </strong><code>";
// line 108
yield $this->extensions['Symfony\Bridge\Twig\Extension\DumpExtension']->dump($this->env, $context, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "activityType", [], "array", false, false, false, 108));
yield "</code></div>
";
// line 109
if (CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "id", [], "array", true, true, false, 109)) {
// line 110
yield " <div class=\"line\"><strong>Id : </strong><code>";
yield $this->extensions['Symfony\Bridge\Twig\Extension\DumpExtension']->dump($this->env, $context, CoreExtension::getAttribute($this->env, $this->source, $context["hobit"], "id", [], "array", false, false, false, 110));
yield "</code></div>
";
}
// line 112
yield "
<div class=\"line\"><strong>Data : </strong><code>";
// line 113
yield $this->extensions['Symfony\Bridge\Twig\Extension\DumpExtension']->dump($this->env, $context, $context["hobit"]);
yield "</code></div>
</div>
</div>
</div>
";
// line 117
$context["number"] = ((isset($context["number"]) || array_key_exists("number", $context) ? $context["number"] : (function () { throw new RuntimeError('Variable "number" does not exist.', 117, $this->source); })()) + 1);
// line 118
yield "
</div>
</div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['hobit'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 122
yield " </div>
</div>
";
}
// line 126
yield "
";
} else {
// line 128
yield " <div class=\"text-center animated fadeIn delay-0-4s\" style=\"font-size: 30px;\">No data...</div>
";
}
// line 130
yield " </div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 134
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 135
yield " ";
yield from $this->yieldParentBlock("javascripts", $context, $blocks);
yield "
<script>
\$(window).on('load', function() {
\$(\".map-multi\").each(function( index ) {
console.log(JSON.parse(\$(this).attr(\"data-positions\")));
initMap(\$(this).attr(\"id\"));
});
function initMap(idMap) {
var positions = JSON.parse(\$(\"#\" + idMap).attr(\"data-positions\"));
//var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 16,
center: new google.maps.LatLng(positions[0]['dataGps']['latitude'],positions[0]['dataGps']['longitude'])
}
var map = new google.maps.Map(document.getElementById(idMap), mapOptions);
var markers = [];
positions.forEach(function(element) {
markers.push(new google.maps.Marker({
position: new google.maps.LatLng(element['dataGps']['latitude'], element['dataGps']['longitude']),
//title: element[2] + \" - \" + element[0] + \" - \" + element[1]
}));
});
// To add the marker to the map, call setMap();
//markers[0].setMap(map);
//marker2.setMap(map);
markers.forEach(function(element) {
element.setMap(map);
});
}
});
</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "debug/hobit.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 373 => 135, 360 => 134, 347 => 130, 343 => 128, 339 => 126, 333 => 122, 324 => 118, 322 => 117, 315 => 113, 312 => 112, 306 => 110, 304 => 109, 300 => 108, 295 => 106, 291 => 105, 287 => 104, 280 => 102, 274 => 99, 270 => 97, 262 => 95, 252 => 90, 244 => 84, 242 => 83, 236 => 80, 233 => 79, 229 => 77, 227 => 76, 224 => 75, 222 => 74, 219 => 73, 217 => 72, 214 => 71, 212 => 70, 204 => 64, 199 => 63, 197 => 62, 193 => 60, 182 => 56, 179 => 55, 177 => 54, 170 => 50, 166 => 49, 162 => 48, 158 => 47, 154 => 46, 150 => 45, 140 => 40, 131 => 34, 128 => 33, 124 => 32, 121 => 31, 118 => 30, 116 => 29, 112 => 27, 109 => 26, 107 => 25, 98 => 18, 94 => 16, 90 => 14, 88 => 13, 77 => 4, 64 => 3, 41 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'base.html.twig' %}
{% block body %}
<div class=\"page\">
<div class=\"container\">
<div class=\"row animated fadeIn delay-0-2s\">
<div class=\"col-12 mb-3 mb-lg-5\">
<div class=\"\">
<h2>Magic hobit</h2>
</div>
<div class=\"\">
{% if debugAndFlush %}
<p>Debug and flush : Yes</p>
{% else %}
<p>Debug and flush : No</p>
{% endif %}
</div>
<hr></hr>
</div>
</div>
</div>
{% if tabHobit %}
{% if debugAndFlush %}
<div class=\"container\">
<div class=\"row\">
{% set i = 3 %}
{% set number = 1 %}
{% for hobit in tabHobit %}
<div class=\"col-12 col-lg-4 mb-3 mb-lg-5\">
<div class=\"card animated fadeIn delay-0-{{ i }}s\" style=\"width: 100%;\">
<div class=\"card-img-top animated fadeIn delay-0-8s\" style='text-align:center;'><iframe
width='100%'
height='300'
frameborder='0' style='border:0'
src='https://www.google.com/maps/embed/v1/place?key=AIzaSyAmbx9RsGi01srCnH_-2TVdH26TpjwvFDs
&q={{ hobit['data'].latitude }},{{ hobit['data'].longitude }}'
allowfullscreen>
</iframe>
</div>
<div class=\"card-body\">
<h5 class=\"card-title\">Hobit {{ number }}</h5>
<p class=\"card-text\">Date start : {{ hobit['startDateTime']|date(\"d/m/Y H:i\") }}</p>
<p class=\"card-text\">Date end : {{ hobit['endDateTime']|date(\"d/m/Y H:i\") }}</p>
<p class=\"card-text\">Latitude : {{ hobit['data'].latitude }}</p>
<p class=\"card-text\">Longitude : {{ hobit['data'].longitude }}</p>
<p class=\"card-text\">Number : {{ hobit['number'] }}</p>
</div>
</div>
</div>
{% set i = i + 1 %}
{% set number = number + 1 %}
{% endfor %}
</div>
</div>
{% else %}
<div class=\"container\">
<div class=\"row\">
{% set number = 1 %}
{% for hobit in tabHobit %}
<div class=\"col-12 col-lg-6\">
<div class=\"accordion\" id=\"accordionExample\">
<div class=\"accordion-item\">
<div class=\"title\">
{% if hobit['activityType'] == \"still\" %}
<i class=\"fas fa-chair\"></i>
{% elseif hobit['activityType'] == \"on_foot\" %}
<i class=\"fas fa-walking\"></i>
{% elseif hobit['activityType'] == \"on_bicycle\" %}
<i class=\"fas fa-bicycle\"></i>
{% elseif hobit['activityType'] == \"in_vehicle\" %}
<i class=\"fas fa-car\"></i>
{% endif %}
{{ hobit['activityType'] }}
</div>
{% if hobit[\"data\"] is defined and hobit[\"data\"].latitude and hobit[\"data\"].longitude %}
<div>
<iframe
width='100%'
height='300'
frameborder='0' style='border:0'
src='https://www.google.com/maps/embed/v1/place?key=AIzaSyAmbx9RsGi01srCnH_-2TVdH26TpjwvFDs
&q={{ hobit[\"data\"].latitude }},{{ hobit[\"data\"].longitude }}'
allowfullscreen>
</iframe>
</div>
{% else %}
<div data-positions='{{ hobit['positions']|json_encode()|raw }}' id=\"map-multi-{{ number }}\" class=\"animated fadeIn delay-0-8s map-multi\" style=\"width: 100%; height: 300px;\"></div>
{% endif %}
<div>
<button class=\"accordion-button button black mt-3 mb-3\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#tab-{{ number }}-main\" aria-expanded=\"true\" aria-controls=\"collapseOne\">Open</button>
</div>
<div id=\"tab-{{ number }}-main\" class=\"accordion-collapse collapse\" aria-labelledby=\"tab-{{ number }}-main-label\" data-bs-parent=\"#accordionExample\">
<div class=\"accordion-body\">
<div class=\"line\"><strong>Start date time : </strong><code>{{ hobit['startDateTime']|date(\"d/m/Y H:i\", \"Europe/Paris\") }}</code></div>
<div class=\"line\"><strong>Start date time server : </strong><code>{{ hobit['startDateTimeServer']|date(\"d/m/Y H:i\", \"Europe/Paris\") }}</code></div>
<div class=\"line\"><strong>End date time hobbit : </strong><code>{{ hobit['endDateTime']|date(\"d/m/Y H:i\", \"Europe/Paris\") }}</code></div>
<div class=\"line\"><strong>Type activity : </strong><code>{{ dump(hobit['activityType']) }}</code></div>
{% if hobit['id'] is defined %}
<div class=\"line\"><strong>Id : </strong><code>{{ dump(hobit['id']) }}</code></div>
{% endif %}
<div class=\"line\"><strong>Data : </strong><code>{{ dump(hobit) }}</code></div>
</div>
</div>
</div>
{% set number = number + 1 %}
</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% else %}
<div class=\"text-center animated fadeIn delay-0-4s\" style=\"font-size: 30px;\">No data...</div>
{% endif %}
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script>
\$(window).on('load', function() {
\$(\".map-multi\").each(function( index ) {
console.log(JSON.parse(\$(this).attr(\"data-positions\")));
initMap(\$(this).attr(\"id\"));
});
function initMap(idMap) {
var positions = JSON.parse(\$(\"#\" + idMap).attr(\"data-positions\"));
//var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 16,
center: new google.maps.LatLng(positions[0]['dataGps']['latitude'],positions[0]['dataGps']['longitude'])
}
var map = new google.maps.Map(document.getElementById(idMap), mapOptions);
var markers = [];
positions.forEach(function(element) {
markers.push(new google.maps.Marker({
position: new google.maps.LatLng(element['dataGps']['latitude'], element['dataGps']['longitude']),
//title: element[2] + \" - \" + element[0] + \" - \" + element[1]
}));
});
// To add the marker to the map, call setMap();
//markers[0].setMap(map);
//marker2.setMap(map);
markers.forEach(function(element) {
element.setMap(map);
});
}
});
</script>
{% endblock %}", "debug/hobit.html.twig", "/var/www/vhosts/webpro-developpement.fr/follow.webpro-developpement.fr/public/templates/debug/hobit.html.twig");
}
}