{% extends "layout_bs4.html" %}

{% block title %}
  {{ super() }} - Institutes
{% endblock %}

{% block top_nav %}
  {{ super() }}
  <li class="active">
    <span class="navbar-text">Institutes Overview</span>
  </li>
{% endblock %}

{% block content_main %}
<div class="container-float">
  <div class="card-columns">
    {% for institute in institutes %}
      <div class="card mt-3">
        <h5 class="card-title"><a href="{{ url_for('cases.cases', institute_id=institute.internal_id) }}"> {{ institute.display_name }}</a></h5>
        {% if current_user.is_admin %}
          <h6 class="card-subtitle mb-2 text-muted"> ({{ institute.internal_id }})</h6>
        {% endif %}
        <div class="card-body">
          <ul class="list-group list-group-flush">
            <li class="list-group-item">
              Coverage Cutoff
              <span class="float-right">{{ institute.coverage_cutoff }}</span>
            </li>
            <div class="list-group-item">
              Sanger Recipients
              <span class="float-right">{{ institute.sanger_recipients|join(', ') or '-' }}</span>
            </div>
            <li class="list-group-item">
              Frequency Cutoff
              <span class="float-right">{{ institute.frequency_cutoff }}</span>
            </li>
            <li class="list-group-item">
              Number of Cases
              <span class="float-right">{{ institute.case_count }}</span>
            </li>
          </ul>
        </div>
      </div>
    {% endfor %}
  </div>
</div>
{% endblock %}
