wice_grid 3.4.7 → 3.4.8

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: 86104c55ad7c39afcbeede0d70eec14a954b5497
4
- data.tar.gz: 1b4ae6d4a83a84a5edbb6d9efd467dc46279d261
3
+ metadata.gz: 56c4efa80c0a6215fc1061dd5194651b13628416
4
+ data.tar.gz: 8f53a3c0bc5c10ab9792f9fbefab14072b6b0aa6
5
5
  SHA512:
6
- metadata.gz: 4d0958d90066286fb45c88f5b15e7814bb7f5811b36e137e4a8a65cbfb7a2c8c123d78659498d2958ad587f98dd4a43a8f451b95e63d32dfedc7231b2d91a5fa
7
- data.tar.gz: 10dfac4dacf0d6e4b2b7d9dcf3d6737899329ea8ee2d8fe9bc995e44fecbd6b060b32a96bb1ad345ebcd6a5a7baab0ef3bf803c65b6a843e651afa71bbf44189
6
+ metadata.gz: 57575d15eabd156f2a51c9ccf88d0ba2992ccd2170dcb482d39a924989324ca676f556f2aefc9d47bd1ffea8bd4ee2c7b3353ae175a11919fa8aba7d41af5357
7
+ data.tar.gz: 068a7f6eb8d7680534ba57fc81946930ecda55b4453097c644f5bf751e06214b53af0aca848638cf39c42b0af57970a60806dbbeb65148bdcf8d7d931bedac9c
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = WiceGrid
2
2
 
3
- Version:: 3.4.7
3
+ Version:: 3.4.8
4
4
  Author:: Yuri Leikind
5
5
  Sources:: https://github.com/leikind/wice_grid/
6
6
  Examples online:: http://wicegrid.herokuapp.com
@@ -166,4 +166,6 @@ if defined?(Wice::Defaults)
166
166
  # popup calendar will be shown relative to the popup trigger element or to the mouse pointer
167
167
  Wice::Defaults::POPUP_PLACEMENT_STRATEGY = :trigger # :pointer
168
168
 
169
- end
169
+ # The name of the page method (should correspond to Kaminari.config.page_method_name)
170
+ Wice::Defaults::PAGE_METHOD_NAME = :page
171
+ end
data/lib/wice_grid.rb CHANGED
@@ -92,27 +92,33 @@ module Wice
92
92
  raise WiceGridArgumentError.new(":order_direction must be either 'asc' or 'desc'.")
93
93
  end
94
94
 
95
- # options that are understood
96
- @options = {
97
- :conditions => nil,
98
- :csv_file_name => nil,
99
- :csv_field_separator => Defaults::CSV_FIELD_SEPARATOR,
100
- :custom_order => {},
101
- :enable_export_to_csv => Defaults::ENABLE_EXPORT_TO_CSV,
102
- :group => nil,
103
- :include => nil,
104
- :joins => nil,
105
- :name => Defaults::GRID_NAME,
106
- :order => nil,
107
- :order_direction => Defaults::ORDER_DIRECTION,
108
- :page => 1,
109
- :per_page => Defaults::PER_PAGE,
110
- :saved_query => nil,
111
- :total_entries => nil,
112
- :with_paginated_resultset => nil,
113
- :with_resultset => nil
114
- }
115
-
95
+ begin
96
+ # options that are understood
97
+ @options = {
98
+ :conditions => nil,
99
+ :csv_file_name => nil,
100
+ :csv_field_separator => Defaults::CSV_FIELD_SEPARATOR,
101
+ :custom_order => {},
102
+ :enable_export_to_csv => Defaults::ENABLE_EXPORT_TO_CSV,
103
+ :group => nil,
104
+ :include => nil,
105
+ :joins => nil,
106
+ :name => Defaults::GRID_NAME,
107
+ :order => nil,
108
+ :order_direction => Defaults::ORDER_DIRECTION,
109
+ :page => 1,
110
+ :page_method_name => Defaults::PAGE_METHOD_NAME,
111
+ :per_page => Defaults::PER_PAGE,
112
+ :saved_query => nil,
113
+ :total_entries => nil,
114
+ :with_paginated_resultset => nil,
115
+ :with_resultset => nil
116
+ }
117
+ rescue NameError
118
+ raise NameError.new('A constant is missing in wice_grid_config.rb: ' + $!.message +
119
+ '. This can happen when you upgrade the WiceGrid to a newer version with a new configuration constant. ' +
120
+ 'Add the constant manually or re-run `bundle exec rails g wice_grid:install`.')
121
+ end
116
122
  # validate parameters
