{% extends "base.html" %}

{% block content %}
    <h1 id=header>Project {{ project }} </h1>

    {{ experimenttable(showproject=false) }}

    {% if allow_tensorboard %}
        <button onclick='viewInTensorBoard( "{{ project }}" )' type="button" class="btn btn-default" id=tbButton> Tensorboard </button>
    {%- endif %}

    <script>

        $(authWidget(function() {
            reload(() => data_ajax('get_project_experiments', data={"project": "{{ project }}"}), fillExperimentTable)
        }));
        
        function viewInTensorBoard(key) {
            document.getElementById("tbButton").innerHTML="<i class='fa fa-cog fa-spin'></i> Redirecting..."
            window.location.href = "/tensorboard_proj/" + key
        }

    </script>

{% endblock %}
