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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3144b3e6cb99f07f654f2045836172d74c29bca1016787fcc9de9dd4bbdff211
4
- data.tar.gz: d18da3c55b9ee565dadd892f14d4feae817094c7f100ada2d4aaebd975e80a1a
3
+ metadata.gz: 4bf78b23713b09e5007b4b8ab3c084e511bdb2cd620f45b9e8d8f4b8d181729c
4
+ data.tar.gz: 37110d16927f895350153faaec36bead96f2bf9f6b4263e014eaffe46eb52ecc
5
5
  SHA512:
6
- metadata.gz: af25dfcb777c5d1f01d854a456a3b7ce954e9715244d71bb6dd69681df9a15f81e1b73853e59c3bb4abe1eee6bdd33a09be9393bfd35e8eb8d2227a1b3d4788a
7
- data.tar.gz: b3f6706f4024d14b5d248083ca922374b2710ec012bed7f7af4cb65a8e854a735473793097210391ac0c52ecdb02a78898211e29b1e0ac106036b53c98378723
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}"), :class => "field_label" %>
10
- <%=form.check_box :fields, :id => "search_fields[#{field}]", :name => "search[fields][#{field}]", :checked => @search.fields.include?(field) %>
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
- <table id="drilldown-summary-table" class="table table-sm table-bordered">
2
- <thead>
3
- <tr>
4
- <% @dimensions.each do |d| %>
5
- <th><%= h d[:pretty_name] %></th>
6
- <% end %>
7
- <th><%= t controller.c_target_class.table_name.capitalize %></th>
8
- <%= controller.c_summary_fields.map { |l| "<th>#{t(l)}</th>" }.join("\n").html_safe %>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <%= summary_row(@result) %>
13
- </tbody>
14
- </table>
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)
@@ -1,3 +1,3 @@
1
1
  module SimpleDrilldown
2
- VERSION = '0.9.6'
2
+ VERSION = '0.9.11'
3
3
  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.6
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-05-25 00:00:00.000000000 Z
11
+ date: 2021-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caxlsx_rails