wice_grid_mongoid 0.5.7 → 6.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -1
- data/Gemfile +17 -0
- data/Gemfile.lock +140 -0
- data/README.rdoc +19 -3
- data/Rakefile +1 -3
- data/VERSION +1 -1
- data/lib/filter_conditions_generators.rb +126 -0
- data/{generators/wice_grid_assets_prototype/templates/stylesheets → lib/generators/wice_grid/templates}/calendarview.css +0 -0
- data/{generators/wice_grid_assets_prototype/templates/javascripts → lib/generators/wice_grid/templates}/calendarview.js +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/arrow_down.gif +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/arrow_up.gif +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/calendar_view_month.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/delete.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/expand.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/page_white_excel.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/page_white_find.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/table.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/table_refresh.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/tick_all.png +0 -0
- data/{generators/common_templates → lib/generators/wice_grid/templates}/icons/untick_all.png +0 -0
- data/{generators/common_templates/stylesheets → lib/generators/wice_grid/templates}/wice_grid.css +0 -0
- data/{generators/common_templates/locales → lib/generators/wice_grid/templates}/wice_grid.yml +0 -0
- data/{generators/common_templates/initializers → lib/generators/wice_grid/templates}/wice_grid_config.rb +0 -0
- data/{generators/wice_grid_assets_jquery/templates/javascripts → lib/generators/wice_grid/templates}/wice_grid_jquery.js +0 -0
- data/{generators/wice_grid_assets_prototype/templates/javascripts → lib/generators/wice_grid/templates}/wice_grid_prototype.js +0 -0
- data/lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb +32 -0
- data/lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb +34 -0
- data/lib/grid_renderer.rb +36 -20
- data/lib/helpers/js_calendar_helpers.rb +0 -5
- data/lib/helpers/wice_grid_view_helpers.rb +113 -133
- data/lib/mongoid_field.rb +50 -0
- data/{tasks → lib/tasks}/wice_grid_tasks.rake +0 -0
- data/lib/view_columns.rb +23 -29
- data/lib/wice_grid.rb +91 -379
- data/lib/wice_grid_misc.rb +3 -3
- data/mongoid_wice_grid.gemspec +122 -0
- data/test/blueprint.rb +17 -0
- data/test/public/javascripts/jquery-1.4.2.min.js +154 -0
- data/test/public/javascripts/wice_grid.js +163 -0
- data/test/rails_mongoid_test.rb +104 -0
- data/test/rails_test_app.rb +71 -0
- data/test/require_gems.rb +19 -0
- data/test/spec_helper.rb +22 -0
- data/test/wice_grid_initializer.rb +215 -0
- data/wice_grid_mongoid.gemspec +43 -30
- metadata +45 -34
- data/generators/wice_grid_assets_jquery/templates/USAGE +0 -6
- data/generators/wice_grid_assets_jquery/wice_grid_assets_jquery_generator.rb +0 -35
- data/generators/wice_grid_assets_prototype/USAGE +0 -8
- data/generators/wice_grid_assets_prototype/wice_grid_assets_prototype_generator.rb +0 -37
- data/init.rb +0 -1
- data/install.rb +0 -1
- data/lib/table_column_matrix.rb +0 -51
- data/uninstall.rb +0 -1
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wice_grid_mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 41
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 6
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.5.7
|
9
|
+
- 3
|
10
|
+
version: 6.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Yuri Leikind
|
@@ -21,9 +21,7 @@ default_executable:
|
|
21
21
|
dependencies: []
|
22
22
|
|
23
23
|
description: "A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters "
|
24
|
-
email:
|
25
|
-
- yuri.leikind@gmail.com
|
26
|
-
- aleksandr.furmanov@gmail.com
|
24
|
+
email: aleksandr.furmanov@gmail.com
|
27
25
|
executables: []
|
28
26
|
|
29
27
|
extensions: []
|
@@ -33,35 +31,34 @@ extra_rdoc_files:
|
|
33
31
|
files:
|
34
32
|
- .gitignore
|
35
33
|
- CHANGELOG
|
34
|
+
- Gemfile
|
35
|
+
- Gemfile.lock
|
36
36
|
- MIT-LICENSE
|
37
37
|
- README.rdoc
|
38
38
|
- Rakefile
|
39
39
|
- SAVED_QUERIES_HOWTO.rdoc
|
40
40
|
- VERSION
|
41
|
-
-
|
42
|
-
- generators/
|
43
|
-
- generators/
|
44
|
-
- generators/
|
45
|
-
- generators/
|
46
|
-
- generators/
|
47
|
-
- generators/
|
48
|
-
- generators/
|
49
|
-
- generators/
|
50
|
-
- generators/
|
51
|
-
- generators/
|
52
|
-
- generators/
|
53
|
-
- generators/
|
54
|
-
- generators/
|
55
|
-
- generators/
|
56
|
-
- generators/
|
57
|
-
- generators/
|
58
|
-
- generators/
|
59
|
-
- generators/
|
60
|
-
- generators/
|
61
|
-
- generators/
|
62
|
-
- generators/wice_grid_assets_prototype/wice_grid_assets_prototype_generator.rb
|
63
|
-
- init.rb
|
64
|
-
- install.rb
|
41
|
+
- lib/filter_conditions_generators.rb
|
42
|
+
- lib/generators/wice_grid/templates/calendarview.css
|
43
|
+
- lib/generators/wice_grid/templates/calendarview.js
|
44
|
+
- lib/generators/wice_grid/templates/icons/arrow_down.gif
|
45
|
+
- lib/generators/wice_grid/templates/icons/arrow_up.gif
|
46
|
+
- lib/generators/wice_grid/templates/icons/calendar_view_month.png
|
47
|
+
- lib/generators/wice_grid/templates/icons/delete.png
|
48
|
+
- lib/generators/wice_grid/templates/icons/expand.png
|
49
|
+
- lib/generators/wice_grid/templates/icons/page_white_excel.png
|
50
|
+
- lib/generators/wice_grid/templates/icons/page_white_find.png
|
51
|
+
- lib/generators/wice_grid/templates/icons/table.png
|
52
|
+
- lib/generators/wice_grid/templates/icons/table_refresh.png
|
53
|
+
- lib/generators/wice_grid/templates/icons/tick_all.png
|
54
|
+
- lib/generators/wice_grid/templates/icons/untick_all.png
|
55
|
+
- lib/generators/wice_grid/templates/wice_grid.css
|
56
|
+
- lib/generators/wice_grid/templates/wice_grid.yml
|
57
|
+
- lib/generators/wice_grid/templates/wice_grid_config.rb
|
58
|
+
- lib/generators/wice_grid/templates/wice_grid_jquery.js
|
59
|
+
- lib/generators/wice_grid/templates/wice_grid_prototype.js
|
60
|
+
- lib/generators/wice_grid/wice_grid_assets_jquery_generator.rb
|
61
|
+
- lib/generators/wice_grid/wice_grid_assets_prototype_generator.rb
|
65
62
|
- lib/grid_output_buffer.rb
|
66
63
|
- lib/grid_renderer.rb
|
67
64
|
- lib/helpers/js_calendar_helpers.rb
|
@@ -71,7 +68,8 @@ files:
|
|
71
68
|
- lib/js_adaptors/jquery_adaptor.rb
|
72
69
|
- lib/js_adaptors/js_adaptor.rb
|
73
70
|
- lib/js_adaptors/prototype_adaptor.rb
|
74
|
-
- lib/
|
71
|
+
- lib/mongoid_field.rb
|
72
|
+
- lib/tasks/wice_grid_tasks.rake
|
75
73
|
- lib/view_columns.rb
|
76
74
|
- lib/views/create.rjs
|
77
75
|
- lib/views/delete.rjs
|
@@ -82,20 +80,27 @@ files:
|
|
82
80
|
- lib/wice_grid_serialized_queries_controller.rb
|
83
81
|
- lib/wice_grid_serialized_query.rb
|
84
82
|
- lib/wice_grid_spreadsheet.rb
|
85
|
-
-
|
83
|
+
- mongoid_wice_grid.gemspec
|
86
84
|
- test/.gitignore
|
85
|
+
- test/blueprint.rb
|
87
86
|
- test/database.yml
|
87
|
+
- test/public/javascripts/jquery-1.4.2.min.js
|
88
|
+
- test/public/javascripts/wice_grid.js
|
89
|
+
- test/rails_mongoid_test.rb
|
90
|
+
- test/rails_test_app.rb
|
91
|
+
- test/require_gems.rb
|
88
92
|
- test/schema.rb
|
93
|
+
- test/spec_helper.rb
|
89
94
|
- test/test_helper.rb
|
90
95
|
- test/views/projects_and_people_grid.html.erb
|
91
96
|
- test/views/projects_and_people_grid_invalid.html.erb
|
92
97
|
- test/views/simple_projects_grid.html.erb
|
93
98
|
- test/wice_grid_core_ext_test.rb
|
94
99
|
- test/wice_grid_functional_test.rb
|
100
|
+
- test/wice_grid_initializer.rb
|
95
101
|
- test/wice_grid_misc_test.rb
|
96
102
|
- test/wice_grid_test.rb
|
97
103
|
- test/wice_grid_view_helper_test.rb
|
98
|
-
- uninstall.rb
|
99
104
|
- wice_grid_mongoid.gemspec
|
100
105
|
has_rdoc: true
|
101
106
|
homepage: http://github.com/afurmanov/wice_grid
|
@@ -132,10 +137,16 @@ signing_key:
|
|
132
137
|
specification_version: 3
|
133
138
|
summary: Rails Grid Plugin
|
134
139
|
test_files:
|
140
|
+
- test/blueprint.rb
|
141
|
+
- test/rails_mongoid_test.rb
|
142
|
+
- test/rails_test_app.rb
|
143
|
+
- test/require_gems.rb
|
135
144
|
- test/schema.rb
|
145
|
+
- test/spec_helper.rb
|
136
146
|
- test/test_helper.rb
|
137
147
|
- test/wice_grid_core_ext_test.rb
|
138
148
|
- test/wice_grid_functional_test.rb
|
149
|
+
- test/wice_grid_initializer.rb
|
139
150
|
- test/wice_grid_misc_test.rb
|
140
151
|
- test/wice_grid_test.rb
|
141
152
|
- test/wice_grid_view_helper_test.rb
|
@@ -1,35 +0,0 @@
|
|
1
|
-
class WiceGridAssetsJqueryGenerator < Rails::Generator::Base
|
2
|
-
def active_js_framework
|
3
|
-
'jquery'
|
4
|
-
end
|
5
|
-
def inactive_js_framework
|
6
|
-
'prototype'
|
7
|
-
end
|
8
|
-
|
9
|
-
def manifest
|
10
|
-
record do |m|
|
11
|
-
# wice_grid config
|
12
|
-
m.directory "config/initializers"
|
13
|
-
@active_js_framework = 'jquery'
|
14
|
-
@inactive_js_framework = 'prototype'
|
15
|
-
m.template "../../common_templates/initializers/wice_grid_config.rb", "config/initializers/wice_grid_config.rb"
|
16
|
-
|
17
|
-
# wice_grid locales
|
18
|
-
m.directory "config/locales"
|
19
|
-
m.file "../../common_templates/locales/wice_grid.yml", "config/locales/wice_grid.yml"
|
20
|
-
|
21
|
-
# wice_grid js & css
|
22
|
-
m.file "javascripts/wice_grid_jquery.js", "public/javascripts/wice_grid.js"
|
23
|
-
m.file "../../common_templates/stylesheets/wice_grid.css", "public/stylesheets/wice_grid.css"
|
24
|
-
|
25
|
-
# images
|
26
|
-
m.directory "public/images/icons/grid"
|
27
|
-
|
28
|
-
%w(arrow_down.gif calendar_view_month.png expand.png page_white_find.png table_refresh.png
|
29
|
-
arrow_up.gif delete.png page_white_excel.png table.png tick_all.png untick_all.png ).each do |f|
|
30
|
-
m.file "../../common_templates/icons/#{f}", "public/images/icons/grid/#{f}"
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
Description:
|
2
|
-
Copies
|
3
|
-
configuration file wice_grid_config.rb to config/initializers/
|
4
|
-
wice_grid_prototype.js to public/javascripts/wice_grid.js
|
5
|
-
wice_grid.css to public/stylesheets/
|
6
|
-
calendarview.js to public/javascripts/
|
7
|
-
calendarview.css to public/stylesheets/
|
8
|
-
wice_grid images to public/images/icons/grid
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class WiceGridAssetsPrototypeGenerator < Rails::Generator::Base
|
2
|
-
def active_js_framework
|
3
|
-
'prototype'
|
4
|
-
end
|
5
|
-
def inactive_js_framework
|
6
|
-
'jquery'
|
7
|
-
end
|
8
|
-
|
9
|
-
def manifest
|
10
|
-
record do |m|
|
11
|
-
# wice_grid config
|
12
|
-
m.directory "config/initializers"
|
13
|
-
m.template "../../common_templates/initializers/wice_grid_config.rb", "config/initializers/wice_grid_config.rb"
|
14
|
-
|
15
|
-
# wice_grid locales
|
16
|
-
m.directory "config/locales"
|
17
|
-
m.file "../../common_templates/locales/wice_grid.yml", "config/locales/wice_grid.yml"
|
18
|
-
|
19
|
-
# wice_grid js & css
|
20
|
-
m.file "javascripts/wice_grid_prototype.js", "public/javascripts/wice_grid.js"
|
21
|
-
m.file "../../common_templates/stylesheets/wice_grid.css", "public/stylesheets/wice_grid.css"
|
22
|
-
|
23
|
-
# calendarview js & css
|
24
|
-
m.file "javascripts/calendarview.js", "public/javascripts/calendarview.js"
|
25
|
-
m.file "stylesheets/calendarview.css", "public/stylesheets/calendarview.css"
|
26
|
-
|
27
|
-
# images
|
28
|
-
m.directory "public/images/icons/grid"
|
29
|
-
|
30
|
-
%w(arrow_down.gif calendar_view_month.png expand.png page_white_find.png table_refresh.png
|
31
|
-
arrow_up.gif delete.png page_white_excel.png table.png tick_all.png untick_all.png ).each do |f|
|
32
|
-
m.file "../../common_templates/icons/#{f}", "public/images/icons/grid/#{f}"
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'wice_grid.rb'
|
data/install.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Install hook code here
|
data/lib/table_column_matrix.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
module Wice
|
3
|
-
class TableColumnMatrix < Hash #:nodoc:
|
4
|
-
|
5
|
-
attr_reader :generated_conditions
|
6
|
-
|
7
|
-
def initialize() #:nodoc:
|
8
|
-
super
|
9
|
-
@generated_conditions = []
|
10
|
-
@by_table_names = HashWithIndifferentAccess.new
|
11
|
-
end
|
12
|
-
|
13
|
-
def add_condition(column, conditions)
|
14
|
-
@generated_conditions << [column, conditions] unless conditions.blank?
|
15
|
-
end
|
16
|
-
|
17
|
-
def conditions
|
18
|
-
@generated_conditions.collect{|_, cond| cond}
|
19
|
-
end
|
20
|
-
|
21
|
-
alias_method :get, :[]
|
22
|
-
|
23
|
-
attr_reader :default_model_class
|
24
|
-
def default_model_class=(model_klass) #:nodoc:
|
25
|
-
init_columns_of_table(model_klass) unless has_key?(model_klass)
|
26
|
-
@default_model_class = model_klass
|
27
|
-
end
|
28
|
-
|
29
|
-
def [](model_klass) #:nodoc:
|
30
|
-
init_columns_of_table(model_klass) unless has_key?(model_klass)
|
31
|
-
get(model_klass)
|
32
|
-
end
|
33
|
-
|
34
|
-
def get_column_by_model_class_and_column_name(model_class, column_name) #:nodoc:
|
35
|
-
self[model_class][column_name]
|
36
|
-
end
|
37
|
-
|
38
|
-
def get_column_in_default_model_class_by_column_name(column_name) #:nodoc:
|
39
|
-
raise WiceGridException.new("Cannot search for a column in a default model as the default model is not set") if @default_model_class.nil?
|
40
|
-
self[@default_model_class][column_name]
|
41
|
-
end
|
42
|
-
|
43
|
-
def init_columns_of_table(model_klass) #:nodoc:
|
44
|
-
self[model_klass] = HashWithIndifferentAccess.new(model_klass.columns.index_by(&:name))
|
45
|
-
@by_table_names[model_klass.table_name] = self[model_klass]
|
46
|
-
self[model_klass].each_value{|c| c.model_klass = model_klass}
|
47
|
-
end
|
48
|
-
alias_method :<< , :init_columns_of_table
|
49
|
-
|
50
|
-
end
|
51
|
-
end
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|