-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
index.html.erb
106 lines (99 loc) · 2.81 KB
/
index.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
<% @title = 'Statistics' %>
<div class="hero-unit">
<h2>
<%= number_with_delimiter(@public_body_count) %> public authorities
</h2>
<h2>
<%= number_with_delimiter(@info_request_count) %> requests,
<%= number_with_delimiter(@outgoing_message_count) %> outgoing messages,
<%= number_with_delimiter(@incoming_message_count) %> incoming messages
</h2>
<h2>
<%= number_with_delimiter(@user_count) %> users,
<%= number_with_delimiter(@track_thing_count) %> tracked things
</h2>
<h2>
<%= number_with_delimiter(@comment_count) %> annotations
</h2>
</div>
<div class="row">
<div class="span12">
<h1>Statistics</h1>
<h2>Chart of requests (excluding backpaged)</h2>
<% if File.exist?(File.expand_path("public/foi-live-creation.png", Rails.root)) %>
<img src="/foi-live-creation.png" alt="Chart of requests">
<% else %>
No requests yet (the raw data may include the Holding Pen request)
<% end %>
</div>
</div>
<div class="row">
<div class="span12">
<h2>State of requests (includes backpaged)</h2>
<div class="container">
<% for state, count in @request_by_state %>
<div class="row stats-row">
<div class="span1">
<span class="label label-info">
<%= number_with_delimiter(count) %>
</span>
</div>
<div class="span4">
<%=state%>
</div>
</div>
<% end %>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<h2>Chart of users</h2>
<% if File.exist?(File.expand_path("public/foi-user-use.png", Rails.root)) %>
<img src="/foi-user-use.png" alt="Chart of users">
<% else %>
No user data yet
<% end %>
</div>
</div>
<div class="row">
<div class="span12">
<h2>Tracks by type</h2>
<div class="container">
<% for state, count in @tracks_by_type %>
<div class="row stats-row">
<div class="span1">
<span class="label label-info">
<%= number_with_delimiter(count) %>
</span>
</div>
<div class="span4">
<%=state%>
</div>
</div>
<% end %>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<h2>Transactions</h2>
<table class="table table-condensed table-hover">
<% @monthly_transactions.each_with_index do |row, index| %>
<tr>
<% if index.zero? %>
<% row.each do |cell| %>
<th style="text-orientation: sideways; writing-mode: vertical-lr;">
<%= cell %>
</th>
<% end %>
<% else %>
<% row.each do |cell| %>
<%= tag.td cell, class: { muted: cell.to_i.zero? } %>
<% end %>
<% end %>
</tr>
<% end %>
</table>
</div>
</div>