total_charge.html
1.12 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
{% extends "base_page.html" %}
{% block content %}
<!-- Invisible span to define wich ul and a in the navbar are actived -->
<span id="nav_actived" style="display: none">cds,total_charge</span>
<table class="table_datatables table table-hover">
<thead>
<tr>
{% for h in total_charges[0] %}
<th scope="col">{{ h }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for h in total_charges[1:] %}
<tr>
<td><a href="{{ url_for('main.agent', agent_id=h[0]) }}">{{ h[1] }}</a></td>
{% for i in h[2:] %}
{% if i is number %}
{% set unit = ' %' %}
{% if i == 0 %}
{% set cell_style = 'table-warning' %}
{% elif i <= 75 %}
{% set cell_style = 'table-info' %}
{% elif i <= 100 %}
{% set cell_style = 'table-success' %}
{% else %}
{% set cell_style = 'table-danger' %}
{% endif %}
{% endif %}
<td class={{ cell_style }}>{{ i }}{{ unit }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}