-
Notifications
You must be signed in to change notification settings - Fork 2
/
report.html.erb
85 lines (81 loc) · 3.05 KB
/
report.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
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<title>I18n report</title>
</head>
<body>
<h1> Missing translations </h1>
<% if @missing.present? %>
<div class="panel panel-default">
<div class="panel-heading"></div>
<h3 class="panel-title"><%= @missing.leaves.count %> missing keys</h3>
</div>
<ul class="nav nav-tabs" role="tablist">
<% @missing.list.each do |locale| %>
<li class="nav-item">
<a class="nav-link"
id="<%= locale.key %>-tab"
href="#<%= locale.key %>"
data-toggle="tab"
role="tab"
aria-controls="<%= locale.key %>"
aria-selected="true">
<%= locale.key %> (<%= locale.leaves.count %>)
</a>
</li>
<% end %>
</ul>
<div class="tab-content" id="tabs">
<% @missing.list.each do |locale| %>
<div class="tab-pane fade" id="<%= locale.key %>" role="tabpanel" aria-labelledby="<%= locale.key %>-tab">
<div class="accordion" id="<%= locale.key %>-accordion">
<% locale.keys.each.group_by { |k, node| node.data[:path] }.each do |path, keys| %>
<%- key = Digest::MD5.hexdigest(path.to_s) %>
<div class="card">
<div class="card-header" id="<%= locale.key %>-<%= key %>-heading">
<h2 class="mb-0">
<button class="btn btn-link"
type="button"
data-toggle="collapse"
data-target="#<%= locale.key %>-<%= key %>-collapse"
aria-expanded="true"
aria-controls="collapseOne">
<%= path %> (<%=keys.length %>)
</button>
</h2>
</div>
<div id="<%= locale.key %>-<%= key %>-collapse"
class="collapse"
aria-labelledby="<%= locale.key %>-<%= key %>-heading"
data-parent="#<%= locale.key %>-accordion">
<div class="card-body">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th> Key</th>
<th> Original Value</th>
</tr>
</thead>
<tbody>
<% keys.each do |key, node| %>
<tr>
<td><%= key %></td>
<td><%= node.value %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<% end %>
</body>
</html>