{% extends "base.html" %}

{% block head %}
    {{ super() }}
    {% block title %}
        <title>GitHubHealth: {{ ghh.user.name }}</title>
    {% endblock %}
{% endblock %}

{% block body %}

    {% block navbar %}
    {% endblock %}

    {% block header %}
        {{ super() }}
    {% endblock %}

    {% block content %}

        {% if ghh.requested_object.obj is not none %}
            <div class="user-content repo-status">
                <a class="header" href={{ ghh.requested_object.url }} target="_blank">{{ ghh.requested_object.name }}</a>
            </div>
            {{ ghh.repo_html|safe }}
            <form id="plot-control-form">
                <select id="select-y" name="select-y" onclick="selectY(this.value)"></select>
                <div class="multiselect">
                    <div class="selectBox" onclick="showCheckboxes()">
                        <select><option>Filter X variable</option></select>
                        <div class="overSelect"></div>
                    </div>
                    <div id="select-x"></div>
                </div>
            </form>
            <span class="plots">
                <button class="direction" id="left" onclick="fillPlotLeft()">
                    <img class="direction" src="{{ url_for('static', filename='/assets/arrow-left-circle-fill.svg') }}">
                </button>
                <div id="vis_repo" class="plot" style="display: block"></div>
                <button class="direction" id="right" onclick="fillPlotRight()">
                    <img class="direction" src="{{ url_for('static', filename='/assets/arrow-right-circle-fill.svg') }}">
                </button>
            </span>
            <div id="vis_error"></div>
        {% endif %}

    {% endblock %}

    {% block error_warning %}
        {{ super() }}
    {% endblock %}

    {% block footer %}
        {{ super() }}
    {% endblock %}

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

        {% if ghh.requested_object.obj is not none %}
            <script>
                var plots = {{ ghh.plots|safe }} ;
                vegaEmbedPlotNew(plots, "vis_error", "#vis_repo", 0);
                prefillSelectY();
            </script>
        {% endif %}

    {% endblock %}

{% endblock %}
