{% extends "layout_bs4.html" %}
{% import "bootstrap/wtf.html" as wtf %}

{% macro loqus_observations(observations) %}
  <div class="panel-heading">
    <a href="https://github.com/moonso/loqusdb" target="_blank">Local observations</a>
  </div>
  <ul class="list-group">
    <li class="list-group-item">
      <div class="row">
        <div class="col-4">
          {{ observations.observations|default('N/A') }} <small>obs.</small>
        </div>
        <div class="col-4">
          {{ observations.homozygote|default('N/A') }} <small>homo.</small>
        </div>
        <div class="col-4">
          {{ observations.total }} <small>tot.</small>
        </div>
      </div>
    </li>
    {% if observations['cases'] %}
      <div class="list-group-item">
        <div class="row">
          <div class="col-3"><strong>Cases</strong></div>
          <div class="col-9">
            {% for data in observations['cases'] %}
              {% if data.variant %}
                <a class="ml-3" href="{{ url_for('variant.variant', institute_id=data.case.owner, case_name=data.case.display_name, variant_id=data.variant._id) }}">{{ data.case.display_name }}</a>
              {% else %}
                <span class="text-muted ml-3">{{ data.case.display_name }}</span>
              {% endif %}
            {% endfor %}
          </div>
        </div>
      </div>
    {% endif %}
  </ul>
{% endmacro %}
