activeadmin-select2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +146 -0
- data/LICENSE.txt +20 -0
- data/README.md +76 -0
- data/Rakefile +3 -0
- data/activeadmin-select2.gemspec +27 -0
- data/app/assets/javascripts/active_admin/select2.js.coffee +3 -0
- data/app/assets/javascripts/active_admin/select2/select2.js.coffee +7 -0
- data/app/assets/stylesheets/active_admin/select2/_base.css.scss +2 -0
- data/app/assets/stylesheets/active_admin/select2/_form.css.scss +3 -0
- data/lib/activeadmin-select2.rb +5 -0
- data/lib/activeadmin/inputs/filter_select2_multiple_input.rb +19 -0
- data/lib/activeadmin/select2.rb +5 -0
- data/lib/activeadmin/select2/engine.rb +11 -0
- data/lib/activeadmin/select2/filter_select_input_extension.rb +15 -0
- data/lib/activeadmin/select2/version.rb +5 -0
- data/lib/formtastic/inputs/select2_input.rb +13 -0
- metadata +132 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 18e931166f5d8befabde7031577a8bd68774f5d7
|
4
|
+
data.tar.gz: c4129043e0fadff790bc28bf3798f7683b5b6b02
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f20dbf621013a836739b5ca65d24736c9c5950fd037dd3566a837f53ae3f3625e1c360fbaa06b5fcc24d90453cd20e3f27378d7fa215ac8de92dd9570fd3da03
|
7
|
+
data.tar.gz: bfc41485a68155c1c89673332e605fcdac5e1816686a035543da58084c044d532ae3576ffe9efcaa2d3f2d72a891400de5256a9c6e0273300ec67c4cb79b5670
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
activeadmin-select2 (0.1.0)
|
5
|
+
activeadmin
|
6
|
+
jquery-rails
|
7
|
+
select2-rails
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
actionmailer (3.2.18)
|
13
|
+
actionpack (= 3.2.18)
|
14
|
+
mail (~> 2.5.4)
|
15
|
+
actionpack (3.2.18)
|
16
|
+
activemodel (= 3.2.18)
|
17
|
+
activesupport (= 3.2.18)
|
18
|
+
builder (~> 3.0.0)
|
19
|
+
erubis (~> 2.7.0)
|
20
|
+
journey (~> 1.0.4)
|
21
|
+
rack (~> 1.4.5)
|
22
|
+
rack-cache (~> 1.2)
|
23
|
+
rack-test (~> 0.6.1)
|
24
|
+
sprockets (~> 2.2.1)
|
25
|
+
activeadmin (0.6.3)
|
26
|
+
arbre (~> 1.0)
|
27
|
+
bourbon (>= 1.0.0, < 4)
|
28
|
+
devise (>= 1.5.4, < 4, != 2.2.2, != 2.2.1, != 2.2.0, != 2.1.2, != 2.1.1, != 2.1.0, != 2.0.4, != 2.0.3, != 2.0.2, != 2.0.1, != 2.0.0)
|
29
|
+
formtastic (~> 2.0)
|
30
|
+
inherited_resources (~> 1.3)
|
31
|
+
jquery-rails (>= 1.0.0, < 3)
|
32
|
+
kaminari (~> 0.13, != 0.15.0)
|
33
|
+
meta_search (~> 1.0)
|
34
|
+
rails (>= 3.0.0, < 4)
|
35
|
+
sass (~> 3.1)
|
36
|
+
activemodel (3.2.18)
|
37
|
+
activesupport (= 3.2.18)
|
38
|
+
builder (~> 3.0.0)
|
39
|
+
activerecord (3.2.18)
|
40
|
+
activemodel (= 3.2.18)
|
41
|
+
activesupport (= 3.2.18)
|
42
|
+
arel (~> 3.0.2)
|
43
|
+
tzinfo (~> 0.3.29)
|
44
|
+
activeresource (3.2.18)
|
45
|
+
activemodel (= 3.2.18)
|
46
|
+
activesupport (= 3.2.18)
|
47
|
+
activesupport (3.2.18)
|
48
|
+
i18n (~> 0.6, >= 0.6.4)
|
49
|
+
multi_json (~> 1.0)
|
50
|
+
arbre (1.0.1)
|
51
|
+
activesupport (>= 3.0.0)
|
52
|
+
arel (3.0.3)
|
53
|
+
bcrypt (3.1.7)
|
54
|
+
bourbon (3.2.3)
|
55
|
+
sass (~> 3.2)
|
56
|
+
thor
|
57
|
+
builder (3.0.4)
|
58
|
+
devise (3.2.4)
|
59
|
+
bcrypt (~> 3.0)
|
60
|
+
orm_adapter (~> 0.1)
|
61
|
+
railties (>= 3.2.6, < 5)
|
62
|
+
thread_safe (~> 0.1)
|
63
|
+
warden (~> 1.2.3)
|
64
|
+
erubis (2.7.0)
|
65
|
+
formtastic (2.2.1)
|
66
|
+
actionpack (>= 3.0)
|
67
|
+
has_scope (0.5.1)
|
68
|
+
hike (1.2.3)
|
69
|
+
i18n (0.6.9)
|
70
|
+
inherited_resources (1.4.0)
|
71
|
+
has_scope (~> 0.5.0)
|
72
|
+
responders (~> 0.9)
|
73
|
+
journey (1.0.4)
|
74
|
+
jquery-rails (2.3.0)
|
75
|
+
railties (>= 3.0, < 5.0)
|
76
|
+
thor (>= 0.14, < 2.0)
|
77
|
+
json (1.8.1)
|
78
|
+
kaminari (0.15.1)
|
79
|
+
actionpack (>= 3.0.0)
|
80
|
+
activesupport (>= 3.0.0)
|
81
|
+
mail (2.5.4)
|
82
|
+
mime-types (~> 1.16)
|
83
|
+
treetop (~> 1.4.8)
|
84
|
+
meta_search (1.1.3)
|
85
|
+
actionpack (~> 3.1)
|
86
|
+
activerecord (~> 3.1)
|
87
|
+
activesupport (~> 3.1)
|
88
|
+
polyamorous (~> 0.5.0)
|
89
|
+
mime-types (1.25.1)
|
90
|
+
multi_json (1.10.1)
|
91
|
+
orm_adapter (0.5.0)
|
92
|
+
polyamorous (0.5.0)
|
93
|
+
activerecord (~> 3.0)
|
94
|
+
polyglot (0.3.5)
|
95
|
+
rack (1.4.5)
|
96
|
+
rack-cache (1.2)
|
97
|
+
rack (>= 0.4)
|
98
|
+
rack-ssl (1.3.4)
|
99
|
+
rack
|
100
|
+
rack-test (0.6.2)
|
101
|
+
rack (>= 1.0)
|
102
|
+
rails (3.2.18)
|
103
|
+
actionmailer (= 3.2.18)
|
104
|
+
actionpack (= 3.2.18)
|
105
|
+
activerecord (= 3.2.18)
|
106
|
+
activeresource (= 3.2.18)
|
107
|
+
activesupport (= 3.2.18)
|
108
|
+
bundler (~> 1.0)
|
109
|
+
railties (= 3.2.18)
|
110
|
+
railties (3.2.18)
|
111
|
+
actionpack (= 3.2.18)
|
112
|
+
activesupport (= 3.2.18)
|
113
|
+
rack-ssl (~> 1.3.2)
|
114
|
+
rake (>= 0.8.7)
|
115
|
+
rdoc (~> 3.4)
|
116
|
+
thor (>= 0.14.6, < 2.0)
|
117
|
+
rake (10.3.2)
|
118
|
+
rdoc (3.12.2)
|
119
|
+
json (~> 1.4)
|
120
|
+
responders (0.9.3)
|
121
|
+
railties (~> 3.1)
|
122
|
+
sass (3.3.8)
|
123
|
+
select2-rails (3.5.7)
|
124
|
+
thor (~> 0.14)
|
125
|
+
sprockets (2.2.2)
|
126
|
+
hike (~> 1.2)
|
127
|
+
multi_json (~> 1.0)
|
128
|
+
rack (~> 1.0)
|
129
|
+
tilt (~> 1.1, != 1.3.0)
|
130
|
+
thor (0.19.1)
|
131
|
+
thread_safe (0.3.4)
|
132
|
+
tilt (1.4.1)
|
133
|
+
treetop (1.4.15)
|
134
|
+
polyglot
|
135
|
+
polyglot (>= 0.3.1)
|
136
|
+
tzinfo (0.3.39)
|
137
|
+
warden (1.2.3)
|
138
|
+
rack (>= 1.0)
|
139
|
+
|
140
|
+
PLATFORMS
|
141
|
+
ruby
|
142
|
+
|
143
|
+
DEPENDENCIES
|
144
|
+
activeadmin-select2!
|
145
|
+
bundler (~> 1.5)
|
146
|
+
rake
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2014 Mark Fariburn, Praxitar Ltd
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
# ActiveAdmin Select2
|
2
|
+
|
3
|
+
## Description
|
4
|
+
|
5
|
+
Incorporate Select2 JQuery into your ActiveAdmin apps.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add `activeadmin`, `jquery-rails` and `select2-rails` to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'activeadmin'
|
13
|
+
gem 'jquery-rails'
|
14
|
+
gem 'select2-rails'
|
15
|
+
```
|
16
|
+
|
17
|
+
And add `activeadmin-select2` to your Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'activeadmin-select2', github: 'mfairburn/activeadmin-select2'
|
21
|
+
```
|
22
|
+
|
23
|
+
Add the activeadmin-select2 calls to the active_admin stylesheets and javascripts with:
|
24
|
+
|
25
|
+
```active_admin.css.scss
|
26
|
+
@import "active_admin/select2/base";
|
27
|
+
```
|
28
|
+
|
29
|
+
```active_admin.js.coffee
|
30
|
+
#= require active_admin/select2
|
31
|
+
```
|
32
|
+
|
33
|
+
|
34
|
+
## Usage
|
35
|
+
|
36
|
+
### Filters
|
37
|
+
|
38
|
+
Standard :select filters will automagically be converted to Select2 filters. If you want a multi-select combo-box then use:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
ActiveAdmin.register Products do
|
42
|
+
|
43
|
+
filter :fruits, as: :select2_multiple, collection: [:apples, :bananas, :oranges]
|
44
|
+
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
48
|
+
### Select Lists
|
49
|
+
|
50
|
+
To use a Select2 style list simply change from :select to :select2 or :select2_multiple
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
ActiveAdmin.register Products do
|
54
|
+
|
55
|
+
form do |f|
|
56
|
+
f.input :fruit, as: :select2
|
57
|
+
end
|
58
|
+
|
59
|
+
form do |f|
|
60
|
+
f.inputs "Product" do
|
61
|
+
f.has_many :fruits, allow_destroy: true, new_record: "Add Fruit" do |e|
|
62
|
+
e.input :fruit, as: :select2_multiple
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
## Acknowledgements
|
71
|
+
|
72
|
+
|
73
|
+
## Copyright
|
74
|
+
|
75
|
+
Copyright (c) 2014 Mark Fairburn, Praxitar Ltd
|
76
|
+
See the file LICENSE.txt for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'activeadmin/select2/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "activeadmin-select2"
|
9
|
+
spec.version = ActiveAdmin::Select2::VERSION
|
10
|
+
spec.summary = %q{Incorporate Select2 jquery into ActiveAdmin}
|
11
|
+
spec.description = %q{With ActiveAdmin-Select2 you are able to chose Select2 as a drop-down entry option in Forms and Filters}
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.authors = ["Mark Fairburn"]
|
14
|
+
spec.email = "mark@praxitar,com"
|
15
|
+
spec.homepage = "https://github.com/mfairburn/activeadmin-select2#readme"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
21
|
+
spec.add_development_dependency "rake"
|
22
|
+
|
23
|
+
spec.add_runtime_dependency 'activeadmin'
|
24
|
+
spec.add_runtime_dependency 'jquery-rails'
|
25
|
+
spec.add_runtime_dependency 'select2-rails'
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module Inputs
|
3
|
+
class FilterSelect2MultipleInput < Formtastic::Inputs::SelectInput
|
4
|
+
|
5
|
+
include FilterBase
|
6
|
+
|
7
|
+
def input_name
|
8
|
+
"#{super}_in"
|
9
|
+
end
|
10
|
+
|
11
|
+
def extra_input_html_options
|
12
|
+
{
|
13
|
+
:class => 'select2-input', :multiple => true
|
14
|
+
}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
require 'activeadmin/select2/engine'
|
2
|
+
require 'activeadmin/select2/filter_select_input_extension.rb'
|
3
|
+
require 'activeadmin/inputs/filter_select2_multiple_input.rb'
|
4
|
+
|
5
|
+
ActiveAdmin::Inputs::FilterSelectInput.send :include, ActiveAdmin::Select2::Inputs::FilterSelectInputExtension
|
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activeadmin-select2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mark Fairburn
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activeadmin
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: jquery-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: select2-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: With ActiveAdmin-Select2 you are able to chose Select2 as a drop-down
|
84
|
+
entry option in Forms and Filters
|
85
|
+
email: mark@praxitar,com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- Gemfile
|
92
|
+
- Gemfile.lock
|
93
|
+
- LICENSE.txt
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- activeadmin-select2.gemspec
|
97
|
+
- app/assets/javascripts/active_admin/select2.js.coffee
|
98
|
+
- app/assets/javascripts/active_admin/select2/select2.js.coffee
|
99
|
+
- app/assets/stylesheets/active_admin/select2/_base.css.scss
|
100
|
+
- app/assets/stylesheets/active_admin/select2/_form.css.scss
|
101
|
+
- lib/activeadmin-select2.rb
|
102
|
+
- lib/activeadmin/inputs/filter_select2_multiple_input.rb
|
103
|
+
- lib/activeadmin/select2.rb
|
104
|
+
- lib/activeadmin/select2/engine.rb
|
105
|
+
- lib/activeadmin/select2/filter_select_input_extension.rb
|
106
|
+
- lib/activeadmin/select2/version.rb
|
107
|
+
- lib/formtastic/inputs/select2_input.rb
|
108
|
+
homepage: https://github.com/mfairburn/activeadmin-select2#readme
|
109
|
+
licenses:
|
110
|
+
- MIT
|
111
|
+
metadata: {}
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
requirements: []
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.2.1
|
129
|
+
signing_key:
|
130
|
+
specification_version: 4
|
131
|
+
summary: Incorporate Select2 jquery into ActiveAdmin
|
132
|
+
test_files: []
|