<!-- Template for the HTML markup for the results of a single test -->
<div class="row">
  <div class="col-md-12">
    <div class="page-header">
      <h2>IOOS Compliance Checker Report</h2>
      <p>For dataset {{source_name}}</p>
    </div>
  </div>
  <div class="col-md-12">
    <h3>{{testname}}</h3>
  </div>
  <div class="col-md-12">
    <h4>Corrective Actions</h4>
    <div class="col-md-12">
      <div class="table-collapse">
        <a data-target="high-priority-table" href="#"> {{scoreheader.get(3)}} <i class="glyphicon glyphicon-collapse-up"></i></a>
      </div>
      {% if high_count -%}
      <div class="failures">
        | <span class="label label-danger label-as-badge">{{ high_count }}</span>
      </div>
      <div class="high-priority-table collapse in">
        <table class="table">
          <thead>
            <tr>
              <th class="cname">Name</th>
              <th class="ccorrection">Reasoning</th>
            </tr>
          </thead>
          <tbody>
            {% for result in all_priorities -%}
              {% if result['weight'] == 3 -%}
                {% for msg in result['msgs']-%}
                  <tr>
                    <td>{{result['name']}}</td>
                    <td>{{msg}}</td>
                  </tr>
                {% endfor -%}
              {% endif -%}
            {% endfor -%}
          </tbody>
        </table>
      </div> <!-- .high-priority-table -->
      {% else -%}
      <div class="failures">
        | <span class="label label-success label-as-badge">{{ high_count }}</span>
      </div>

      <div class="high-priority-table collapse in">
        <table class="table">
          <tbody>
            <tr>
              <td>All high priority checks passed!</th>
            </tr>
          </tbody>
        </table>
      </div>
      {% endif -%}
    </div> <!-- .col-md-12 -->
    <div class="col-md-12">
      {% if medium_count -%}
      <div class="table-collapse">
        <a data-target="medium-priority-table" href="#"> {{scoreheader.get(2)}} <i class="glyphicon glyphicon-collapse-up"></i></a>
      </div>
      <div class="failures">
        | <span class="label label-danger label-as-badge">{{ medium_count }}</span>
      </div>
      <div class="medium-priority-table collapse in">
        <table class="table">
          <thead>
            <tr>
              <th class="cname">Name</th>
              <th class="ccorrection">Reasoning</th>
            </tr>
          </thead>
          <tbody>
            {% for result in all_priorities -%}
              {% if result['weight'] == 2 -%}
                {% for msg in result['msgs']-%}
                  <tr>
                    <td>{{result['name']}}</td>
                    <td>{{msg}}</td>
                  </tr>
                {% endfor -%}
              {% endif -%}
            {% endfor -%}
          </tbody>
        </table>
      </div> <!-- .medium-priority-table -->
      {% endif -%}
    </div> <!-- .col-md-12 -->
    <div class="col-md-12">
      {% if low_count -%}
      <div class="table-collapse">
        <a data-target="low-priority-table" href="#"> {{scoreheader.get(1)}} <i class="glyphicon glyphicon-collapse-up"></i></a>
      </div>
      <div class="failures">
        | <span class="label label-danger label-as-badge">{{ low_count }}</span>
      </div>
      <div class="low-priority-table collapse in">
        <table class="table">
          <thead>
            <tr>
              <th class="cname">Name</th>
              <th class="ccorrection">Reasoning</th>
            </tr>
          </thead>
          <tbody>
            {% for result in all_priorities -%}
              {% if result['weight'] == 1 -%}
                {% for msg in result['msgs']-%}
                  <tr>
                    <td>{{result['name']}}</td>
                    <td>{{msg}}</td>
                  </tr>
                {% endfor -%}
              {% endif -%}
            {% endfor -%}
          </tbody>
        </table>
      </div> <!-- .low-priority-table -->
      {% endif -%}
    </div> <!-- .col-md-12 -->
  </div> <!-- .col-md-12 -->
</div> <!-- .row -->
