recordselect 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +25 -0
- data/MIT-LICENSE +20 -0
- data/README +15 -0
- data/app/views/record_select/_browse.html.erb +8 -0
- data/app/views/record_select/_list.html.erb +31 -0
- data/app/views/record_select/_search.html.erb +20 -0
- data/app/views/record_select/browse.js.rjs +1 -0
- data/assets/images/cross.gif +0 -0
- data/assets/images/next.gif +0 -0
- data/assets/images/previous.gif +0 -0
- data/assets/javascripts/jquery/record_select.js +499 -0
- data/assets/javascripts/prototype/record_select.js +369 -0
- data/assets/stylesheets/record_select.css +133 -0
- data/lib/record_select.rb +37 -0
- data/lib/record_select/actions.rb +68 -0
- data/lib/record_select/conditions.rb +100 -0
- data/lib/record_select/config.rb +99 -0
- data/lib/record_select/engine.rb +4 -0
- data/lib/record_select/extensions/active_record.rb +9 -0
- data/lib/record_select/extensions/localization.rb +8 -0
- data/lib/record_select/extensions/routing_mapper.rb +20 -0
- data/lib/record_select/form_builder.rb +25 -0
- data/lib/record_select/helpers/record_select_helper.rb +185 -0
- data/lib/record_select/version.rb +9 -0
- data/lib/record_select_assets.rb +28 -0
- data/lib/recordselect.rb +23 -0
- data/test/recordselect_test.rb +10 -0
- metadata +154 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
class RecordSelectAssets
|
2
|
+
|
3
|
+
def self.copy_to_public(options = {})
|
4
|
+
if defined? ActiveScaffold
|
5
|
+
RecordSelect::Config.js_framework = ActiveScaffold.js_framework
|
6
|
+
else
|
7
|
+
RecordSelect::Config.js_framework = :jquery
|
8
|
+
end
|
9
|
+
unless defined?(RECORD_SELECT_INSTALL_ASSETS) && RECORD_SELECT_INSTALL_ASSETS == false
|
10
|
+
['stylesheets', 'images', 'javascripts'].each do |asset_type|
|
11
|
+
if asset_type == 'javascripts'
|
12
|
+
local_dir = File.join(File.dirname(__FILE__), '..', 'assets', asset_type, RecordSelect::Config.js_framework.to_s)
|
13
|
+
else
|
14
|
+
local_dir = File.join(File.dirname(__FILE__), '..', 'assets', asset_type)
|
15
|
+
end
|
16
|
+
public_dir = File.join(Rails.root, 'public', asset_type, 'record_select')
|
17
|
+
FileUtils.mkdir public_dir unless File.exists? public_dir
|
18
|
+
Dir.entries(local_dir).each do |file|
|
19
|
+
next if file =~ /^\./
|
20
|
+
FileUtils.cp File.join(local_dir, file), public_dir
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
end
|
data/lib/recordselect.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'record_select_assets'
|
2
|
+
require 'record_select'
|
3
|
+
require 'record_select/extensions/localization'
|
4
|
+
require 'record_select/extensions/active_record'
|
5
|
+
require 'record_select/extensions/routing_mapper'
|
6
|
+
require 'record_select/actions'
|
7
|
+
require 'record_select/conditions'
|
8
|
+
require 'record_select/config'
|
9
|
+
require 'record_select/form_builder'
|
10
|
+
require 'record_select/helpers/record_select_helper'
|
11
|
+
require 'record_select/engine' unless defined? RECORD_SELECT_PLUGIN
|
12
|
+
|
13
|
+
ActionController::Base.send(:include, RecordSelect)
|
14
|
+
ActionView::Base.send(:include, RecordSelectHelper)
|
15
|
+
ActionView::Helpers::FormBuilder.send(:include, RecordSelect::FormBuilder)
|
16
|
+
|
17
|
+
Rails::Application.initializer("recordselect.install_assets") do
|
18
|
+
begin
|
19
|
+
RecordSelectAssets.copy_to_public
|
20
|
+
rescue
|
21
|
+
raise $! unless Rails.env == 'production'
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: recordselect
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 4
|
10
|
+
version: 3.0.4
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Sergio Cambra
|
14
|
+
- Volker Hochstein
|
15
|
+
- Lance Ivy
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
|
20
|
+
date: 2011-08-29 00:00:00 +02:00
|
21
|
+
default_executable:
|
22
|
+
dependencies:
|
23
|
+
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
requirement: *id001
|
34
|
+
prerelease: false
|
35
|
+
type: :development
|
36
|
+
name: shoulda
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 23
|
44
|
+
segments:
|
45
|
+
- 1
|
46
|
+
- 0
|
47
|
+
- 0
|
48
|
+
version: 1.0.0
|
49
|
+
requirement: *id002
|
50
|
+
prerelease: false
|
51
|
+
type: :development
|
52
|
+
name: bundler
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
63
|
+
requirement: *id003
|
64
|
+
prerelease: false
|
65
|
+
type: :development
|
66
|
+
name: rcov
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 7
|
74
|
+
segments:
|
75
|
+
- 3
|
76
|
+
- 0
|
77
|
+
- 0
|
78
|
+
version: 3.0.0
|
79
|
+
requirement: *id004
|
80
|
+
prerelease: false
|
81
|
+
type: :runtime
|
82
|
+
name: rails
|
83
|
+
description: RecordSelect is a Rails widget to help you pick one record out of many. I designed it as a more usable and performant alternative to generating a massive dropdown list
|
84
|
+
email: activescaffold@googlegroups.com
|
85
|
+
executables: []
|
86
|
+
|
87
|
+
extensions: []
|
88
|
+
|
89
|
+
extra_rdoc_files:
|
90
|
+
- README
|
91
|
+
files:
|
92
|
+
- assets/images/cross.gif
|
93
|
+
- assets/images/next.gif
|
94
|
+
- assets/images/previous.gif
|
95
|
+
- assets/javascripts/jquery/record_select.js
|
96
|
+
- assets/javascripts/prototype/record_select.js
|
97
|
+
- assets/stylesheets/record_select.css
|
98
|
+
- app/views/record_select/_list.html.erb
|
99
|
+
- app/views/record_select/_search.html.erb
|
100
|
+
- app/views/record_select/browse.js.rjs
|
101
|
+
- app/views/record_select/_browse.html.erb
|
102
|
+
- lib/record_select.rb
|
103
|
+
- lib/record_select_assets.rb
|
104
|
+
- lib/record_select/actions.rb
|
105
|
+
- lib/record_select/conditions.rb
|
106
|
+
- lib/record_select/config.rb
|
107
|
+
- lib/record_select/form_builder.rb
|
108
|
+
- lib/record_select/extensions/active_record.rb
|
109
|
+
- lib/record_select/extensions/localization.rb
|
110
|
+
- lib/record_select/extensions/routing_mapper.rb
|
111
|
+
- lib/record_select/helpers/record_select_helper.rb
|
112
|
+
- lib/record_select/version.rb
|
113
|
+
- lib/record_select/engine.rb
|
114
|
+
- lib/recordselect.rb
|
115
|
+
- MIT-LICENSE
|
116
|
+
- CHANGELOG
|
117
|
+
- README
|
118
|
+
- test/recordselect_test.rb
|
119
|
+
has_rdoc: true
|
120
|
+
homepage: http://github.com/scambra/recordselect
|
121
|
+
licenses:
|
122
|
+
- MIT
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options: []
|
125
|
+
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
137
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
hash: 3
|
143
|
+
segments:
|
144
|
+
- 0
|
145
|
+
version: "0"
|
146
|
+
requirements: []
|
147
|
+
|
148
|
+
rubyforge_project:
|
149
|
+
rubygems_version: 1.5.2
|
150
|
+
signing_key:
|
151
|
+
specification_version: 3
|
152
|
+
summary: RecordSelect widget as a replacement for massive drop down lists
|
153
|
+
test_files:
|
154
|
+
- test/recordselect_test.rb
|