query_report 1.1.2 → 1.1.3

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
  SHA1:
3
- metadata.gz: 43187b542e2b2f2fe34fd7e25b489b50227fee5f
4
- data.tar.gz: 8fdff9153ed76142aa42d7af7f8d5e4b892fbb75
3
+ metadata.gz: ed84b0fb9e481633748b9b6d0733f6d858acc507
4
+ data.tar.gz: 2131aecc3f7ce894730d78a9efded7cf15eac732
5
5
  SHA512:
6
- metadata.gz: 27ec5569dbd669ce8accbe73eab9b9f5cd96419817f7b77b30d64b9222da118134d44950db950a913e65159aa6116f80ba06ce00882e379a4c470378adacf534
7
- data.tar.gz: e089420de5bc97df677c94af2ce4e1da51d3ab4d8bc28582c15f468cbe823b674dec1b166be350630e4dbec8e77f3b7b2c6ce001152bedcc81f85a5afd5101cb
6
+ metadata.gz: 743c89af7eef08fe8925781a8ebb8bbe9b008a6698fb4efc611e8f9190009eab4cd03b3aa251af95c53bb51526467eac91f72a5b8de193b1210179dbe3e3c2b2
7
+ data.tar.gz: 40976a96ad155d08196e8cbb6c40012ba97f1520f2807bbe1804d788b16549078bc69c7697c6e6ff4026edff4e9bee51fbc6e45c1010ff8089ff053f7832cb1b
@@ -1,4 +1,5 @@
1
- <%= search_form_for report.search, url: url_for({}), remote: @remote, html: {:method => :get, :class => 'form-inline'} do |f| %>
1
+ <%= search_form_for report.search, url: url_for({}), remote: @remote,
2
+ html: (QueryReport.config.search_form_options || {}).merge(method: :get) do |f| %>
2
3
  <% report.filters.each do |filter| %>
3
4
  <% filter.comparators.each do |comparator| %>
4
5
  <%= query_report_render_filter(filter, comparator) %>
@@ -4,6 +4,7 @@ if ($('#<%=params['target_dom_id']%> .query_report_content').length == 0) {
4
4
  } else {
5
5
  $('#<%=params['target_dom_id']%> .query_report_content').html('<%= escape_javascript(render :partial => 'query_report/content', locals: {report: @report})%>');
6
6
  }
7
+ eval($('script.chart_script').text());
7
8
  <% else %>
8
9
  console.log("target_dom_id was not defined");
9
10
  <% end %>
data/lib/query_report.rb CHANGED
@@ -28,5 +28,6 @@ module QueryReport
28
28
  config.allow_email_report = true
29
29
  config.record_table_class = 'table table-bordered table-striped'
30
30
  config.search_button_class = 'btn btn-blue'
31
+ config.search_form_options = {class: 'form-inline'}
31
32
  end
32
33
  end
@@ -7,17 +7,19 @@ require 'chartify/factory'
7
7
  module QueryReport
8
8
  module ChartAdapterModule
9
9
  def chart(chart_type, chart_title, &block)
10
- chart_adapter = ChartAdapter.new(filtered_query, chart_type, chart_title)
10
+ chart_adapter = ChartAdapter.new(filtered_query, all_records, chart_type, chart_title)
11
11
  block.call(chart_adapter)
12
12
  @charts << chart_adapter.chart
13
13
  end
14
14
 
15
15
  class ChartAdapter
16
- attr_accessor :query, :chart_type, :chart
16
+ attr_reader :query, :records
17
+ attr_accessor :chart_type, :chart
17
18
  delegate :data, :data=, :columns, :columns=, :label_column, :label_column=, to: :chart
18
19
 
19
- def initialize(query, chart_type, chart_title)
20
+ def initialize(query, records, chart_type, chart_title)
20
21
  @query = query
22
+ @records = records
21
23
  @chart_type = chart_type
22
24
  @chart = "Chartify::#{chart_type.to_s.camelize}Chart".constantize.new
23
25
  @chart.title = chart_title
@@ -8,5 +8,6 @@ module QueryReport
8
8
  config_accessor :allow_email_report
9
9
  config_accessor :record_table_class
10
10
  config_accessor :search_button_class
11
+ config_accessor :search_form_options
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.K.M. Ashrafuzzaman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-03 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 0.2.1
123
+ version: 0.2.2
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 0.2.1
130
+ version: 0.2.2
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: rake
133
133
  requirement: !ruby/object:Gem::Requirement