simple_drilldown 0.9.6 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/drilldown/_fields.html.erb +2 -2
- data/app/views/drilldown/_row_header.html.erb +1 -1
- data/app/views/drilldown/_summary_table.html.erb +16 -14
- data/app/views/drilldown/_summary_total_row.html.erb +8 -0
- data/lib/simple_drilldown/controller.rb +9 -1
- data/lib/simple_drilldown/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf78b23713b09e5007b4b8ab3c084e511bdb2cd620f45b9e8d8f4b8d181729c
|
4
|
+
data.tar.gz: 37110d16927f895350153faaec36bead96f2bf9f6b4263e014eaffe46eb52ecc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a1f536867c67dd52cebfc34ed71e0c67e121f181afc0b169e00640176776fb9909ac049214eaadc06e886744cde84efc35d70a1009a6977478c90141254bc2
|
7
|
+
data.tar.gz: 4ac0a883010bdddfe9e5eaa81d87e41f8f5e2ea018d33297c80395154c9b2c45ca8efd024edb465cda8c779f24a0ca00d5a15b8cb6ac4ebe0d0d72647c6e5747
|
@@ -6,7 +6,7 @@
|
|
6
6
|
</style>
|
7
7
|
|
8
8
|
<% @transaction_fields.each do | field | %>
|
9
|
-
<%=form.label "fields[#{field}]", t(field, default: :"attributes.#{field}"), :
|
10
|
-
<%=form.check_box :fields, :
|
9
|
+
<%=form.label "fields[#{field}]", t(field, default: [:"attributes.#{field}", field.humanize]), class: "field_label" %>
|
10
|
+
<%=form.check_box :fields, id: "search_fields[#{field}]", name: "search[fields][#{field}]", checked: @search.fields.include?(field) %>
|
11
11
|
<br/>
|
12
12
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<thead>
|
2
2
|
<tr>
|
3
3
|
<% @search.fields.each do |field| %>
|
4
|
-
<th><%= t field, default: :"attributes.#{field}" %></th>
|
4
|
+
<th><%= t field, default: [:"attributes.#{field}", field.humanize] %></th>
|
5
5
|
<% end %>
|
6
6
|
<th>
|
7
7
|
<%= render 'drilldown/export_links', records: records %>
|
@@ -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)
|
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.11
|
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
|