<commit_before>{% from "macros/flags.jinja" import insert_flag with context %}
{% from "macros/datetime.jinja" import insert_timeago with context %}
{% from "macros/links.jinja" import user_link %}

{% extends "base-fullscreen.jinja" %}
{% set active_page = "tracking" %}


{% block title -%}
{% trans pilot=user_link(pilot) -%}
Live Tracking <small>of {{ pilot }}</small>
{%- endtrans %}
{%- endblock %}


{%- block styles %}
{{ super() }}

{% if trace -%}
  {% for url in g.assets['openlayers_css'].urls() -%}
  <link href="{{ url }}" rel="stylesheet" type="text/css" />
  {%- endfor %}

  {%- if request.identity and request.identity['user'].eye_candy -%}
  <link href="/css/eye_candy/OpenLayers.css" rel="stylesheet" type="text/css" />
  {%- endif %}
{%- endif %}

<style>body{height:100%;margin:0;padding:0}</style>
{%- endblock %}


{%- block scripts %}
{{ super() }}

{% if trace -%}
  {% for url in g.assets['openlayers_js'].urls() -%}
  <script type="text/javascript" src="{{ url }}"></script>
  {%- endfor %}

  {% for url in g.assets['flot_js'].urls() -%}
  <script type="text/javascript" src="{{ url }}"></script>
  {%- endfor %}
{%- endif %}

{% for url in g.assets['flight_js'].urls() -%}
<script type="text/javascript" src="{{ url }}"></script>
{%- endfor %}

{% for url in g.assets['tracking_js'].urls() -%}
<script type="text/javascript" src="{{ url }}"></script>
{%- endfor %}

{% if trace -%}
<script type="text/javascript">
  $(function() {
    slUnits.init({{ h.json.dumps(h.get_setting_name('distance_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('speed_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('lift_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('altitude_unit')) }});

    initOpenLayers("map_canvas",
                   "{{ config.get('skylines.map.tile_url', '') }}");
    initFlightLayer();
    initBaro($("#barogram"));

    // initiate tracking mode
    default_time = -1;
    setTime(default_time);

    addFlight({{ pilot.id }},
      {{ h.json.dumps(trace.encoded.points) }},
      {{ h.json.dumps(trace.encoded.levels) }},
      {{ trace.num_levels }},
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.barogram_h) }},
      {{ h.json.dumps(trace.enl) }},
      {{ h.json.dumps(trace.zoom_levels) }},
      undefined,
      undefined,
      undefined,
      { competition_id: "{{ pilot.initials() }}" }
    );

    {% if other_pilots -%}
    {% for pilot, trace in other_pilots -%}
    addFlight({{ pilot.id }},
      {{ h.json.dumps(trace.encoded.points) }},
      {{ h.json.dumps(trace.encoded.levels) }},
      {{ trace.num_levels }},
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.barogram_h) }},
      {{ h.json.dumps(trace.enl) }},
      {{ h.json.dumps(trace.zoom_levels) }},
      undefined,
      undefined,
      undefined,
      { competition_id: "{{ pilot.initials() }}" }
    );
    {%- endfor %}
    {%- endif %}

    var factor = $("#barogram")[0].offsetHeight / map.getSize().h;
    var zoomExtent = flights.getBounds().clone().scale(1.02);
    zoomExtent.bottom -= zoomExtent.getHeight() * factor * 3/2;

    map.zoomToExtent(zoomExtent);

    hoverMap();

    $.getScript("http://maps.google.com/maps/api/js?v=3.7&sensor=false&callback=addGoogleLayer");
    addBingLayers("{{ config.get('skylines.bing.api_key', 'null') }}");
    addReliefLayer();

    // update flight track every 15 seconds
    setInterval(function() {
      updateFlightsFromJSON();
    }, 15*1000);

    initInfoBox({flight_info: false, location_info: true});
  });
</script>
{%- endif %}
{%- endblock %}


{% block content -%}
{% if trace or other_pilots -%}
<div id="map_canvas" class="olFullscreen" style="position: absolute; top: 40px; bottom: 0; width:100%;"></div>
<div style="position: absolute; bottom: 0; width:100%; background-color: white; opacity: 0.8;">
  <table id="fix-data" class="table table-condensed"></table>
  <div id="barogram" style="width:100%; height:100pt;"></div>
</div>
{%- else -%}
<p style="margin:10pt;margin-top:40pt;">{% trans %}There is no live track of this pilot currently.{% endtrans %}</p>
{%- endif %}
{%- endblock %}
<commit_msg>tracking: Added elevation data to full screen page too<commit_after>{% from "macros/flags.jinja" import insert_flag with context %}
{% from "macros/datetime.jinja" import insert_timeago with context %}
{% from "macros/links.jinja" import user_link %}

