{% extends "base.html" %}
{% block title %}Graph{% endblock %}
{% load static %}

{% block body %}
    <h2>{{ instrument }} Graph</h2>
    <div>
        <canvas id="chart"></canvas>
    </div>
{% endblock %}

{% block stylesheets %}
    <link rel="stylesheet" href="{% static "css/graphs.css" %}">
{% endblock %}
{% block scripts %}
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.js"
            integrity="sha256-JG6hsuMjFnQ2spWq0UiaDRJBaarzhFbUxiUTxQDA9Lk="
            crossorigin="anonymous"></script>
    <script>
        let instrument = "{{ instrument }}";
        let reductionRuns = [
            {% for run in runs %}
                {
                    'runNumber': '{{ run.run_number}}',
                    'runVersion': '{{ run.run_version}}',
                    'executionTime': '{{ run.run_time }}',
                    'status': '{{ run.status.value_verbose }}',
                    'created': '{{ run.created }}'
                },
            {% endfor %}
        ];
    </script>
    <script src="{% static "javascript/graph_instrument.js" %}"></script>
{% endblock %}
