active_list 6.0.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module ActiveList
2
2
 
3
- VERSION = "6.0.1"
3
+ VERSION = "6.1.0"
4
4
 
5
5
  end
data/locales/eng.yml CHANGED
@@ -19,6 +19,7 @@ eng: &eng
19
19
  next: "Next page"
20
20
  previous: "Previous page"
21
21
  showing_x_to_y_of_total: "Showing %{x} to %{y} of %{total}"
22
+ x_to_y_of_total: "%{x}-%{y} of %{total}"
22
23
  x_per_page:
23
24
  one: "%{count} per page"
24
25
  other: "%{count} per page"
data/test/dummy/Gemfile CHANGED
@@ -16,7 +16,7 @@ group :assets do
16
16
  gem 'coffee-rails', '~> 3.2.1'
17
17
 
18
18
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
19
- # gem 'therubyracer', :platform => :ruby
19
+ gem 'therubyracer', :platform => :ruby
20
20
 
21
21
  gem 'uglifier', '>= 1.0.3'
22
22
  end
@@ -1,132 +1,130 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- active-list (4.0.0)
5
- compass-rails (>= 1)
6
- fastercsv (>= 1.5)
4
+ active_list (6.1.0)
5
+ code_string (>= 0.0.0)
7
6
  i18n-complements