{% extends "base-fullscreen.jinja" %}
{% set active_page = "tracking" %}


{% block title -%}
{% trans pilot=user_link(pilot) -%}
Live Tracking <small>of {{ pilot }}</small>
{%- endtrans %}
{%- endblock %}


{%- block styles %}
{{ super() }}

{% if trace -%}
  {% for url in g.assets['openlayers_css'].urls() -%}
  <link href="{{ url }}" rel="stylesheet" type="text/css" />
  {%- endfor %}

  {%- if request.identity and request.identity['user'].eye_candy -%}
  <link href="/css/eye_candy/OpenLayers.css" rel="stylesheet" type="text/css" />
  {%- endif %}
{%- endif %}

<style>body{height:100%;margin:0;padding:0}</style>
{%- endblock %}


{%- block scripts %}
{{ super() }}

{% if trace -%}
  {% for url in g.assets['openlayers_js'].urls() -%}
  <script type="text/javascript" src="{{ url }}"></script>
  {%- endfor %}

  {% for url in g.assets['flot_js'].urls() -%}
  <script type="text/javascript" src="{{ url }}"></script>
  {%- endfor %}
{%- endif %}

{% for url in g.assets['flight_js'].urls() -%}
<script type="text/javascript" src="{{ url }}"></script>
{%- endfor %}

{% for url in g.assets['tracking_js'].urls() -%}
<script type="text/javascript" src="{{ url }}"></script>
{%- endfor %}

{% if trace -%}
<script type="text/javascript">
  $(function() {
    slUnits.init({{ h.json.dumps(h.get_setting_name('distance_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('speed_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('lift_unit')) }},
                 {{ h.json.dumps(h.get_setting_name('altitude_unit')) }});

    initOpenLayers("map_canvas",
                   "{{ config.get('skylines.map.tile_url', '') }}");
    initFlightLayer();
    initBaro($("#barogram"));

    // initiate tracking mode
    default_time = -1;
    setTime(default_time);

    addFlight({{ pilot.id }},
      {{ h.json.dumps(trace.encoded.points) }},
      {{ h.json.dumps(trace.encoded.levels) }},
      {{ trace.num_levels }},
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.barogram_h) }},
      {{ h.json.dumps(trace.enl) }},
      {{ h.json.dumps(trace.zoom_levels) }},
      undefined,
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.elevations) }},
      { competition_id: "{{ pilot.initials() }}" }
    );

    {% if other_pilots -%}
    {% for pilot, trace in other_pilots -%}
    addFlight({{ pilot.id }},
      {{ h.json.dumps(trace.encoded.points) }},
      {{ h.json.dumps(trace.encoded.levels) }},
      {{ trace.num_levels }},
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.barogram_h) }},
      {{ h.json.dumps(trace.enl) }},
      {{ h.json.dumps(trace.zoom_levels) }},
      undefined,
      {{ h.json.dumps(trace.barogram_t) }},
      {{ h.json.dumps(trace.elevations) }},
      { competition_id: "{{ pilot.initials() }}" }
    );
    {%- endfor %}
    {%- endif %}

    var factor = $("#barogram")[0].offsetHeight / map.getSize().h;
    var zoomExtent = flights.getBounds().clone().scale(1.02);
    zoomExtent.bottom -= zoomExtent.getHeight() * factor * 3/2;

    map.zoomToExtent(zoomExtent);

    hoverMap();

    $.getScript("http://maps.google.com/maps/api/js?v=3.7&sensor=false&callback=addGoogleLayer");
    addBingLayers("{{ config.get('skylines.bing.api_key', 'null') }}");
    addReliefLayer();

    // update flight track every 15 seconds
    setInterval(function() {
      updateFlightsFromJSON();
    }, 15*1000);

    initInfoBox({flight_info: false, location_info: true});
  });
</script>
{%- endif %}
{%- endblock %}


{% block content -%}
{% if trace or other_pilots -%}
<div id="map_canvas" class="olFullscreen" style="position: absolute; top: 40px; bottom: 0; width:100%;"></div>
<div style="position: absolute; bottom: 0; width:100%; background-color: white; opacity: 0.8;">
  <table id="fix-data" class="table table-condensed"></table>
  <div id="barogram" style="width:100%; height:100pt;"></div>
</div>
{%- else -%}
<p style="margin:10pt;margin-top:40pt;">{% trans %}There is no live track of this pilot currently.{% endtrans %}</p>
{%- endif %}
{%- endblock %}

{'fraction_non_alphanumeric': 0.21737094697413087, 'fraction_numerical': 0.010300831089781108, 'mean_word_length': 3.3973237261966034, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2255787', 'n_tokens_mistral': 3279, 'n_tokens_neox': 3009, 'n_words': 506}