117
123
  opts.assert_valid_keys(@options.keys)
118
124
 
@@ -301,7 +307,7 @@ module Wice
301
307
  else
302
308
  # p @ar_options
303
309
  relation = @relation.
304
- page( @ar_options[:page]).
310
+ send( @options[:page_method_name], @ar_options[:page]).
305
311
  per( @ar_options[:per_page]).
306
312
  includes(@ar_options[:include]).
307
313
  joins( @ar_options[:joins]).
@@ -12,8 +12,13 @@ class WiceGridProcessor
12
12
 
13
13
 
14
14
  process : (domIdToFocus)->
15
- window.location = @buildUrlWithParams(domIdToFocus)
15
+ @visit @buildUrlWithParams(domIdToFocus)
16
16
 
17
+ visit : (path) ->
18
+ if Turbolinks?
19
+ Turbolinks.visit path
20
+ else
21
+ window.location = path
17
22
 
18
23
  setProcessTimer : (domIdToFocus)->
19
24
 
@@ -30,7 +35,7 @@ class WiceGridProcessor
30
35
 
31
36
  reloadPageForGivenGridState : (gridState)->
32
37
  requestPath = @gridStateToRequest(gridState)
33
- window.location = @appendToUrl(@baseLinkForShowAllRecords, requestPath)
38
+ @visit @appendToUrl(@baseLinkForShowAllRecords, requestPath)
34
39
 
35
40
 
36
41
  gridStateToRequest : (gridState)->
@@ -75,11 +80,11 @@ class WiceGridProcessor
75
80
 
76
81
 
77
82
  reset : ->
78
- window.location = @baseRequestForFilter
83
+ @visit @baseRequestForFilter
79
84
 
80
85
 
81
86
  exportToCsv : ->
82
- window.location = @linkForExport
87
+ @visit @linkForExport
83
88
 
84
89
 
85
90
  register : (func)->
@@ -25,7 +25,7 @@ loadQuery = (loadLink, event) ->
25
25
  gridProcessor.parameterNameForQueryLoading + encodeURIComponent(queryId)
26
26
  )
27
27
 
28
- window.location = request
28
+ gridProcessor.visit request
29
29
 
30
30
  event.preventDefault()
31
31
  event.stopPropagation()
data/wice_grid.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'wice_grid'
3
- s.version = '3.4.7'
3
+ s.version = '3.4.8'
4
4
  s.homepage = 'https://github.com/leikind/wice_grid'
5
- s.date = '2014-08-25'
5
+ s.date = '2014-08-27'
6
6
  s.summary = 'A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters.'
7
7
  s.description = 'A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters.' +
8
8
  'One of the goals of this plugin was to allow the programmer to define the contents of the cell by himself, ' +
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wice_grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.7
4
+ version: 3.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Leikind
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-25 00:00:00.000000000 Z
11
+ date: 2014-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kaminari
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.0
27
27
  description: A Rails grid plugin to create grids with sorting, pagination, and (automatically
@@ -35,7 +35,7 @@ executables: []
35
35
  extensions: []
36
36
  extra_rdoc_files: []
37
37
  files:
38
- - .gitignore
38
+ - ".gitignore"
39
39
  - CHANGELOG
40
40
  - Gemfile
41
41
  - MIT-LICENSE
@@ -112,17 +112,17 @@ require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.0.3
125
+ rubygems_version: 2.2.2
126
126
  signing_key:
127
127
  specification_version: 3
128
128
  summary: A Rails grid plugin to create grids with sorting, pagination, and (automatically