_results.html.j2 1.92 KB
Newer Older
Štěpán Henek's avatar
Štěpán Henek committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{% set ns = namespace(my_url=None,detail_url=None) %}
{% if lang() == "cs" %}
    {% set ns.my_url = "https://www.netmetr.cz/cs/moje.html" %}
    {% set ns.detail_url = "https://www.netmetr.cz/cs/detail.html" %}
{% else %}
    {% set ns.my_url = "https://www.netmetr.cz/en/my.html" %}
    {% set ns.detail_url = "https://www.netmetr.cz/en/detail.html" %}
{% endif %}

<div id="netmetr-results">
    {% if results %}
    <table id="netmetr-results-table">
        <thead>
            <tr>
                <th>{% trans %}Date and Time{% endtrans %}</th>
                <th>{% trans %}Download [Mb/s]{% endtrans %}</th>
                <th>{% trans %}Upload [Mb/s]{% endtrans %}</th>
                <th>{% trans %}Ping [ms]{% endtrans %}</th>
                <th>{% trans %}Link{% endtrans %}</th>
            </tr>
        </thead>
        <tbody>
    {% for record in results %}
            <tr>
                <td>{{ record["time"] }}</td>
Štěpán Henek's avatar
Štěpán Henek committed
26
27
                <td>{{ "%0.2f" | format(record["speed_download"]) }}</td>
                <td>{{ "%0.2f" | format(record["speed_upload"]) }}</td>
28
                <td>{% if record["ping"] >= 0 %}{{ "%0.2f" | format(record["ping"]) }}{% else %}N/A{% endif %}</td>
Štěpán Henek's avatar
Štěpán Henek committed
29
30
31
32
33
34
35
36
37
38
39
                <td>
                    <a href="{{ "%s?%s" % (ns.detail_url, record["test_uuid"]) }}">{% trans %}Details{% endtrans %}</a>
                    &nbsp;
                    <a href="{{ "%s?%s" % (ns.detail_url, record["test_uuid"]) }}" title="{% trans %}Details in new window{% endtrans %}" onclick="return !window.open(this.href)"><i class="far fa-clone"></i></a>
                </td>
            </tr>
    {% endfor %}
        </tbody>
    </table>

    <br>
40
    <p>{% trans sync_code=sync_code, url=ns.my_url %}For more information, you need to enter your sync code <strong>{{ sync_code }}</strong> <a href='{{ url }}'>here</a>.{% endtrans %}</p>
Štěpán Henek's avatar
Štěpán Henek committed
41
42
43
44
    {% else %}
    <p>{% trans %}No results found.{% endtrans %}</p>
    {% endif %}
</div>