{% extends 'base.html' %}

{% block title %}q2-longitudinal : {{ plot_name }}{% endblock %}

{% block content %}

{% if errors %}
<div class="panel-group" id="warnings" role="tablist" aria-multiselectable="true">
  <div class="panel panel-warning">
    <div class="panel-heading" role="tab" id="warnings-heading">
      <h4 class="panel-title">
        <a role="button" data-toggle="collapse" data-parent="#warnings" href="#warnings-list" aria-expanded="true" aria-controls="warnings-list">
          Warnings (click here to collapse/expand):
        </a>
      </h4>
    </div>
    <div id="warnings-list" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="warnings-heading">
      <div class="alert alert-warning col-md-12">
        {% for error in errors %}
        <p><strong>{{ error }}</strong></p>
        {% endfor %}
      </div>
    </div>
  </div>
</div>
{% endif %}

<div class="row">
  <div class="col-lg-12">
    {{ summary }}
    {% if model_summary %}
    <h2>Model summary</h2>
    <div class="text-center">
      <div class="col-lg-12">
        {{ model_summary }}
        <a href="model_summary.tsv">
          <p>Download summary as tsv</p>
        </a>
      </div>
    </div>
    {% endif %}
    {% if model_results %}
    <h2>Model results</h2>
    <div class="text-center">
      <div class="col-lg-12">
        {{ model_results }}
        <a href="model_results.tsv">
          <p>Download results as tsv</p>
        </a>
      </div>
    </div>
    {% endif %}
    {% if plot %}
    <h2>{{ plot_name }}</h2>
    <div class="text-center">
      <a href="plot.pdf">
        <img src="plot.png">
        <br>
        <p>Download as PDF</p>
      </a>
      {% if raw_data %}
      <a href="raw-data.tsv">
        <p>Download raw data as tsv</p>
      </a>
      {% endif %}
      {% if multiple_group_test %}
      <a href="pairs.tsv">
        <p>Download within-subject pairwise comparison data as tsv</p>
      </a>
      {% endif %}
    </div>
    {% endif %}
    {% if residuals %}
    <h2>Projected Residuals</h2>
    <p>Fit values for metric vs. observation error (residuals). Residuals
    should be roughly zero-centered and normal. Uncentered, systematically
    high or low, and autocorrelated values could indicate a poor model.</p>
    <div class="text-center">
      <a href="residuals.pdf">
        <img src="residuals.png">
        <br>
        <p>Download as PDF</p>
      </a>
    </div>
    {% endif %}
    {% if paired_difference_tests %}
    <h2>Pairwise difference tests</h2>
    <div class="col-lg-12">
      {{ paired_difference_tests }}
      <a href="paired_difference_tests.tsv">
        <p>Download scores as tsv</p>
      </a>
    </div>
    {% endif %}
    {% if multiple_group_test %}
    <h2>Multiple group tests</h2>
    <div class="col-lg-12">
      {{ multiple_group_test }}
    </div>
    {% endif %}
    {% if pairwise_tests %}
    <h2>{{ pairwise_test_name }}</h2>
    <div class="col-lg-12">
      {{ pairwise_tests }}
      <a href="pairwise_tests.tsv">
        <p>Download scores as tsv</p>
      </a>
    </div>
    {% endif %}
  </div>
</div>

{% endblock %}