8
- rails (>= 3.1)
7
+ rails (>= 3.2, < 4.1)
8
+ rubyzip (>= 1.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionmailer (3.2.3)
14
- actionpack (= 3.2.3)
15
- mail (~> 2.4.4)
16
- actionpack (3.2.3)
17
- activemodel (= 3.2.3)
18
- activesupport (= 3.2.3)
13
+ actionmailer (3.2.17)
14
+ actionpack (= 3.2.17)
15
+ mail (~> 2.5.4)
16
+ actionpack (3.2.17)
17
+ activemodel (= 3.2.17)
18
+ activesupport (= 3.2.17)
19
19
  builder (~> 3.0.0)
20
20
  erubis (~> 2.7.0)
21
- journey (~> 1.0.1)
22
- rack (~> 1.4.0)
21
+ journey (~> 1.0.4)
22
+ rack (~> 1.4.5)
23
23
  rack-cache (~> 1.2)
24
24
  rack-test (~> 0.6.1)
25
- sprockets (~> 2.1.2)
26
- activemodel (3.2.3)
27
- activesupport (= 3.2.3)
25
+ sprockets (~> 2.2.1)
26
+ activemodel (3.2.17)
27
+ activesupport (= 3.2.17)
28
28
  builder (~> 3.0.0)
29
- activerecord (3.2.3)
30
- activemodel (= 3.2.3)
31
- activesupport (= 3.2.3)
29
+ activerecord (3.2.17)
30
+ activemodel (= 3.2.17)
31
+ activesupport (= 3.2.17)
32
32
  arel (~> 3.0.2)
33
33
  tzinfo (~> 0.3.29)
34
- activeresource (3.2.3)
35
- activemodel (= 3.2.3)
36
- activesupport (= 3.2.3)
37
- activesupport (3.2.3)
38
- i18n (~> 0.6)
34
+ activeresource (3.2.17)
35
+ activemodel (= 3.2.17)
36
+ activesupport (= 3.2.17)
37
+ activesupport (3.2.17)
38
+ i18n (~> 0.6, >= 0.6.4)
39
39
  multi_json (~> 1.0)
40
- arel (3.0.2)
41
- builder (3.0.0)
42
- chunky_png (1.2.5)
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ code_string (0.0.0)
43
43
  coffee-rails (3.2.2)
44
44
  coffee-script (>= 2.2.0)
45
45
  railties (~> 3.2.0)
46
46
  coffee-script (2.2.0)
47
47
  coffee-script-source
48
48
  execjs
49
- coffee-script-source (1.3.1)
50
- compass (0.12.1)
51
- chunky_png (~> 1.2)
52
- fssm (>= 0.2.7)
53
- sass (~> 3.1)
54
- compass-rails (1.0.1)
55
- compass (~> 0.12.0)
49
+ coffee-script-source (1.7.0)
56
50
  erubis (2.7.0)
57
- execjs (1.3.2)
58
- multi_json (~> 1.0)
59
- fastercsv (1.5.4)
60
- fssm (0.2.9)
61
- hike (1.2.1)
62
- i18n (0.6.0)
63
- i18n-complements (0.0.1)
51
+ execjs (2.0.2)
52
+ hike (1.2.3)
53
+ i18n (0.6.9)
54
+ i18n-complements (0.0.10)
64
55
  i18n (>= 0.6)
65
- journey (1.0.3)
66
- jquery-rails (2.0.2)
67
- railties (>= 3.2.0, < 5.0)
68
- thor (~> 0.14)
69
- json (1.7.1)
70
- mail (2.4.4)
71
- i18n (>= 0.4.0)
56
+ journey (1.0.4)
57
+ jquery-rails (3.1.0)
58
+ railties (>= 3.0, < 5.0)
59
+ thor (>= 0.14, < 2.0)
60
+ json (1.8.1)
61
+ libv8 (3.16.14.3)
62
+ mail (2.5.4)
72
63
  mime-types (~> 1.16)
73
64
  treetop (~> 1.4.8)
74
- mime-types (1.18)
75
- multi_json (1.3.4)
76
- polyglot (0.3.3)
77
- rack (1.4.1)
65
+ mime-types (1.25.1)
66
+ multi_json (1.9.3)
67
+ polyglot (0.3.4)
68
+ rack (1.4.5)
78
69
  rack-cache (1.2)
79
70
  rack (>= 0.4)
80
- rack-ssl (1.3.2)
71
+ rack-ssl (1.3.4)
81
72
  rack
82
- rack-test (0.6.1)
73
+ rack-test (0.6.2)
83
74
  rack (>= 1.0)
84
- rails (3.2.3)
85
- actionmailer (= 3.2.3)
86
- actionpack (= 3.2.3)
87
- activerecord (= 3.2.3)
88
- activeresource (= 3.2.3)
89
- activesupport (= 3.2.3)
75
+ rails (3.2.17)
76
+ actionmailer (= 3.2.17)
77
+ actionpack (= 3.2.17)
78
+ activerecord (= 3.2.17)
79
+ activeresource (= 3.2.17)
80
+ activesupport (= 3.2.17)
90
81
  bundler (~> 1.0)
91
- railties (= 3.2.3)
92
- railties (3.2.3)
93
- actionpack (= 3.2.3)
94
- activesupport (= 3.2.3)
82
+ railties (= 3.2.17)
83
+ railties (3.2.17)
84
+ actionpack (= 3.2.17)
85
+ activesupport (= 3.2.17)
95
86
  rack-ssl (~> 1.3.2)
96
87
  rake (>= 0.8.7)
97
88
  rdoc (~> 3.4)
98
- thor (~> 0.14.6)
99
- rake (0.9.2.2)
100
- rdoc (3.12)
89
+ thor (>= 0.14.6, < 2.0)
90
+ rake (10.3.1)
91
+ rdoc (3.12.2)
101
92
  json (~> 1.4)
102
- sass (3.1.17)
103
- sass-rails (3.2.5)
93
+ ref (1.0.5)
94
+ rubyzip (1.1.3)
95
+ sass (3.3.7)
96
+ sass-rails (3.2.6)
104
97
  railties (~> 3.2.0)
105
98
  sass (>= 3.1.10)
106
99
  tilt (~> 1.3)
107
- sprockets (2.1.3)
100
+ sprockets (2.2.2)
108
101
  hike (~> 1.2)
102
+ multi_json (~> 1.0)
109
103
  rack (~> 1.0)
110
104
  tilt (~> 1.1, != 1.3.0)
111
- sqlite3 (1.3.6)
112
- thor (0.14.6)
113
- tilt (1.3.3)
114
- treetop (1.4.10)
105
+ sqlite3 (1.3.9)
106
+ therubyracer (0.12.1)
107
+ libv8 (~> 3.16.14.0)
108
+ ref
109
+ thor (0.19.1)
110
+ tilt (1.4.1)
111
+ treetop (1.4.15)
115
112
  polyglot
116
113
  polyglot (>= 0.3.1)
117
- tzinfo (0.3.33)
118
- uglifier (1.2.4)
114
+ tzinfo (0.3.39)
115
+ uglifier (2.5.0)
119
116
  execjs (>= 0.3.0)
120
- multi_json (>= 1.0.2)
117
+ json (>= 1.8.0)
121
118
 
122
119
  PLATFORMS
123
120
  ruby
124
121
 
125
122
  DEPENDENCIES
126
- active-list!
123
+ active_list!
127
124
  coffee-rails (~> 3.2.1)
128
125
  jquery-rails
129
- rails (= 3.2.3)
126
+ rails (= 3.2.17)
130
127
  sass-rails (~> 3.2.3)
131
128
  sqlite3
129
+ therubyracer
132
130
  uglifier (>= 1.0.3)
@@ -0,0 +1,6 @@
1
+ # encoding: UTF-8
2
+ Person.create! name: "Leonardo di ser Piero da Vinci", born_on: "1452-04-15"
3
+ Person.create! name: "宮崎 駿", born_on: "1941-01-05"
4
+ Person.create! name: "عَبْدَالله مُحَمَّد بِن مُوسَى اَلْخْوَارِزْمِي‎", born_on: Date.new(780, 8, 7)
5
+ Person.create! name: "Περικλῆς", born_on: Date.new(-495, 9, 4)
6
+ puts "#{Person.count} people"
@@ -8,6 +8,13 @@ class PeopleControllerTest < ActionController::TestCase
8
8
 
9
9
  get :list, :format => :csv
10
10
  assert_response :success
11
+
12
+ get :list, :format => :ods
13
+ assert_response :success
14
+
15
+ # get :list, :format => :xcsv
16
+ # assert_response :success
17
+
11
18
  end
12
19
 
13
20
  end
data/test/test_helper.rb CHANGED
@@ -7,7 +7,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
7
  require 'active_list'
8
8
  dummy_path = Pathname.new(__FILE__).dirname.join("dummy")
9
9
 
10
- `cd #{dummy_path} && bundle exec rake db:migrate RAILS_ENV=test`
10
+ Kernel.system("cd #{dummy_path} && bundle install && bundle exec rake db:drop db:create db:migrate db:seed RAILS_ENV=test")
11
11
 
12
12
  # CURRENT FILE :: test/test_helper.rb
13
13
  # Configure Rails Environment
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-04 00:00:00.000000000 Z
12
+ date: 2014-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -65,22 +65,6 @@ dependencies:
65
65
  - - ! '>='
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.0'
68
- - !ruby/object:Gem::Dependency
69
- name: fastercsv
70
- requirement: !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
73
- - - ! '>='
74
- - !ruby/object:Gem::Version
75
- version: '1.5'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- none: false
80
- requirements:
81
- - - ! '>='
82
- - !ruby/object:Gem::Version
83
- version: '1.5'
84
68
  - !ruby/object:Gem::Dependency
85
69
  name: i18n-complements
86
70
  requirement: !ruby/object:Gem::Requirement
@@ -123,13 +107,12 @@ files:
123
107
  - README.rdoc
124
108
  - app/assets/images/active_list.png
125
109
  - app/assets/images/active_list.svg
126
- - app/assets/javascripts/active_list.jquery.js
110
+ - app/assets/javascripts/active_list.jquery.js.coffee
127
111
  - app/assets/stylesheets/active_list.css.scss
128
112
  - app/assets/stylesheets/active_list/background.scss
129
113
  - app/assets/stylesheets/active_list/minimal.scss
130
114
  - app/assets/stylesheets/active_list/theme.scss
131
115
  - lib/active_list.rb
132
- - lib/active_list/action_pack.rb
133
116
  - lib/active_list/definition.rb
134
117
  - lib/active_list/definition/abstract_column.rb
135
118
  - lib/active_list/definition/action_column.rb
@@ -150,7 +133,9 @@ files:
150
133
  - lib/active_list/generator.rb
151
134
  - lib/active_list/generator/finder.rb
152
135
  - lib/active_list/helpers.rb
136
+ - lib/active_list/rails.rb
153
137
  - lib/active_list/rails/engine.rb
138
+ - lib/active_list/rails/integration.rb
154
139
  - lib/active_list/renderers.rb
155
140
  - lib/active_list/renderers/abstract_renderer.rb
156
141
  - lib/active_list/renderers/simple_renderer.rb
@@ -165,11 +150,7 @@ files:
165
150
  - test/dummy/Rakefile
166
151
  - test/dummy/app/assets/images/rails.png
167
152
  - test/dummy/app/assets/javascripts/application.js
168
- - test/dummy/app/assets/javascripts/contacts.js.coffee
169
- - test/dummy/app/assets/javascripts/people.js.coffee
170
153
  - test/dummy/app/assets/stylesheets/application.css
171
- - test/dummy/app/assets/stylesheets/contacts.css.scss
172
- - test/dummy/app/assets/stylesheets/people.css.scss
173
154
  - test/dummy/app/assets/stylesheets/scaffolds.css.scss
174
155
  - test/dummy/app/controllers/application_controller.rb
175
156
  - test/dummy/app/controllers/contacts_controller.rb
@@ -211,6 +192,7 @@ files:
211
192
  - test/dummy/db/migrate/20120510131331_create_people.rb
212
193
  - test/dummy/db/migrate/20120510134500_create_contacts.rb
213
194
  - test/dummy/db/schema.rb
195
+ - test/dummy/db/seeds.rb
214
196
  - test/dummy/log/.gitkeep
215
197
  - test/dummy/public/404.html
216
198
  - test/dummy/public/422.html
@@ -233,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
215
  requirements:
234
216
  - - ! '>='
235
217
  - !ruby/object:Gem::Version
236
- version: '0'
218
+ version: 1.9.3
237
219
  required_rubygems_version: !ruby/object:Gem::Requirement
238
220
  none: false
239
221
  requirements:
@@ -255,11 +237,7 @@ test_files:
255
237
  - test/dummy/Rakefile
256
238
  - test/dummy/app/assets/images/rails.png
257
239
  - test/dummy/app/assets/javascripts/application.js
258
- - test/dummy/app/assets/javascripts/contacts.js.coffee
259
- - test/dummy/app/assets/javascripts/people.js.coffee
260
240
  - test/dummy/app/assets/stylesheets/application.css
261
- - test/dummy/app/assets/stylesheets/contacts.css.scss
262
- - test/dummy/app/assets/stylesheets/people.css.scss
263
241
  - test/dummy/app/assets/stylesheets/scaffolds.css.scss
264
242
  - test/dummy/app/controllers/application_controller.rb
265
243
  - test/dummy/app/controllers/contacts_controller.rb
@@ -301,6 +279,7 @@ test_files:
301
279
  - test/dummy/db/migrate/20120510131331_create_people.rb
302
280
  - test/dummy/db/migrate/20120510134500_create_contacts.rb
303
281
  - test/dummy/db/schema.rb
282
+ - test/dummy/db/seeds.rb
304
283
  - test/dummy/log/.gitkeep
305
284
  - test/dummy/public/404.html
306
285
  - test/dummy/public/422.html
@@ -1,136 +0,0 @@
1
- /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; coding: utf-8 -*- */
2
- /*jslint browser: true */
3
- /* List Javascript Inobtrusive Support for jQuery */
4
-
5
- (function ($) {
6
- "use strict";
7
-
8
- $.ActiveList = {};
9
-
10
- // Main function which reload table with specified data parameters
11
- $.ActiveList.refresh = function (element, new_parameters) {
12
- var source, parameters, url;
13
- // element = $(element);
14
- source = element.closest('div[data-list-source]');
15
- parameters = {
16
- sort: source.data("list-sort-by"),
17
- dir: source.data("list-sort-dir"),
18
- page: source.data("list-current-page"),
19
- per_page: source.data("list-page-size")
20
- };
21
- $.extend(parameters, new_parameters);
22
- url = source.data('list-source');
23
- $.ajax(url, {
24
- data: parameters,
25
- dataType: "html",
26
- success: function (data, status, request) {
27
- source.replaceWith(data);
28
- return true;
29
- }
30
- });
31
- return false;
32
- };
33
-
34
-
35
- $.ActiveList.moveToPage = function (element, page) {
36
- var page_attr;
37
- // element = $(element);
38
- if (page === undefined || page === null || page === '') {
39
- page = element.data('list-move-to-page');
40
- }
41
- if (page === undefined || page === null || page === '') {
42
- alert("Cannot define which page to load: "+page);
43
- }
44
- if (isNaN(page)) {
45
- page_attr = page;
46
- page = element.attr(page_attr);
47
- if (isNaN(page)) {
48
- alert("Cannot define which page to load with attribute " + page_attr + ": "+page);
49
- }
50
- }
51
- $.ActiveList.refresh(element, {page: page});
52
- return false;
53
- };
54
-
55
-
56
- // Sort by one column
57
- $(document).on('click', 'div[data-list-source] th[data-list-column][data-list-column-sort]', function(event) {
58
- var element = $(this);
59
- $.ActiveList.refresh(element, {
60
- sort: element.data('list-column'),
61
- dir: element.data('list-column-sort')
62
- });
63
- return false;
64
- });
65
-
66
-
67
- // Change number of item per page
68
- $(document).on('click', 'div[data-list-source] li[data-list-change-page-size]', function(event) {
69
- var element = $(this), per_page=element.data('list-change-page-size');
70
- if (isNaN(per_page)) {
71
- alert("@list-change-page-size attribute is not a number: "+per_page);
72
- } else {
73
- $.ActiveList.refresh(element, {per_page: per_page});
74
- }
75
- return false;
76
- });
77
-
78
-
79
- // Toggle visibility of a column
80
- $(document).on('click', 'div[data-list-source] li[data-list-toggle-column]', function(event) {
81
- var element = $(this), columnId, column, className, search, visibility = '', url, source;
82
- columnId = element.data('list-toggle-column');
83
- source = element.closest('div[data-list-source]');
84
- column = source.find('th[data-list-column="'+columnId+'"]');
85
- //$('#'+columnId);
86
- className = column.data("list-column-cells");
87
- if (className === null) {
88
- className = columnId;
89
- }
90
- search = '.'+className;
91
- if (column.hasClass("hidden")) {
92
- $(search).removeClass("hidden");
93
- column.removeClass("hidden");
94
- element.removeClass("unchecked");
95
- element.addClass("checked");
96
- visibility = 'shown';
97
- } else {
98
- $(search).addClass("hidden");
99
- column.addClass("hidden");
100
- element.removeClass("checked");
101
- element.addClass("unchecked");
102
- visibility = 'hidden';
103
- }
104
- url = source.data('list-source');
105
- $.ajax(url, {
106
- dataType: "html",
107
- data: {
108
- visibility: visibility,
109
- column: columnId
110
- }
111
- });
112
- return false;
113
- });
114
-
115
- // Change page of table on link clicks
116
- $(document).on('click', 'div[data-list-source] a[data-list-move-to-page]', function(event) {
117
- $.ActiveList.moveToPage($(this));
118
- return false;
119
- });
120
-
121
- // Change page of table on input changes
122
- $(document).on('change', 'div[data-list-source] input[data-list-move-to-page]', function(event) {
123
- $.ActiveList.moveToPage($(this));
124
- return false;
125
- });
126
-
127
-
128
- // Adds title attribute based on link name
129
- $(document).on('hover', 'div[data-list-source] tbody tr td.act a', function (event) {
130
- var element = $(this), title = element.attr('title');
131
- if (title === null || title === undefined) {
132
- element.attr('title', element.html());
133
- }
134
- });
135
-
136
- })(jQuery);