{% extends "layouts/content.html" %}

{% load i18n %}
{% load keep_spacing %}
{% load static %}
{% load make_safe %}

{% block styles %}
<link rel="stylesheet" type="text/css" href="{% static "lava_results_app/css/chart.css" %}"/>
{% endblock %}

{% block content %}

<h1>Chart {{ chart.name }} {% if can_admin %}<small><a href="{% url 'lava.results.chart_detail' chart.name %}" class="btn btn-xs btn-info"><span class="glyphicon glyphicon-th-list"></span> Settings</a></small>{% endif %}</h1>

{% if chart.chart_group %}
Chart Group:&nbsp;&nbsp;<a href="{% url 'lava.results.chart_list' %}#{{ chart.chart_group|iriencode }}">{{ chart.chart_group }}</a>
{% endif %}
{{ chart.description|default_if_none:""|keep_spacing|linebreaks }}

<div id="main_container">
</div>
{% endblock %}

{% block scripts %}
<script src="{% static "lava_results_app/js/chart.js" %}"></script>
<script src="{% static "lava_server/js/bootbox.js" %}"></script>
<script src="{% static "lava_results_app/js/bootbox.data.toggle.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.canvas.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.dashes.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.axislabels.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.navigate.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.time.js" %}"></script>
<script src="{% static "lava_results_app/js/jquery.flot.labels.js" %}"></script>

<script>
  chart_data = $.parseJSON($('<div/>').html('{{chart_data|make_jquery_safe|escapejs}}').text());
  csrf_token = '{{csrf_token}}';
  image_url = '{{ STATIC_URL }}lava_results_app/images/';
  custom_chart_url = '{% url 'lava.results.chart_custom' %}';
</script>

{% endblock %}
