-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests_to_redo.tpl
87 lines (75 loc) · 3.45 KB
/
tests_to_redo.tpl
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<h1> Tests to redo (DBPhone) - Week {{week}}</h1>
<script>
$('#more').click(function () {
if($('button span').hasClass('glyphicon-chevron-down'))
{
$('#more').html('<span class="glyphicon glyphicon-chevron-up"></span> Less Info');
}
else
{
$('#more').html('<span class="glyphicon glyphicon-chevron-down"></span> More Info');
}
});
</script>
<div class="container">
<table class="table table-hover table-striped">
<thead>
<tr>
<th class="text-left">Category</th>
<th class="text-left">Number of tests to clean</th>
<th class="text-left">Tunedfields</th>
<th class="text-left">Evolution (3 weeks)</th>
</tr>
</thead>
%from collections import Counter
%for key, value in sorted(stats_categories[week].iteritems(), key=lambda x:x[1], reverse=True):
<tr>
<td class="text-left">{{key[0]}}</td>
<td class="text-left">{{value[0]}}</td>
<td class="text-left">
<script>
$(document).ready(function() {
$('#toggle_{{key[0]}}').click(function() {
$('#tunedfields_{{key[0]}}').toggle('fast');
});
})
</script>
<script>
$('#t_{{key[0]}}').on('shown.bs.collapse', function () {
$(".glyphicon").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down");
});
$('#t_{{key[0]}}').on('hidden.bs.collapse', function () {
$(".glyphicon").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up");
});
</script>
<button data-toggle="collapse" data-target="#t_{{key[0]}}"><i class="glyphicon glyphicon-large glyphicon-chevron-up"></i></button>
<div class="collapse" id="t_{{key[0]}}">
<table class="table table-hover table-striped" id="tunedfields_{{key[0]}}">
<thead>
<tr>
<th class="text-left">Name</th>
<th class="text-left">Number of tests to clean</th>
<th class="text-left">Evolution (3 weeks)</th>
</tr>
</thead>
%for key_t, val_t in sorted(Counter([v for y in value[1] for v in y]).iteritems(), key=lambda x: x[1], reverse=True):
% evol_tunedfield = val_t - Counter([val for y in stats_categories[week - 3][key][1] for val in y])[key_t]
% if evol_tunedfield > 0:
<tr style="color:red; font-weight:bold"><td class="text-left" >{{key_t}}</td><td>{{val_t}}</td><td>{{evol_tunedfield}}</td></tr>
%elif evol_tunedfield < 0:
<tr style="color:green; font-weight:bold"><td class="text-left">{{key_t}}</td><td>{{val_t}}</td><td>{{evol_tunedfield}}</td></tr>
%else:
<tr><td class="text-left">{{key_t}}</td><td>{{val_t}}</td><td>{{evol_tunedfield}}</td></tr>
%end
%end
</table>
</div>
</td>
<td class="text-center">
{{sum([v for _, v in Counter([v for y in value[1] for v in y]).iteritems()]) - sum([v for _, v in Counter([v for y in stats_categories[week - 3][key][1] for v in y]).iteritems()])}}
<a href="static/img/{{key[0]}}.svg" target="popup" onclick='window.open(this.href,"popupwindow", "width=1000,height=600,scrollbars,toolbar=0,resizable"); return false;' Target='_blank'><img src="static/img/graph.png"/></a>
</td>
</tr>
%end
</table>
</div>