{% extends "otree_tools/BaseToolsAdmin.html" %}
{% load static %}
{% block title %}

    Time tracking info (<code>{% verbatim %}{%&nbsp;tracking_time&nbsp;%}{% endverbatim %}</code> tag)

{% endblock %}

{% block content %}

    {% if timestamps %}
        <table class="table table-hover table-striped table-resonsive">
            <thead>
            <th>Session code</th>
            <th>Participant code</th>
            <th>App name</th>
            <th>Round number</th>
            <th>Page name</th>
            <th>Entrance timestamp</th>
            <th>Exit timestamp</th>
            <th>Duration</th>
            <th>Exit type</th>
            <th>Enter:wait for images</th>
            </thead>
            <tbody>
            {% for s in timestamps %}
                <tr>

                    <td>{{ s.participant.session.code }}</td>
                    <td>{{ s.participant.code }}</td>
                    <td>{{ s.app_name }}</td>
                    <td>{{ s.player.round_number }}</td>
                    <td>{{ s.page_name }}</td>
                    <td>{{ s.enter.timestamp|date:'Y-m-d H:i:s.u' }}</td>
                    <td>{{ s.timestamp|date:'Y-m-d H:i:s.u' }}</td>
                    <td>{{ s.diff }}</td>
                    <td>{{ s.get_exit_type_display }}</td>
                    <td>{{ s.enter.get_wait_for_images_display }}</td>


                </tr>
            {% endfor %}
            </tbody>
        </table>
        {% include 'otree_tools/includes/pagination_footer.html' %}
    {% else %}
        No information about time tracking is available. If you want to track time spent per page, insert
        <code>{% verbatim %} {%&nbsp;tracking_time&nbsp;%} {% endverbatim %}</code> to a corresponding template.
    {% endif %}
{% endblock %}

{% block internal_styles %}
    {{ block.super }}
    <style>
        .red {
            color: red
        }

        .green {
            color: green
        }
    </style>
{% endblock %}

{% block internal_scripts %}
    {{ block.super }}
    <script>
        var tracker_type = 'time';
    </script>
    <script src="{% static "otree_tools/js/export.js" %}"></script>
{% endblock %}

