rail_stat_generator 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/templates/app/controllers/rail_stat_controller.rb +126 -111
- data/templates/app/helpers/rail_stat_helper.rb +13 -14
- data/templates/app/models/iptoc.rb +3 -1
- data/templates/app/models/rail_stat.rb +256 -130
- data/templates/app/models/search_term.rb +6 -4
- data/templates/app/views/rail_stat/hits.rhtml +30 -19
- data/templates/app/views/rail_stat/lang.rhtml +24 -12
- data/templates/app/views/rail_stat/other.rhtml +49 -24
- data/templates/app/views/rail_stat/path.rhtml +13 -15
- data/templates/app/views/rail_stat/platform.rhtml +26 -10
- data/templates/app/views/rail_stat/refs.rhtml +21 -9
- data/templates/db/railstat.mysql.sql +44 -43
- data/templates/db/railstat.pgsql.sql +47 -46
- data/templates/lib/path_tracker.rb +6 -3
- metadata +3 -2
@@ -1,130 +1,256 @@
|
|
1
|
-
class RailStat < ActiveRecord::Base
|
2
|
-
|
3
|
-
# Method returns paths hash with to 40 paths whith value = top index (1..40)
|
4
|
-
|
5
|
-
|
6
|
-
find_by_sql("SELECT resource, COUNT(resource) AS requests,
|
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
|
-
|
1
|
+
class RailStat < ActiveRecord::Base
|
2
|
+
|
3
|
+
# Method returns paths hash with to 40 paths whith value = top index (1..40)
|
4
|
+
|
5
|
+
def RailStat.resource_count_totals()
|
6
|
+
find_by_sql("SELECT resource, COUNT(resource) AS requests, max(created_at) AS last_access FROM rail_stats GROUP BY resource ORDER BY requests DESC")
|
7
|
+
end
|
8
|
+
|
9
|
+
def RailStat.find_all_by_flag(include_search_engine, number_hits, subdomain)
|
10
|
+
if subdomain.nil?
|
11
|
+
if include_search_engine
|
12
|
+
find(:all, :conditions => "browser <> 'Crawler/Search Engine'", :order => "created_at desc", :limit => number_hits)
|
13
|
+
else
|
14
|
+
find(:all, :order => "created_at desc", :limit => number_hits)
|
15
|
+
end
|
16
|
+
else
|
17
|
+
if include_search_engine
|
18
|
+
find(:all, :conditions => ["subdomain = ? and browser <> 'Crawler/Search Engine'", subdomain], :order => "created_at desc", :limit => number_hits)
|
19
|
+
else
|
20
|
+
find(:all, :conditions => ["subdomain = ?", subdomain], :order => "created_at desc", :limit => number_hits)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
####
|
26
|
+
#
|
27
|
+
# Misc Methods (What are these?)
|
28
|
+
#
|
29
|
+
####
|
30
|
+
|
31
|
+
def marked?
|
32
|
+
(@marked and @marked == true)
|
33
|
+
end
|
34
|
+
|
35
|
+
def mark
|
36
|
+
@marked = true
|
37
|
+
end
|
38
|
+
|
39
|
+
def RailStat.get_ordered40resources(subdomain)
|
40
|
+
ordered_resources = []
|
41
|
+
if subdomain.nil?
|
42
|
+
find_by_sql("SELECT resource, COUNT(resource) AS requests, max(created_at) AS created_at " +
|
43
|
+
"FROM rail_stats " +
|
44
|
+
"GROUP BY resource ORDER BY created_at DESC LIMIT 40").each { |row|
|
45
|
+
ordered_resources << row
|
46
|
+
}
|
47
|
+
else
|
48
|
+
find_by_sql("SELECT resource, COUNT(resource) AS requests, max(created_at) AS created_at " +
|
49
|
+
"FROM rail_stats WHERE subdomain = '#{subdomain}' " +
|
50
|
+
"GROUP BY resource ORDER BY created_at DESC LIMIT 40").each { |row|
|
51
|
+
ordered_resources << row
|
52
|
+
}
|
53
|
+
end
|
54
|
+
i = 1
|
55
|
+
orh = {}
|
56
|
+
ordered_resources = ordered_resources.sort {|x,y| y['requests'].to_i <=> x['requests'].to_i }
|
57
|
+
ordered_resources.each { |row|
|
58
|
+
orh[row['resource']] = i
|
59
|
+
i = i + 1
|
60
|
+
} unless ordered_resources.nil? or ordered_resources.size == 0
|
61
|
+
return orh, ordered_resources
|
62
|
+
end
|
63
|
+
|
64
|
+
def datetime
|
65
|
+
Time.at(self.created_at)
|
66
|
+
end
|
67
|
+
|
68
|
+
####
|
69
|
+
#
|
70
|
+
# Counters
|
71
|
+
#
|
72
|
+
####
|
73
|
+
|
74
|
+
###
|
75
|
+
# count_hits
|
76
|
+
#
|
77
|
+
# parameters:
|
78
|
+
# :unique => get stats for distinct remote IPs
|
79
|
+
# :subdomain => restrict results to a single subdomain
|
80
|
+
# :date => restrict results to a single date
|
81
|
+
#
|
82
|
+
# examples:
|
83
|
+
# RailStat.count_hits : returns stats for all hits
|
84
|
+
# RailStat.count_hits(:unique) : returns stats for only unique IPs
|
85
|
+
# RailStat.count_hits(:date => d) : returns stats for the date 'd'
|
86
|
+
# RailStat.count_hits(:unique, :subdomain => "mydomain", :date => d) : returns stats for unique IPs accessing the specified subdomain on the date 'd'
|
87
|
+
###
|
88
|
+
|
89
|
+
def RailStat.count_hits(*params)
|
90
|
+
|
91
|
+
query = "select"
|
92
|
+
where = ""
|
93
|
+
|
94
|
+
if params.include?(:unique)
|
95
|
+
query << " count(distinct remote_ip)"
|
96
|
+
else
|
97
|
+
query << " count(*)"
|
98
|
+
end
|
99
|
+
|
100
|
+
query << " as hits from rail_stats"
|
101
|
+
|
102
|
+
if params.size == 1
|
103
|
+
if params[0].class == Hash
|
104
|
+
options = params[0]
|
105
|
+
end
|
106
|
+
elsif params.size == 2
|
107
|
+
options = params[1]
|
108
|
+
end
|
109
|
+
|
110
|
+
if options
|
111
|
+
if options[:subdomain]
|
112
|
+
where << " subdomain = '#{options[:subdomain]}'"
|
113
|
+
end
|
114
|
+
|
115
|
+
if options[:subdomain] and (options[:date] or options[:past_days])
|
116
|
+
where << " AND"
|
117
|
+
end
|
118
|
+
|
119
|
+
if options[:date]
|
120
|
+
where << " created_on = '#{options[:date]}'"
|
121
|
+
elsif options[:past_days]
|
122
|
+
where << " created_on >= '#{(Time.now - options[:past_days]*24*60*60).strftime("%Y-%m-%d")}'"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
query << " where " << where if where != ""
|
127
|
+
query << ";"
|
128
|
+
|
129
|
+
find_by_sql(query)[0]['hits'].to_i
|
130
|
+
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
####
|
135
|
+
#
|
136
|
+
# Finders
|
137
|
+
#
|
138
|
+
####
|
139
|
+
|
140
|
+
##
|
141
|
+
# find_by_days: Find the hits in the specified previous X days. Default is 7 days.
|
142
|
+
##
|
143
|
+
def RailStat.find_by_days(params = {})
|
144
|
+
params[:days] = 7 unless params[:days]
|
145
|
+
query = "SELECT created_on, COUNT(*) AS total_hits, COUNT(DISTINCT remote_ip) AS unique_hits FROM rail_stats WHERE created_on >= '#{(Time.now - params[:days]*24*60*60).strftime("%Y-%m-%d")}'"
|
146
|
+
query << " AND subdomain = '#{params[:subdomain]}'" if params[:subdomain]
|
147
|
+
query << " GROUP BY created_on;"
|
148
|
+
find_by_sql(query)
|
149
|
+
end
|
150
|
+
|
151
|
+
##
|
152
|
+
# find_first_hit: What is this used for?
|
153
|
+
##
|
154
|
+
def RailStat.find_first_hit(params = {})
|
155
|
+
if params[:subdomain].nil?
|
156
|
+
find(:first, :order => "created_at ASC")
|
157
|
+
else
|
158
|
+
find(:first, :conditions => ["subdomain = ?", params[:subdomain]], :order => "created_at ASC")
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def RailStat.find_by_platform(params = {})
|
163
|
+
if params[:subdomain].nil?
|
164
|
+
find_by_sql("SELECT platform, COUNT(platform) AS total " +
|
165
|
+
"FROM rail_stats " +
|
166
|
+
"GROUP BY platform " +
|
167
|
+
"ORDER BY total DESC; ")
|
168
|
+
else
|
169
|
+
find_by_sql("SELECT platform, COUNT(platform) AS total " +
|
170
|
+
"FROM rail_stats " +
|
171
|
+
"WHERE subdomain = '#{params[:subdomain]}' " +
|
172
|
+
"GROUP BY platform " +
|
173
|
+
"ORDER BY total DESC; ")
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def RailStat.find_by_browser(params = {})
|
178
|
+
if params[:subdomain].nil?
|
179
|
+
find_by_sql("SELECT browser, version, COUNT(*) AS total " +
|
180
|
+
"FROM rail_stats " +
|
181
|
+
"GROUP BY browser, version " +
|
182
|
+
"ORDER BY total DESC; ")
|
183
|
+
else
|
184
|
+
find_by_sql("SELECT browser, version, COUNT(*) AS total " +
|
185
|
+
"FROM rail_stats " +
|
186
|
+
"WHERE subdomain = '#{params[:subdomain]}'" +
|
187
|
+
"GROUP BY browser, version " +
|
188
|
+
"ORDER BY total DESC; ")
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def RailStat.find_by_language(params = {})
|
193
|
+
if params[:subdomain].nil?
|
194
|
+
find_by_sql("SELECT language, COUNT(*) AS total " +
|
195
|
+
"FROM rail_stats " +
|
196
|
+
"WHERE language != '' and language is not null and language != 'empty' " +
|
197
|
+
"GROUP BY language " +
|
198
|
+
"ORDER BY total DESC; ")
|
199
|
+
else
|
200
|
+
find_by_sql("SELECT language, COUNT(*) AS total " +
|
201
|
+
"FROM rail_stats " +
|
202
|
+
"WHERE language != '' and language is not null and language != 'empty' and subdomain = '#{params[:subdomain]}'" +
|
203
|
+
"GROUP BY language " +
|
204
|
+
"ORDER BY total DESC; ")
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def RailStat.find_by_country(params = {})
|
209
|
+
if params[:subdomain].nil?
|
210
|
+
find_by_sql("SELECT country, COUNT(*) AS total " +
|
211
|
+
"FROM rail_stats " +
|
212
|
+
"WHERE country != '' and country is not null " +
|
213
|
+
"GROUP BY country " +
|
214
|
+
"ORDER BY total DESC; ")
|
215
|
+
else
|
216
|
+
find_by_sql("SELECT country, COUNT(*) AS total " +
|
217
|
+
"FROM rail_stats " +
|
218
|
+
"WHERE country != '' and country is not null and subdomain = '#{params[:subdomain]}'" +
|
219
|
+
"GROUP BY country " +
|
220
|
+
"ORDER BY total DESC; ")
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
def RailStat.find_by_domain(params = {})
|
225
|
+
if params[:subdomain].nil?
|
226
|
+
find_by_sql("SELECT domain, referer, resource, COUNT(domain) AS total " +
|
227
|
+
"FROM rail_stats " +
|
228
|
+
"WHERE domain != '' " +
|
229
|
+
"GROUP BY domain, referer, resource " +
|
230
|
+
"ORDER BY total DESC; ")
|
231
|
+
else
|
232
|
+
find_by_sql("SELECT domain, referer, resource, COUNT(domain) AS total " +
|
233
|
+
"FROM rail_stats " +
|
234
|
+
"WHERE domain != '' and subdomain = '#{params[:subdomain]}'" +
|
235
|
+
"GROUP BY domain, referer, resource " +
|
236
|
+
"ORDER BY total DESC; ")
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
def RailStat.find_by_client(params = {})
|
241
|
+
|
242
|
+
|
243
|
+
if params[:subdomain].nil?
|
244
|
+
results = find_by_sql("SELECT #{params[:type]}, COUNT(*) AS total " +
|
245
|
+
"FROM rail_stats " +
|
246
|
+
"GROUP BY #{params[:type]} " +
|
247
|
+
"ORDER BY total DESC; ")
|
248
|
+
else
|
249
|
+
results = find_by_sql("SELECT #{params[:type]}, COUNT(*) AS total " +
|
250
|
+
"FROM rail_stats " +
|
251
|
+
"WHERE subdomain = '#{params[:subdomain]}'" +
|
252
|
+
"GROUP BY #{params[:type]} " +
|
253
|
+
"ORDER BY total DESC; ")
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
@@ -11,9 +11,11 @@ class SearchTerm < ActiveRecord::Base
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.find_grouped(
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def self.find_grouped(params = {})
|
15
|
+
if params[:subdomain].nil?
|
16
|
+
SearchTerm.find_by_sql("SELECT searchterms, COUNT(*) AS total FROM search_terms GROUP BY domain, searchterms, count ORDER BY count DESC;")
|
17
|
+
else
|
18
|
+
SearchTerm.find_by_sql("SELECT searchterms, COUNT(*) AS total FROM search_terms WHERE subdomain = '#{params[:subdomain]}' GROUP BY domain, searchterms, count ORDER BY count DESC;")
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
@@ -1,27 +1,38 @@
|
|
1
1
|
<h1> Statistic on web hits for <%%= @subdomain %> </h1>
|
2
2
|
<%%=render_partial 'menu'%>
|
3
|
-
<h2>Last week hits</h2>
|
4
|
-
<div id="path_stats_lw">
|
5
|
-
<table class="list">
|
6
|
-
<tr><th>Date</th><th>Hits</th></tr>
|
7
|
-
<%% initListClass
|
8
|
-
for day in @lastweek %>
|
9
|
-
<tr class="<%%=popListClass%>">
|
10
|
-
<td><%%=day['hdate']%></td>
|
11
|
-
<td><%%=day['hits']%></td>
|
12
|
-
</tr>
|
13
|
-
<%% end %>
|
14
|
-
</table>
|
15
|
-
</div>
|
16
3
|
|
17
|
-
|
4
|
+
|
5
|
+
<h2>Hits Summary</h2>
|
18
6
|
<div id="path_stats_hs">
|
19
7
|
<table class="list">
|
20
|
-
<tr
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
8
|
+
<tr>
|
9
|
+
<th>Time Period</th>
|
10
|
+
<th>Total Hits</th>
|
11
|
+
<th>Unique Hits</th>
|
12
|
+
</tr>
|
13
|
+
<tr class='<%%= alternator %>'>
|
14
|
+
<td>Today</td>
|
15
|
+
<td><%%= @today_total %></td>
|
16
|
+
<td><%%= @today_unique %></td>
|
17
|
+
</tr>
|
18
|
+
<tr class='<%%= alternator %>'>
|
19
|
+
<td>Past 7 Days</td>
|
20
|
+
<td><%%= @past_7_total %></td>
|
21
|
+
<td><%%= @past_7_unique %></td>
|
22
|
+
</tr>
|
23
|
+
<%% for day in @lastweek -%>
|
24
|
+
<tr class='<%%= alternator %>'>
|
25
|
+
<td> <%%=day['created_on']%></td>
|
26
|
+
<td><%%=day['total_hits']%></td>
|
27
|
+
<td><%%=day['unique_hits']%></td>
|
28
|
+
</tr>
|
29
|
+
<%% end -%>
|
30
|
+
<tr class='<%%= alternator %>'>
|
31
|
+
<td>Since <%%= @first_hit.datetime %></td>
|
32
|
+
<td><%%= @total_hits %></td>
|
33
|
+
<td><%%= @unique_hits %></td>
|
34
|
+
</tr>
|
35
|
+
|
25
36
|
</table>
|
26
37
|
</div>
|
27
38
|
</div>
|
@@ -3,23 +3,35 @@
|
|
3
3
|
<h2>Languages</h2>
|
4
4
|
<div id="path_stats_lang">
|
5
5
|
<table class="list">
|
6
|
-
<tr
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
<tr>
|
7
|
+
<th>Language</th>
|
8
|
+
<th>Percentage</th>
|
9
|
+
<th>Hit Count</th>
|
10
|
+
</tr>
|
11
|
+
<%% for language in @languages %>
|
12
|
+
<tr class='<%%= alternator %>'>
|
13
|
+
<td><%%= get_lang(language.language) %></td>
|
14
|
+
<td><%%= sprintf("%000.2f", (language.total.to_f/@total_hits)*100) %>%</td>
|
15
|
+
<td><%%= language.total %></td>
|
16
|
+
</tr>
|
17
|
+
<%% end %>
|
11
18
|
</table>
|
12
19
|
</div>
|
13
20
|
|
14
21
|
<h2>Countries</h2>
|
15
22
|
<div id="path_stats_country">
|
16
23
|
<table class="list">
|
17
|
-
<tr
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
24
|
+
<tr>
|
25
|
+
<th>Country</th>
|
26
|
+
<th>Percentage</th>
|
27
|
+
<th>Hit Count</th>
|
28
|
+
</tr>
|
29
|
+
<%% for country in @countries %>
|
30
|
+
<tr class="<%%= alternator %>">
|
31
|
+
<td><%%= country.country %></td>
|
32
|
+
<td><%%= sprintf("%000.2f", (language.total.to_f/@total_hits)*100) %>%</td>
|
33
|
+
<td><%%= country.total %></td>
|
34
|
+
</tr>
|
35
|
+
<%% end %>
|
22
36
|
</table>
|
23
37
|
</div>
|
24
|
-
</div>
|
25
|
-
</div>
|
@@ -3,48 +3,73 @@
|
|
3
3
|
<h2>Flash supported</h2>
|
4
4
|
<div id="path_stats_flash">
|
5
5
|
<table class="list">
|
6
|
-
<tr
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
<tr>
|
7
|
+
<th width='50%'>Version</th>
|
8
|
+
<th>Percentage</th>
|
9
|
+
</tr>
|
10
|
+
<%% for flash_client in @flash_clients %>
|
11
|
+
<tr class="<%%= alternator %>">
|
12
|
+
<td><%%= path_version_data(flash_client['flash']) %></td>
|
13
|
+
<td><%%= sprintf("%000.2f", (flash_client.total.to_f/@flash_clients_total)*100) %> %</td>
|
14
|
+
</tr>
|
15
|
+
<%% end %>
|
11
16
|
</table>
|
12
17
|
</div>
|
13
18
|
|
14
19
|
<h2>JavaVM Enabled</h2>
|
15
20
|
<table class="list">
|
16
|
-
<tr
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
<tr>
|
22
|
+
<th width='50%'>Version</th>
|
23
|
+
<th>Percentage</th>
|
24
|
+
</tr>
|
25
|
+
<%% for java_client in @java_clients %>
|
26
|
+
<tr class="<%%= alternator %>">
|
27
|
+
<td><%%= path_version_data(java_client['java_enabled']) %></td>
|
28
|
+
<td><%%= sprintf("%000.2f", (java_client.total.to_f/@java_clients_total)*100) %> %</td>
|
29
|
+
</tr>
|
30
|
+
<%% end %>
|
21
31
|
</table>
|
22
32
|
|
23
33
|
<h2>Javascript suported</h2>
|
24
34
|
<table class="list">
|
25
|
-
<tr
|
26
|
-
|
27
|
-
|
28
|
-
|
35
|
+
<tr>
|
36
|
+
<th width='50%'>JavaScript</th>
|
37
|
+
<th>Percentage</th>
|
38
|
+
</tr>
|
39
|
+
<%% for javascript_client in @javascript_clients %>
|
40
|
+
<tr class="<%%= alternator %>">
|
41
|
+
<td><%%= path_version_data(javascript_client['java']) %></td>
|
42
|
+
<td><%%= sprintf("%000.2f", (javascript_client.total.to_f/@javascript_clients_total)*100) %> %</td>
|
43
|
+
</tr>
|
29
44
|
<%% end %>
|
30
45
|
</table>
|
31
46
|
|
32
47
|
<h2>Screen width</h2>
|
33
48
|
<table class="list">
|
34
|
-
<tr
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
49
|
+
<tr>
|
50
|
+
<th width='50%'>Width</th>
|
51
|
+
<th>Percentage</th>
|
52
|
+
</tr>
|
53
|
+
<%% for width_of_client in @width_of_clients %>
|
54
|
+
<tr class="<%%= alternator %>">
|
55
|
+
<td><%%= path_version_data(width_of_client['screen_size']) %></td>
|
56
|
+
<td><%%= sprintf("%000.2f", (width_of_client.total.to_f/@width_of_clients_total)*100) %> %</td>
|
57
|
+
</tr>
|
58
|
+
<%% end %>
|
39
59
|
</table>
|
40
60
|
|
41
61
|
<h2>Color depth</h2>
|
42
62
|
<table class="list">
|
43
|
-
<tr
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
63
|
+
<tr>
|
64
|
+
<th width='50%'>Color depth</th>
|
65
|
+
<th>Percentage</th>
|
66
|
+
</tr>
|
67
|
+
<%% for colors_of_client in @colors_of_clients %>
|
68
|
+
<tr class="<%%= alternator %>">
|
69
|
+
<td><%%= path_version_data(colors_of_client['colors']) %></td>
|
70
|
+
<td><%%= sprintf("%000.2f", (colors_of_client.total.to_f/@colors_of_clients_total)*100) %> %</td>
|
71
|
+
</tr>
|
72
|
+
<%% end %>
|
48
73
|
</table>
|
49
74
|
|
50
75
|
</div>
|