<!DOCTYPE html>

<!--
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.
-->

<!--
Add header
-->

{% load url from future %}
<html>
  <head>
    <title>{% block title %}SteelScript App Framework{% endblock %}</title>

    {% include "site_header_includes.html" %}

    <link href="{{ STATIC_URL }}css/report.css" rel="stylesheet"/>
    <link href="{{ STATIC_URL }}showLoading/css/showLoading.css" rel="stylesheet"/>

    <script type="text/javascript" src="{{ STATIC_URL }}showLoading/js/jquery.showLoading.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}jquery-timepicker/jquery.timepicker.min.js"></script>

    {% if maps_version == 'DEVELOPER' %}
        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    {% elif maps_version == 'FREE' %}
        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3%key={{ maps_api_key }}&sensor=false"></script>
    {% elif maps_version == 'BUSINESS' %}
        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&client={{ maps_api_key }}&sensor=false"></script>
    {% endif %}

    <script type="text/javascript" src="{{ STATIC_URL }}js/rvbd-widgets.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/rvbd-report.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/rvbd-yui3.js"></script>

    {% if maps_version == 'OPEN_STREET_MAPS' %}
        <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.2/leaflet.js"></script>
        <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.2/leaflet.css" />
        <script type="text/javascript" src="{{ STATIC_URL }}js/rvbd-openstreetmaps.js"></script>
    {% else %}
        <script type="text/javascript" src="{{ STATIC_URL }}js/rvbd-google-maps.js"></script>
    {% endif %}


    <script type="text/javascript">
      rvbd.report.isEmbedded = true;
      rvbd.report.widgetsUrl = "{{ widget_url }}";
      rvbd.report.csrfToken = "{{ csrf_token }}";
      rvbd.report.authToken = '{{ widget_authtoken }}';
      rvbd.report.embedWidgetInfo = {
          "widgetid": '{{ widget.widgetid }}',
          "widgetslug": '{{ widget.widgetslug }}',
          "criteria": '{{ widget.criteria }}'
      };

      $(rvbd.report.start);
    </script>
  </head>
  <body>
      <div class="row">
          <div class="collapse in" id="report-container">
              <img src='{{ STATIC_URL }}images/riverbed-logo-small.png' id="rvbd-widget-logo" style="position: absolute; bottom: 14px; right: 1px; z-index:3; opacity: 0.7; pointer-events: none">
            <div id="report">
            </div> <!-- criteria -->
          </div> <!-- criteria -->
      </div>

  </body>
</html>

