active_admin-acts_as_list 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/active_admin/acts_as_list/helper.rb +24 -24
- data/lib/active_admin/acts_as_list/version.rb +2 -2
- metadata +98 -114
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e9abac66af08c351c72898658cafb701c3dbc558
|
4
|
+
data.tar.gz: 7b94d105672b66857f7a1b2f3d1613299211b215
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fa63efa19498f9071be429931d6b70ecc54599ef83ef00302f39760599a66d28cbcc94ea00dd6e68c428e95ae532a9a2b365f444c7582541b5f442e28dbe5b53
|
7
|
+
data.tar.gz: 6e33b6d69e2258e16fa1a76a2e8f6c2e5fe96ab14f30277890338a59d1210a9b772ee3104fbcf341094f2afdaa2e42051a97dd71d386ae17c2c34cc33571d574
|
@@ -10,7 +10,7 @@ module ActiveAdmin
|
|
10
10
|
# ActiveAdmin.register Player do
|
11
11
|
# index do
|
12
12
|
# # This adds columns for moving up, down, top and bottom.
|
13
|
-
# sortable_columns
|
13
|
+
# sortable_columns
|
14
14
|
# #...
|
15
15
|
# column :firstname
|
16
16
|
# column :lastname
|
@@ -19,20 +19,20 @@ module ActiveAdmin
|
|
19
19
|
# end
|
20
20
|
def sortable_columns
|
21
21
|
column "▲▲".html_safe do |resource|
|
22
|
-
link_to("▲▲".html_safe, self.send(:"move_to_top_admin_#{resource.class.model_name.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.first?
|
22
|
+
link_to("▲▲".html_safe, self.send(:"move_to_top_admin_#{resource.class.model_name.to_s.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.first?
|
23
23
|
end
|
24
24
|
column "▲".html_safe do |resource|
|
25
|
-
link_to("▲".html_safe, self.send(:"move_up_admin_#{resource.class.model_name.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.first?
|
25
|
+
link_to("▲".html_safe, self.send(:"move_up_admin_#{resource.class.model_name.to_s.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.first?
|
26
26
|
end
|
27
27
|
column "▼".html_safe do |resource|
|
28
|
-
link_to("▼".html_safe, self.send(:"move_down_admin_#{resource.class.model_name.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.last?
|
28
|
+
link_to("▼".html_safe, self.send(:"move_down_admin_#{resource.class.model_name.to_s.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.last?
|
29
29
|
end
|
30
30
|
column "▼▼".html_safe do |resource|
|
31
|
-
link_to("▼▼".html_safe, self.send(:"move_to_bottom_admin_#{resource.class.model_name.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.last?
|
31
|
+
link_to("▼▼".html_safe, self.send(:"move_to_bottom_admin_#{resource.class.model_name.to_s.underscore.gsub("/", "_")}_path", resource), :class => "arrow") unless resource.last?
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
35
|
-
|
34
|
+
|
35
|
+
|
36
36
|
# Call this inside your resource definition to add the needed member actions
|
37
37
|
# for your sortable resource.
|
38
38
|
#
|
@@ -43,51 +43,51 @@ module ActiveAdmin
|
|
43
43
|
# ActiveAdmin.register Player do
|
44
44
|
# # Sort players by position
|
45
45
|
# config.sort_order = 'position'
|
46
|
-
#
|
46
|
+
#
|
47
47
|
# # Add member actions for positioning.
|
48
48
|
# sortable_member_actions
|
49
49
|
# end
|
50
50
|
def sortable_member_actions
|
51
51
|
member_action :move_to_top do
|
52
52
|
if resource.first?
|
53
|
-
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_to_top', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
53
|
+
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_to_top', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
54
54
|
return
|
55
|
-
end
|
56
|
-
|
55
|
+
end
|
56
|
+
|
57
57
|
resource.move_to_top
|
58
58
|
redirect_to :back, :notice => I18n.t('acts_as_list.moved_to_top', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
member_action :move_to_bottom do
|
62
62
|
if resource.last?
|
63
|
-
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_to_bottom', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
63
|
+
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_to_bottom', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
64
64
|
return
|
65
|
-
end
|
66
|
-
|
65
|
+
end
|
66
|
+
|
67
67
|
resource.move_to_bottom
|
68
68
|
redirect_to :back, :notice => I18n.t('acts_as_list.moved_to_bottom', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
69
69
|
end
|
70
70
|
|
71
71
|
member_action :move_up do
|
72
72
|
if resource.first?
|
73
|
-
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_up', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
73
|
+
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_up', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
74
74
|
return
|
75
|
-
end
|
76
|
-
|
75
|
+
end
|
76
|
+
|
77
77
|
resource.move_higher
|
78
78
|
redirect_to :back, :notice => I18n.t('acts_as_list.moved_up', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
79
79
|
end
|
80
80
|
|
81
81
|
member_action :move_down do
|
82
82
|
if resource.last?
|
83
|
-
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_down', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
83
|
+
redirect_to :back, :notice => I18n.t('acts_as_list.illegal_move_down', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
84
84
|
return
|
85
|
-
end
|
86
|
-
|
85
|
+
end
|
86
|
+
|
87
87
|
resource.move_lower
|
88
88
|
redirect_to :back, :notice => I18n.t('acts_as_list.moved_down', :resource => resource_class.to_s.camelize.constantize.model_name.human )
|
89
|
-
end
|
89
|
+
end
|
90
90
|
end
|
91
91
|
end
|
92
|
-
end
|
93
|
-
end
|
92
|
+
end
|
93
|
+
end
|
metadata
CHANGED
@@ -1,164 +1,148 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_admin-acts_as_list
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 7
|
10
|
-
version: 0.0.7
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Roberto Vasquez Angel
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2015-10-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: rails
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
- 3
|
31
|
-
- 2
|
32
|
-
- 5
|
33
|
-
version: 3.2.5
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5.0'
|
34
23
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: sqlite3
|
38
24
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: sqlite3
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
42
37
|
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
48
40
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: yard
|
52
41
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: yard
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
56
51
|
- - ">="
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
version: "0"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
62
54
|
type: :development
|
63
|
-
version_requirements: *id003
|
64
|
-
- !ruby/object:Gem::Dependency
|
65
|
-
name: thin
|
66
55
|
prerelease: false
|
67
|
-
|
68
|
-
|
69
|
-
requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
70
58
|
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: thin
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
76
68
|
type: :development
|
77
|
-
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
78
75
|
description: Provides sortable_columns helper in active admin resource definitions.
|
79
|
-
email:
|
76
|
+
email:
|
80
77
|
- roberto@vasquez-angel.de
|
81
78
|
executables: []
|
82
|
-
|
83
79
|
extensions: []
|
84
|
-
|
85
80
|
extra_rdoc_files: []
|
86
|
-
|
87
|
-
|
81
|
+
files:
|
82
|
+
- MIT-LICENSE
|
83
|
+
- README.rdoc
|
84
|
+
- Rakefile
|
88
85
|
- config/locales/active_admin-acts_as_list.de.yml
|
89
|
-
- lib/active_admin
|
86
|
+
- lib/active_admin-acts_as_list.rb
|
90
87
|
- lib/active_admin/acts_as_list/engine.rb
|
88
|
+
- lib/active_admin/acts_as_list/helper.rb
|
91
89
|
- lib/active_admin/acts_as_list/version.rb
|
92
90
|
- lib/tasks/active_admin-acts_as_list_tasks.rake
|
93
|
-
-
|
94
|
-
- MIT-LICENSE
|
95
|
-
- Rakefile
|
96
|
-
- README.rdoc
|
97
|
-
- test/test_helper.rb
|
98
|
-
- test/dummy/config.ru
|
99
|
-
- test/dummy/Rakefile
|
91
|
+
- test/active_admin-acts_as_list_test.rb
|
100
92
|
- test/dummy/README.rdoc
|
101
|
-
- test/dummy/
|
102
|
-
- test/dummy/
|
103
|
-
- test/dummy/
|
104
|
-
- test/dummy/
|
93
|
+
- test/dummy/Rakefile
|
94
|
+
- test/dummy/app/assets/javascripts/application.js
|
95
|
+
- test/dummy/app/assets/stylesheets/application.css
|
96
|
+
- test/dummy/app/controllers/application_controller.rb
|
97
|
+
- test/dummy/app/helpers/application_helper.rb
|
98
|
+
- test/dummy/app/views/layouts/application.html.erb
|
99
|
+
- test/dummy/config.ru
|
105
100
|
- test/dummy/config/application.rb
|
106
|
-
- test/dummy/config/database.yml
|
107
|
-
- test/dummy/config/routes.rb
|
108
101
|
- test/dummy/config/boot.rb
|
109
|
-
- test/dummy/config/
|
110
|
-
- test/dummy/config/
|
102
|
+
- test/dummy/config/database.yml
|
103
|
+
- test/dummy/config/environment.rb
|
111
104
|
- test/dummy/config/environments/development.rb
|
105
|
+
- test/dummy/config/environments/production.rb
|
112
106
|
- test/dummy/config/environments/test.rb
|
113
|
-
- test/dummy/config/
|
107
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
114
108
|
- test/dummy/config/initializers/inflections.rb
|
115
|
-
- test/dummy/config/initializers/wrap_parameters.rb
|
116
|
-
- test/dummy/config/initializers/secret_token.rb
|
117
109
|
- test/dummy/config/initializers/mime_types.rb
|
110
|
+
- test/dummy/config/initializers/secret_token.rb
|
118
111
|
- test/dummy/config/initializers/session_store.rb
|
119
|
-
- test/dummy/config/initializers/
|
120
|
-
- test/dummy/
|
121
|
-
- test/dummy/
|
122
|
-
- test/dummy/app/views/layouts/application.html.erb
|
123
|
-
- test/dummy/app/assets/stylesheets/application.css
|
124
|
-
- test/dummy/app/assets/javascripts/application.js
|
112
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
113
|
+
- test/dummy/config/locales/en.yml
|
114
|
+
- test/dummy/config/routes.rb
|
125
115
|
- test/dummy/log/development.log
|
116
|
+
- test/dummy/public/404.html
|
117
|
+
- test/dummy/public/422.html
|
118
|
+
- test/dummy/public/500.html
|
119
|
+
- test/dummy/public/favicon.ico
|
126
120
|
- test/dummy/script/rails
|
127
|
-
- test/
|
121
|
+
- test/test_helper.rb
|
128
122
|
homepage: https://github.com/robotex82/active_admin-acts_as_list
|
129
123
|
licenses: []
|
130
|
-
|
124
|
+
metadata: {}
|
131
125
|
post_install_message:
|
132
126
|
rdoc_options: []
|
133
|
-
|
134
|
-
require_paths:
|
127
|
+
require_paths:
|
135
128
|
- lib
|
136
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
-
|
138
|
-
requirements:
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
139
131
|
- - ">="
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
version: "0"
|
145
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
|
-
requirements:
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
148
136
|
- - ">="
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
|
151
|
-
segments:
|
152
|
-
- 0
|
153
|
-
version: "0"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
154
139
|
requirements: []
|
155
|
-
|
156
140
|
rubyforge_project:
|
157
|
-
rubygems_version:
|
141
|
+
rubygems_version: 2.4.8
|
158
142
|
signing_key:
|
159
|
-
specification_version:
|
143
|
+
specification_version: 4
|
160
144
|
summary: Provides sortable_columns helper in active admin resource definitions.
|
161
|
-
test_files:
|
145
|
+
test_files:
|
162
146
|
- test/test_helper.rb
|
163
147
|
- test/dummy/config.ru
|
164
148
|
- test/dummy/Rakefile
|