{% extends 'activity/base-learn-data-detail-modal.html.twig' %}

{% block body %}
  <table class="table table-hover table-bordered">
    <thead>
      <tr class="active">
        <th>{{ 'task.learn_data_detail.nickname'|trans }}</th>
        <th>{{ 'task.learn_data_detail.createdTime'|trans }}</th>
        <th>{{ 'task.learn_data_detail.finishedTime'|trans({'%taskName%':setting('course.task_name')|default('admin.setting_course.task'|trans)}) }}</th>
        <th>{{ 'task.learn_data_detail.learnTime'|trans({'%taskName%':setting('course.task_name')|default('admin.setting_course.task'|trans)}) }}</th>
        <th>{{ 'task.learn_data_detail.video_and_audio_learnTime'|trans }}</th>
      </tr>
    </thead>
    <tbody>
      {% for taskResult in taskResults if taskResult %}
        {% set user = users[taskResult.userId] %}
        <tr>
          <td>{{ user.nickname }}</td>
          <td>{{ taskResult.createdTime|date("Y-m-d H:i:s") }}</td>
          {% if taskResult.status == 'finish'%}
            <td>{{ taskResult.finishedTime|date("Y-m-d H:i:s") }}</td>
          {% else %}
            <td>-</td>
          {% endif %}
          <td>{% if taskResult.time > 0 %}{{ (taskResult.time / 60)|number_format(1) }}{% else %}0{% endif %}</td>
          <td>{% if taskResult.watchTime > 0 %}{{ (taskResult.watchTime / 60)|number_format(1) }}{% else %}0{% endif %}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
  <nav class="text-center">
    {{ web_macro.paginator(paginator) }}
  </nav>

{% endblock %}