simple_drilldown 0.9.5 → 0.9.10
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20b3fbd48f5942a10b5ffa459c1c9c900f8275d800eb52819945a7aacda37440
|
|
4
|
+
data.tar.gz: cf384149ace94850f19310210d4cc0a278b7dde606753afbe5e43dfd5600e88d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9e55d9444a72c13d3fde5ac7b58f60941299ae15d45fdcfda1dd0b4db385df99b5fbdf36570131328f007da3896a33d0caa26c411c0295cf499279bda5a3e22
|
|
7
|
+
data.tar.gz: f0f6794cd72544eca752af71dcaae8f153de7674424e0eebe7f99f34f453edf1f32caf1fa6b198f41d9b49948d0a7513b5940a9c9177014e77d08ea08d84a6bb
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</
|
|
1
|
+
<div class="table-responsive">
|
|
2
|
+
<table id="drilldown-summary-table" class="table table-sm table-bordered">
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<% @dimensions.each do |d| %>
|
|
6
|
+
<th><%= d[:pretty_name] %></th>
|
|
7
|
+
<% end %>
|
|
8
|
+
<th><%= t controller.c_target_class.table_name, default: controller.c_target_class.table_name.capitalize %></th>
|
|
9
|
+
<%= controller.c_summary_fields.map { |l| "<th>#{t(l)}</th>" }.join("\n").html_safe %>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody>
|
|
13
|
+
<%= summary_row(@result) %>
|
|
14
|
+
</tbody>
|
|
15
|
+
</table>
|
|
16
|
+
</div>
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
<tr class="summary">
|
|
2
2
|
<td colspan="<%= @dimensions.size - dimension %>"></td>
|
|
3
3
|
<td align="right"><%= result[:count] %></td>
|
|
4
|
+
<% controller.c_summary_fields.each do |summary_field| %>
|
|
5
|
+
<td align="right">
|
|
6
|
+
<%= result[summary_field] %>
|
|
7
|
+
<% if @search.percent && parent_result && parent_result[summary_field] > 0 %>
|
|
8
|
+
(<%= 100 * result[summary_field] / parent_result[summary_field] %>%)
|
|
9
|
+
<% end %>
|
|
10
|
+
</td>
|
|
11
|
+
<% end %>
|
|
4
12
|
</tr>
|
|
@@ -85,7 +85,15 @@ module SimpleDrilldown
|
|
|
85
85
|
self.c_summary_fields = summary_fields.flatten
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
def dimension(name, select_expression = name, options = {})
|
|
88
|
+
def dimension(name, select_expression = name.to_s, options = {})
|
|
89
|
+
if select_expression.is_a?(Hash)
|
|
90
|
+
unless options.blank?
|
|
91
|
+
raise "select_expression should be a string: #{select_expression.class}, options: #{options.inspect}"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
options = select_expression
|
|
95
|
+
select_expression = name.to_s
|
|
96
|
+
end
|
|
89
97
|
interval = options.delete(:interval)
|
|
90
98
|
label_method = options.delete(:label_method)
|
|
91
99
|
legal_values = options.delete(:legal_values) || legal_values_for(name)
|
|
@@ -89,7 +89,8 @@ module SimpleDrilldown
|
|
|
89
89
|
private
|
|
90
90
|
|
|
91
91
|
def caption_txt
|
|
92
|
-
"#{controller.c_target_class} #{I18n.t(@search.select_value.downcase
|
|
92
|
+
"#{controller.c_target_class} #{I18n.t(@search.select_value.downcase,
|
|
93
|
+
default: @search.select_value.to_s.titleize)}" +
|
|
93
94
|
(@dimensions && @dimensions.any? ? " by #{@dimensions.map { |d| d[:pretty_name] }.join(' and ')}" : '')
|
|
94
95
|
end
|
|
95
96
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_drilldown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Uwe Kubosch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-06-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: caxlsx_rails
|