mighty_grid 1.0.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +20 -12
- data/features/support/env.rb +1 -0
- data/lib/generators/mighty_grid/install_generator.rb +1 -1
- data/lib/generators/mighty_grid/templates/{mighty_grid_config.rb → mighty_grid.rb} +1 -1
- data/lib/mighty_grid/base.rb +31 -111
- data/lib/mighty_grid/column.rb +1 -1
- data/lib/mighty_grid/engine.rb +11 -8
- data/lib/mighty_grid/exceptions.rb +9 -0
- data/lib/mighty_grid/filter_renderer.rb +18 -34
- data/lib/mighty_grid/filters/base.rb +27 -0
- data/lib/mighty_grid/filters/boolean_filter.rb +6 -0
- data/lib/mighty_grid/filters/custom_filter.rb +19 -0
- data/lib/mighty_grid/filters/enum_filter.rb +15 -0
- data/lib/mighty_grid/filters/string_filter.rb +6 -0
- data/lib/mighty_grid/filters/text_filter.rb +6 -0
- data/lib/mighty_grid/filters.rb +113 -0
- data/lib/mighty_grid/grid_renderer.rb +1 -1
- data/lib/mighty_grid/helpers/{mighty_grid_view_helpers.rb → view_helpers.rb} +13 -11
- data/lib/mighty_grid/map_type.rb +16 -0
- data/lib/mighty_grid/parameters.rb +58 -0
- data/lib/mighty_grid/version.rb +12 -1
- data/lib/mighty_grid.rb +64 -15
- data/spec/dummy/app/controllers/users_controller.rb +1 -1
- data/spec/dummy/app/grids/users_grid.rb +7 -0
- data/spec/dummy/app/views/users/index.html +1 -1
- data/spec/dummy/config/database.yml +29 -0
- data/spec/dummy/db/mg_test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +119680 -0
- data/spec/dummy/log/test.log +101833 -0
- data/spec/dummy/tmp/cache/assets/CCA/5E0/sprockets%2F48d34122dd1905305a6e63e3acb7c042 +0 -0
- data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/CF9/100/sprockets%2F3d8f5e96de4712db63b98083f75739c3 +0 -0
- data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/D3C/EE0/sprockets%2Fccfd910338b6dcf575467d3009b46a0d +0 -0
- data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/D60/BE0/sprockets%2F37b5ab8193eccd1a29a0c61374c6b51e +0 -0
- data/spec/dummy/tmp/cache/assets/D82/820/sprockets%2Ff7c8a51f7f95d66a9d5112f898bc1fd0 +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/DF2/A80/sprockets%2F14a708b3bb2a924afdebae773e4ba5d8 +0 -0
- data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/E0C/4E0/sprockets%2Fed4e3dbab857786229b1bdf7bbd289fe +0 -0
- data/spec/dummy/tmp/cache/assets/E14/600/sprockets%2F34cd0de2e0cd2c01e1c91b0ece565deb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/0e57c0129c0245eab3972d87efc6a9b9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/14a708b3bb2a924afdebae773e4ba5d8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1f8135a48e7ccbcb5361bb9e1f993929 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2479f30262de64213c228dc752440fd1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/34cd0de2e0cd2c01e1c91b0ece565deb +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/37b5ab8193eccd1a29a0c61374c6b51e +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3cbb6c28c7bbcc7c9b547346a59b4e7f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/3d8f5e96de4712db63b98083f75739c3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/422d4d422d090c103e6b198600a90dac +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/48d34122dd1905305a6e63e3acb7c042 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a8c1ee1faf09397765710724fe3ee140 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/bbd98f4797053ba2accbbca7b81cbbaf +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cc03506b8188f839058f41aa8a4e19da +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cccf51971e81f175e527083a6ef4624d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ccfd910338b6dcf575467d3009b46a0d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d77d41650e5528f12146c728566cbf33 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/ed4e3dbab857786229b1bdf7bbd289fe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7c8a51f7f95d66a9d5112f898bc1fd0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/14a708b3bb2a924afdebae773e4ba5d8 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/34cd0de2e0cd2c01e1c91b0ece565deb +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/37b5ab8193eccd1a29a0c61374c6b51e +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/3d8f5e96de4712db63b98083f75739c3 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/422d4d422d090c103e6b198600a90dac +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/48d34122dd1905305a6e63e3acb7c042 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a8c1ee1faf09397765710724fe3ee140 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cccf51971e81f175e527083a6ef4624d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ccfd910338b6dcf575467d3009b46a0d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/ed4e3dbab857786229b1bdf7bbd289fe +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7c8a51f7f95d66a9d5112f898bc1fd0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/lib/base_spec.rb +24 -15
- data/spec/lib/generators/install_generator_spec.rb +5 -3
- data/spec/lib/tmp/config/initializers/mighty_grid.rb +15 -0
- data/spec/lib/tmp/config/locales/mighty_grid.en.yml +6 -0
- data/spec/mighty_grid_spec.rb +17 -0
- data/spec/support/models.rb +1 -0
- metadata +154 -41
- data/.gitignore +0 -26
- data/.rspec +0 -2
- data/.travis.yml +0 -33
- data/Appraisals +0 -17
- data/gemfiles/rails_32.gemfile +0 -26
- data/gemfiles/rails_40.gemfile +0 -26
- data/gemfiles/rails_41.gemfile +0 -26
- data/lib/mighty_grid/config.rb +0 -49
- data/lib/mighty_grid/mighty_grid_controller.rb +0 -14
- data/lib/mighty_grid/mighty_grid_misc.rb +0 -11
- data/mighty_grid.gemspec +0 -27
- data/spec/config_spec.rb +0 -148
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
data/.gitignore
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
.idea
|
7
|
-
*emfile.lock
|
8
|
-
InstalledFiles
|
9
|
-
_yardoc
|
10
|
-
coverage
|
11
|
-
doc/
|
12
|
-
lib/bundler/man
|
13
|
-
pkg
|
14
|
-
rdoc
|
15
|
-
spec/reports
|
16
|
-
test/tmp
|
17
|
-
test/version_tmp
|
18
|
-
tmp
|
19
|
-
log
|
20
|
-
database.yml
|
21
|
-
|
22
|
-
spec/dummy/db/*.sqlite3
|
23
|
-
spec/dummy/db/*.sqlite3-journal
|
24
|
-
spec/dummy/log/*.log
|
25
|
-
spec/dummy/tmp/
|
26
|
-
spec/dummy/.sass-cache
|
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.0.0
|
4
|
-
- 2.1.1
|
5
|
-
- ruby-head
|
6
|
-
|
7
|
-
script:
|
8
|
-
- bundle exec rake -f spec/dummy/Rakefile db:migrate
|
9
|
-
- bundle exec rake spec cucumber
|
10
|
-
|
11
|
-
before_script:
|
12
|
-
- cp spec/dummy/config/database.yml.travis spec/dummy/config/database.yml
|
13
|
-
- mysql -e 'create database mg_test'
|
14
|
-
- psql -c 'create database mg_test' -U postgres
|
15
|
-
|
16
|
-
env:
|
17
|
-
- DB=sqlite
|
18
|
-
- DB=mysql
|
19
|
-
- DB=postgresql
|
20
|
-
|
21
|
-
gemfile:
|
22
|
-
- gemfiles/rails_32.gemfile
|
23
|
-
- gemfiles/rails_40.gemfile
|
24
|
-
- gemfiles/rails_41.gemfile
|
25
|
-
|
26
|
-
addons:
|
27
|
-
code_climate:
|
28
|
-
repo_token: 47bc411a11ccfed015bf25395d8204600c899e530c1c4beed1b7197aa61c6fb6
|
29
|
-
postgresql: "9.3"
|
30
|
-
|
31
|
-
matrix:
|
32
|
-
allow_failures:
|
33
|
-
- rvm: ruby-head
|
data/Appraisals
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
appraise "rails_32" do
|
2
|
-
gem "rails", "~> 3.2.19"
|
3
|
-
gem "activerecord", "~> 3.2.19", require: 'active_record'
|
4
|
-
gem 'coffee-rails', '~> 3.2.0'
|
5
|
-
end
|
6
|
-
|
7
|
-
appraise "rails_40" do
|
8
|
-
gem "rails", "~> 4.0.0"
|
9
|
-
gem "activerecord", "~> 4.0.0", require: 'active_record'
|
10
|
-
gem 'coffee-rails', '~> 4.0.0'
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise "rails_41" do
|
14
|
-
gem "rails", "~> 4.1.0"
|
15
|
-
gem "activerecord", "~> 4.1.0", require: 'active_record'
|
16
|
-
gem 'coffee-rails', '~> 4.0.0'
|
17
|
-
end
|
data/gemfiles/rails_32.gemfile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 3.2.19"
|
6
|
-
gem "activerecord", "~> 3.2.19", :require => "active_record"
|
7
|
-
gem "coffee-rails", "~> 3.2.0"
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem "sqlite3"
|
11
|
-
gem "generator_spec"
|
12
|
-
gem "capybara", :require => false
|
13
|
-
gem "database_cleaner"
|
14
|
-
gem "cucumber-rails", :require => false
|
15
|
-
gem "spreewald"
|
16
|
-
gem "poltergeist"
|
17
|
-
gem "launchy"
|
18
|
-
gem "uglifier", ">= 1.3.0"
|
19
|
-
gem "jquery-rails"
|
20
|
-
gem "coveralls", :require => false
|
21
|
-
gem "codeclimate-test-reporter", :require => nil
|
22
|
-
gem "pg", :require => false
|
23
|
-
gem "mysql2", :require => false
|
24
|
-
end
|
25
|
-
|
26
|
-
gemspec :path => "../"
|
data/gemfiles/rails_40.gemfile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 4.0.0"
|
6
|
-
gem "activerecord", "~> 4.0.0", :require => "active_record"
|
7
|
-
gem "coffee-rails", "~> 4.0.0"
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem "sqlite3"
|
11
|
-
gem "generator_spec"
|
12
|
-
gem "capybara", :require => false
|
13
|
-
gem "database_cleaner"
|
14
|
-
gem "cucumber-rails", :require => false
|
15
|
-
gem "spreewald"
|
16
|
-
gem "poltergeist"
|
17
|
-
gem "launchy"
|
18
|
-
gem "uglifier", ">= 1.3.0"
|
19
|
-
gem "jquery-rails"
|
20
|
-
gem "coveralls", :require => false
|
21
|
-
gem "codeclimate-test-reporter", :require => nil
|
22
|
-
gem "pg", :require => false
|
23
|
-
gem "mysql2", :require => false
|
24
|
-
end
|
25
|
-
|
26
|
-
gemspec :path => "../"
|
data/gemfiles/rails_41.gemfile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "rails", "~> 4.1.0"
|
6
|
-
gem "activerecord", "~> 4.1.0", :require => "active_record"
|
7
|
-
gem "coffee-rails", "~> 4.0.0"
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem "sqlite3"
|
11
|
-
gem "generator_spec"
|
12
|
-
gem "capybara", :require => false
|
13
|
-
gem "database_cleaner"
|
14
|
-
gem "cucumber-rails", :require => false
|
15
|
-
gem "spreewald"
|
16
|
-
gem "poltergeist"
|
17
|
-
gem "launchy"
|
18
|
-
gem "uglifier", ">= 1.3.0"
|
19
|
-
gem "jquery-rails"
|
20
|
-
gem "coveralls", :require => false
|
21
|
-
gem "codeclimate-test-reporter", :require => nil
|
22
|
-
gem "pg", :require => false
|
23
|
-
gem "mysql2", :require => false
|
24
|
-
end
|
25
|
-
|
26
|
-
gemspec :path => "../"
|
data/lib/mighty_grid/config.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'active_support/configurable'
|
2
|
-
|
3
|
-
module MightyGrid
|
4
|
-
# Configures global settings for MightyGrid
|
5
|
-
# MightyGrid.configure do |config|
|
6
|
-
# config.grid_name = 'g'
|
7
|
-
# end
|
8
|
-
def self.configure(&block)
|
9
|
-
yield @config ||= MightyGrid::Configuration.new
|
10
|
-
end
|
11
|
-
|
12
|
-
# Global settings for MightyGrid
|
13
|
-
def self.config
|
14
|
-
@config
|
15
|
-
end
|
16
|
-
|
17
|
-
class Configuration #:nodoc:
|
18
|
-
include ActiveSupport::Configurable
|
19
|
-
config_accessor :per_page
|
20
|
-
config_accessor :order_direction
|
21
|
-
config_accessor :order_type
|
22
|
-
config_accessor :order_asc
|
23
|
-
config_accessor :order_desc
|
24
|
-
config_accessor :order_asc_link_class
|
25
|
-
config_accessor :order_desc_link_class
|
26
|
-
config_accessor :order_active_link_class
|
27
|
-
config_accessor :order_wrapper_class
|
28
|
-
config_accessor :grid_name
|
29
|
-
config_accessor :header_tr_class
|
30
|
-
config_accessor :table_class
|
31
|
-
config_accessor :pagination_theme
|
32
|
-
end
|
33
|
-
|
34
|
-
configure do |config|
|
35
|
-
config.per_page = 15
|
36
|
-
config.order_direction = 'asc'
|
37
|
-
config.order_type = 'single'
|
38
|
-
config.order_asc = '↑'
|
39
|
-
config.order_desc = '↓'
|
40
|
-
config.order_asc_link_class = ''
|
41
|
-
config.order_desc_link_class = ''
|
42
|
-
config.order_active_link_class = 'mg-order-active'
|
43
|
-
config.order_wrapper_class = ''
|
44
|
-
config.grid_name = 'grid'
|
45
|
-
config.table_class = ''
|
46
|
-
config.header_tr_class = ''
|
47
|
-
config.pagination_theme = 'mighty_grid'
|
48
|
-
end
|
49
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module MightyGrid
|
2
|
-
module Controller
|
3
|
-
protected
|
4
|
-
|
5
|
-
attr_accessor :mighty_grid_instances
|
6
|
-
|
7
|
-
def init_grid(klass, opts = {})
|
8
|
-
cg = MightyGrid::Base.new(klass, self, opts)
|
9
|
-
@mighty_grid_instances = [] if @mighty_grid_instances.nil?
|
10
|
-
@mighty_grid_instances << cg
|
11
|
-
cg
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/mighty_grid.gemspec
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'mighty_grid/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'mighty_grid'
|
8
|
-
spec.version = MightyGrid::VERSION
|
9
|
-
spec.authors = ['jurrick']
|
10
|
-
spec.email = ['jurianp@gmail.com']
|
11
|
-
spec.summary = %q(Flexible grid for Rails)
|
12
|
-
spec.description = %q(Flexible grid for Rails)
|
13
|
-
spec.homepage = 'http://github.com/jurrick/mighty_grid'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.add_development_dependency 'bundler', '~> 1.5'
|
22
|
-
spec.add_development_dependency 'rake'
|
23
|
-
spec.add_development_dependency 'rspec-rails', '~> 2.14.2'
|
24
|
-
spec.add_development_dependency 'appraisal'
|
25
|
-
|
26
|
-
spec.add_dependency 'kaminari', '~> 0.15'
|
27
|
-
end
|
data/spec/config_spec.rb
DELETED
@@ -1,148 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe MightyGrid::Configuration do
|
4
|
-
subject { MightyGrid.config }
|
5
|
-
|
6
|
-
describe 'per_page' do
|
7
|
-
context 'by default' do
|
8
|
-
its(:per_page) { should == 15 }
|
9
|
-
end
|
10
|
-
context 'configured via config block' do
|
11
|
-
before { MightyGrid.configure { |c| c.per_page = 17 } }
|
12
|
-
its(:per_page) { should == 17 }
|
13
|
-
after { MightyGrid.configure { |c| c.per_page = 15 } }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe 'order_direction' do
|
18
|
-
context 'by default' do
|
19
|
-
its(:order_direction) { should == 'asc' }
|
20
|
-
end
|
21
|
-
context 'configured via config block' do
|
22
|
-
before { MightyGrid.configure { |c| c.order_direction = 'desc' } }
|
23
|
-
its(:order_direction) { should == 'desc' }
|
24
|
-
after { MightyGrid.configure { |c| c.order_direction = 'asc' } }
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe 'order_type' do
|
29
|
-
context 'by default' do
|
30
|
-
its(:order_type) { should == 'single' }
|
31
|
-
end
|
32
|
-
context 'configured via config block' do
|
33
|
-
before { MightyGrid.configure { |c| c.order_type = 'pair' } }
|
34
|
-
its(:order_type) { should == 'pair' }
|
35
|
-
after { MightyGrid.configure { |c| c.order_type = 'single' } }
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe 'order_asc' do
|
40
|
-
context 'by default' do
|
41
|
-
its(:order_asc) { should == '↑' }
|
42
|
-
end
|
43
|
-
context 'configured via config block' do
|
44
|
-
before { MightyGrid.configure { |c| c.order_asc = '∧' } }
|
45
|
-
its(:order_asc) { should == '∧' }
|
46
|
-
after { MightyGrid.configure { |c| c.order_asc = '↑' } }
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe 'order_desc' do
|
51
|
-
context 'by default' do
|
52
|
-
its(:order_desc) { should == '↓' }
|
53
|
-
end
|
54
|
-
context 'configured via config block' do
|
55
|
-
before { MightyGrid.configure { |c| c.order_desc = '∨' } }
|
56
|
-
its(:order_desc) { should == '∨' }
|
57
|
-
after { MightyGrid.configure { |c| c.order_desc = '↓' } }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe 'order_asc_link_class' do
|
62
|
-
context 'by default' do
|
63
|
-
its(:order_asc_link_class) { should == '' }
|
64
|
-
end
|
65
|
-
context 'configured via config block' do
|
66
|
-
before { MightyGrid.configure { |c| c.order_asc_link_class = 'btn' } }
|
67
|
-
its(:order_asc_link_class) { should == 'btn' }
|
68
|
-
after { MightyGrid.configure { |c| c.order_asc_link_class = '' } }
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe 'order_active_link_class' do
|
73
|
-
context 'by default' do
|
74
|
-
its(:order_active_link_class) { should == 'mg-order-active' }
|
75
|
-
end
|
76
|
-
context 'configured via config block' do
|
77
|
-
before { MightyGrid.configure { |c| c.order_active_link_class = 'btn-primary' } }
|
78
|
-
its(:order_active_link_class) { should == 'btn-primary' }
|
79
|
-
after { MightyGrid.configure { |c| c.order_active_link_class = '' } }
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe 'order_desc_link_class' do
|
84
|
-
context 'by default' do
|
85
|
-
its(:order_desc_link_class) { should == '' }
|
86
|
-
end
|
87
|
-
context 'configured via config block' do
|
88
|
-
before { MightyGrid.configure { |c| c.order_desc_link_class = 'btn' } }
|
89
|
-
its(:order_desc_link_class) { should == 'btn' }
|
90
|
-
after { MightyGrid.configure { |c| c.order_desc_link_class = '' } }
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
describe 'order_wrapper_class' do
|
95
|
-
context 'by default' do
|
96
|
-
its(:order_wrapper_class) { should == '' }
|
97
|
-
end
|
98
|
-
context 'configured via config block' do
|
99
|
-
before { MightyGrid.configure { |c| c.order_wrapper_class = 'btn-group' } }
|
100
|
-
its(:order_wrapper_class) { should == 'btn-group' }
|
101
|
-
after { MightyGrid.configure { |c| c.order_wrapper_class = '' } }
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
describe 'grid_name' do
|
106
|
-
context 'by default' do
|
107
|
-
its(:grid_name) { should == 'grid' }
|
108
|
-
end
|
109
|
-
context 'configured via config block' do
|
110
|
-
before { MightyGrid.configure { |c| c.grid_name = 'g1' } }
|
111
|
-
its(:grid_name) { should == 'g1' }
|
112
|
-
after { MightyGrid.configure { |c| c.grid_name = 'grid' } }
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
describe 'table_class' do
|
117
|
-
context 'by default' do
|
118
|
-
its(:table_class) { should == '' }
|
119
|
-
end
|
120
|
-
context 'configured via config block' do
|
121
|
-
before { MightyGrid.configure { |c| c.table_class = 'table' } }
|
122
|
-
its(:table_class) { should == 'table' }
|
123
|
-
after { MightyGrid.configure { |c| c.table_class = '' } }
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
describe 'header_tr_class' do
|
128
|
-
context 'by default' do
|
129
|
-
its(:header_tr_class) { should == '' }
|
130
|
-
end
|
131
|
-
context 'configured via config block' do
|
132
|
-
before { MightyGrid.configure { |c| c.header_tr_class = 'active' } }
|
133
|
-
its(:header_tr_class) { should == 'active' }
|
134
|
-
after { MightyGrid.configure { |c| c.header_tr_class = '' } }
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
describe 'pagination_template' do
|
139
|
-
context 'by default' do
|
140
|
-
its(:pagination_theme) { should == 'mighty_grid' }
|
141
|
-
end
|
142
|
-
context 'configured via config block' do
|
143
|
-
before { MightyGrid.configure { |c| c.pagination_theme = 'pagination1' } }
|
144
|
-
its(:pagination_theme) { should == 'pagination1' }
|
145
|
-
after { MightyGrid.configure { |c| c.pagination_theme = 'mighty_grid' } }
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
data/spec/dummy/app/models/.keep
DELETED
File without changes
|
File without changes
|
data/spec/dummy/lib/assets/.keep
DELETED
File without changes
|