{% extends 'projects/project_base.html' %}

{% block title %} Feature evaliation list  (for feature {{ fd.name }}){% endblock %}

{% block nav2 %}
<a href="{{ url_for('feature_matrices.list', project_id=project.project_id) }}"> Back to feature matrix list </a>
{% endblock %}

{% block content2 %}
<h2> Evaluation for "{{ fd.name }}" (Feature ID:{{ fd.feature_id }}) </h2>
<table id="feature_evaluations" class="stripe hover row-border order-column cell-border">
  <thead>
    <tr>
      <th>Matrix ID</th>
      <th>Name</th>
      <th>Created</th>
      {% for metric in metrics %}
        <th>{{ metric }}</th>
      {% endfor %}
    </tr>
  </thead>
  <tbody>
  {% for i, row in eval_df.iterrows() %}
      <tr>
        <td><a href="{{ url_for('feature_evaluations.list', project_id=project.project_id, fm_id=row['fm_id']) }}">{{ row["fm_id"] }}</a></td>
        <td>{{ row["name"] }}</td>
        <td>{{ row["created"] }}</td>
        {% for metric in metrics %}
          <td>{{ row[metric] }}</td>
        {% endfor %}
      </tr>
  {% endfor %}
  </tbody>
</table>
{% endblock %}

{% block scripts2 %}
  <script>
    $(document).ready(function () {
      $('#feature_evaluations').DataTable({
        columns: [
            {className: 'dt-right'},
            {className: 'dt-right'},
            {className: 'dt-right'},
            {% for metric in metrics %}
            {className: 'dt-right'}
            {% endfor %}
        ],
      });
    });
  </script>
{% endblock %}

