-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.html.erb
135 lines (132 loc) · 6.33 KB
/
table.html.erb
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coq bench</title>
<link rel="shortcut icon" type="image/png" href="../../../favicon.png" />
<link href="../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href=""><%= h("#{mode} / #{repository}") %></a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../../..">« Up</a>
<h1><%= h(repository.capitalize) %> <small><%= h(database.number_of_packages(architecture, repository)) %> packages</small></h1>
<% os, machine, ocaml, opam = architecture.split("-") %>
<p><em><%= h("#{os}, #{machine}, OCaml #{ocaml}, Opam #{opam}") %></em></p>
<p>The <em>summary</em> column gives the worst case for each row. Colors:</p>
<ul class="list-inline">
<li class="bg-success">Success</li>
<li class="bg-info">Not compatible</li>
<li class="bg-warning">Error with dependencies</li>
<li class="bg-danger">Error</li>
</ul>
<table class="table table-striped text-center">
<thead>
<tr>
<td></td>
<td></td>
<% for coq_version in database.coq_versions(architecture, repository) %>
<td><small><script>document.write(moment("<%= h(database.in_memory[architecture][repository][coq_version][:time].strftime("%F %T")) %> +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></small></td>
<% end %>
<% if best_time = database.coq_versions(architecture, repository).map {|coq_version| database.in_memory[architecture][repository][coq_version][:time]}.min %>
<td><small><script>document.write(moment("<%= h(best_time.strftime("%F %T")) %> +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></small></td>
<% else %>
<td></td>
<% end %>
</tr>
<tr>
<td></td>
<td></td>
<% for coq_version in database.coq_versions(architecture, repository) %>
<td><%= h(coq_version) %></td>
<% end %>
<td>summary</td>
</tr>
<tr>
<td>Name</td>
<td>Version</td>
<% def pill(label, number) number.to_i != 0 ? "<span class=\"label label-#{label}\">#{number}</span>" : "" end %>
<% for coq_version in database.coq_versions(architecture, repository) %>
<% stats = database.stats(architecture, repository, coq_version) %>
<td>
<small>
<%= pill("info", h(stats[4])) %>
<%= pill("success", h(stats[2])) %>
<%= pill("warning", h(stats[1])) %>
<%= pill("danger", h(stats[0])) %>
</small>
</td>
<% end %>
<td>
<small>
<% stats = database.worst_stats(architecture, repository) %>
<%= pill("info", h(stats[4])) %>
<%= pill("success", h(stats[2])) %>
<%= pill("warning", h(stats[1])) %>
<%= pill("danger", h(stats[0])) %>
</small>
</td>
</tr>
</thead>
<tbody>
<% for name, results in database.packages_hash(architecture, repository).sort %>
<% first_row = true %>
<% for version in results.keys.sort {|x, y| database.compare_versions(x, y)} %>
<% current_results = results[version] %>
<% worst = 4 %>
<tr>
<td><%= first_row ? h(name) : "" %></td>
<td><%= h(version) %></td>
<% for coq_version in database.coq_versions(architecture, repository) %>
<% if result = current_results[coq_version] then %>
<% worst = [worst, result.status.to_i].min %>
<td class="<%= result.status.css_class %>"><a href="<%= "#{u(coq_version)}/#{u(name)}/#{u(version)}.html" %>"><%= h(result.short_message) %></a></td>
<% else %>
<td></td>
<% end %>
<% end %>
<td class="<%= ["danger", "warning", "success", "default", "info"][worst] %>"><%= h(["Error", "Error", "Success", "BL", "NC"][worst]) %></td>
</tr>
<% first_row = false %>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../bootstrap.min.js"></script>
</body>
</html>