<commit_before>{% extends "base.html" %}
{% import "components.html" as components %}

{% block main_content %}
  <form action="{{ url_for('samples') }}">
    <div class="panel panel-default">
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-10">
            <input class="form-control" type="text" name="query_str" value="{{ qargs.query_str if qargs.query_str }}">
          </div>
          <div class="col-xs-2">
            <button class="btn btn-primary form-control">Search</button>
          </div>
        </div>
      </div>
      <div class="panel-footer">
        <select class="form-control" name="status_to">
          <option value="">Samples to...</option>
          {% for status in ['sequence', 'confirm'] %}
            <option value="{{ status }}" {% if status == qargs.status_to %}selected{% endif %}>Samples to {{ status }}</option>
          {% endfor %}
        </select>
      </div>
    </div>
  </form>

  <div class="panel panel-default">
    <div class="table-responsive">
      {{ samples_table(samples.items) }}
    </div>
    <div class="panel-footer">
      <div class="row">
        <div class="col-xs-4">
          {% if samples.has_prev %}
            <a href="{{ url_for('samples', page=samples.prev_num, **qargs) }}">Previous</a>
          {% endif %}
        </div>
        <div class="col-xs-4 text-center">
          Page {{ samples.page }} <small class="text-muted">({{ samples.total }} samples)</small>
        </div>
        <div class="col-xs-4 text-right">
          {% if samples.has_next %}
            <a href="{{ url_for('samples', page=samples.next_num, **qargs) }}">Next</a>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
{% endblock %}

{% macro samples_table(samples) %}
  <table class="table table-bordered table-hover">
    <thead>
      <tr>
        <th>Sample</th>
        <th>Case</th>
        <th>Received at</th>
        <th>Sequenced at</th>
        <th>Confirmed at</th>
      </tr>
    </thead>
    <tbody>
      {% for sample in samples %}
        <tr {% if sample.priority %} class="bg-primary" {% endif %}>
          <td>{{ sample.lims_id }}</td>
          <td>
            <a href="{{ url_for('case', name=sample.case_id) }}">
              {{ sample.case_id }}
            </a>
          </td>
          <td>{{ sample.received_at.date() if sample.received_at }}</td>
          <td>
            {% if sample.sequenced_at %}<commit_msg>update display of prioritized samples<commit_after>{% extends "base.html" %}
{% import "components.html" as components %}

{% block main_content %}
  <form action="{{ url_for('samples') }}">
    <div class="panel panel-default">
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-10">
            <input class="form-control" type="text" name="query_str" value="{{ qargs.query_str if qargs.query_str }}">
          </div>
          <div class="col-xs-2">
            <button class="btn btn-primary form-control">Search</button>
          </div>
        </div>
      </div>
      <div class="panel-footer">
        <select class="form-control" name="status_to">
          <option value="">Samples to...</option>
          {% for status in ['sequence', 'confirm'] %}
            <option value="{{ status }}" {% if status == qargs.status_to %}selected{% endif %}>Samples to {{ status }}</option>
          {% endfor %}
        </select>
      </div>
    </div>
  </form>

  <div class="panel panel-default">
    <div class="table-responsive">
      {{ samples_table(samples.items) }}
    </div>
    <div class="panel-footer">
      <div class="row">
        <div class="col-xs-4">
          {% if samples.has_prev %}
            <a href="{{ url_for('samples', page=samples.prev_num, **qargs) }}">Previous</a>
          {% endif %}
        </div>
        <div class="col-xs-4 text-center">
          Page {{ samples.page }} <small class="text-muted">({{ samples.total }} samples)</small>
        </div>
        <div class="col-xs-4 text-right">
          {% if samples.has_next %}
            <a href="{{ url_for('samples', page=samples.next_num, **qargs) }}">Next</a>
          {% endif %}
        </div>
      </div>
    </div>
  </div>
{% endblock %}

{% macro samples_table(samples) %}
  <table class="table table-bordered table-hover">
    <thead>
      <tr>
        <th>Sample</th>
        <th>Case</th>
        <th>Received at</th>
        <th>Sequenced at</th>
        <th>Confirmed at</th>
      </tr>
    </thead>
    <tbody>
      {% for sample in samples %}
        <tr {% if sample.priority %} class="bg-info" {% endif %}>
          <td>
            {{ sample.lims_id }}
            <span class="badge pull-right">P</span>
          </td>
          <td>
            <a href="{{ url_for('case', name=sample.case_id) }}">
              {{ sample.case_id }}
            </a>
          </td>
          <td>{{ sample.received_at.date() if sample.received_at }}</td>
          <td>
            {% if sample.sequenced_at %}
{'fraction_non_alphanumeric': 0.19219279028082056, 'fraction_numerical': 0.0023899621589324837, 'mean_word_length': 2.028950542822678, 'pattern_counts': {'":': 0, '<': 143, '<?xml version=': 0, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2481175', 'n_tokens_mistral': 1651, 'n_tokens_neox': 1558, 'n_words': 339}