erp_forms 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/GPL-3-LICENSE +674 -0
  2. data/README.rdoc +2 -0
  3. data/Rakefile +30 -0
  4. data/app/assets/javascripts/erp_forms/application.js +9 -0
  5. data/app/assets/stylesheets/erp_forms/application.css +7 -0
  6. data/app/controllers/erp_forms/erp_app/desktop/dynamic_forms/base_controller.rb +47 -0
  7. data/app/controllers/erp_forms/erp_app/desktop/dynamic_forms/data_controller.rb +87 -0
  8. data/app/controllers/erp_forms/erp_app/desktop/dynamic_forms/forms_controller.rb +79 -0
  9. data/app/controllers/erp_forms/erp_app/desktop/dynamic_forms/models_controller.rb +45 -0
  10. data/app/helpers/erp_forms/application_helper.rb +4 -0
  11. data/app/models/dynamic_datum.rb +65 -0
  12. data/app/models/dynamic_form.rb +191 -0
  13. data/app/models/dynamic_form_document.rb +29 -0
  14. data/app/models/dynamic_form_model.rb +42 -0
  15. data/app/views/layouts/application.html.erb +14 -0
  16. data/app/views/layouts/erp_forms/application.html.erb +14 -0
  17. data/app/widgets/dynamic_forms/base.rb +61 -0
  18. data/app/widgets/dynamic_forms/javascript/dynamic_forms.js +109 -0
  19. data/app/widgets/dynamic_forms/views/error.html.erb +4 -0
  20. data/app/widgets/dynamic_forms/views/index.html.erb +8 -0
  21. data/app/widgets/dynamic_forms/views/success.html.erb +4 -0
  22. data/config/routes.rb +6 -0
  23. data/db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.rb +30 -0
  24. data/db/data_migrations/20110822170240_update_contact_form_validation.rb +22 -0
  25. data/db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.rb +18 -0
  26. data/db/data_migrations/20110830170240_update_contact_form.rb +23 -0
  27. data/db/migrate/20110530193446_dynamic_forms.rb +82 -0
  28. data/lib/erp_forms/dynamic_attributes_patch.rb +10 -0
  29. data/lib/erp_forms/dynamic_form_field.rb +130 -0
  30. data/lib/erp_forms/dynamic_grid_column.rb +108 -0
  31. data/lib/erp_forms/engine.rb +22 -0
  32. data/lib/erp_forms/extensions/active_record/has_dynamic_data.rb +54 -0
  33. data/lib/erp_forms/extensions/active_record/has_dynamic_forms.rb +70 -0
  34. data/lib/erp_forms/extensions/extensions.rb +6 -0
  35. data/lib/erp_forms/extensions/railties/action_view.rb +20 -0
  36. data/lib/erp_forms/version.rb +3 -0
  37. data/lib/erp_forms.rb +11 -0
  38. data/lib/tasks/erp_forms_tasks.rake +4 -0
  39. data/public/javascripts/erp_app/desktop/applications/dynamic_forms/center_region.js +23 -0
  40. data/public/javascripts/erp_app/desktop/applications/dynamic_forms/dynamic_data_grid.js +81 -0
  41. data/public/javascripts/erp_app/desktop/applications/dynamic_forms/form_builder.js +93 -0
  42. data/public/javascripts/erp_app/desktop/applications/dynamic_forms/module.js +37 -0
  43. data/public/javascripts/erp_app/desktop/applications/dynamic_forms/west_region.js +468 -0
  44. data/public/javascripts/erp_app/shared/dynamic_forms/dynamic_forms_validation.js +4 -0
  45. data/spec/dummy/Rakefile +7 -0
  46. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  47. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  48. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  49. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  50. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  51. data/spec/dummy/config/application.rb +45 -0
  52. data/spec/dummy/config/boot.rb +10 -0
  53. data/spec/dummy/config/database.yml +8 -0
  54. data/spec/dummy/config/environment.rb +5 -0
  55. data/spec/dummy/config/environments/spec.rb +27 -0
  56. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  57. data/spec/dummy/config/initializers/inflections.rb +10 -0
  58. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  59. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  60. data/spec/dummy/config/initializers/session_store.rb +8 -0
  61. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  62. data/spec/dummy/config/locales/en.yml +5 -0
  63. data/spec/dummy/config/routes.rb +4 -0
  64. data/spec/dummy/config.ru +4 -0
  65. data/spec/dummy/public/404.html +26 -0
  66. data/spec/dummy/public/422.html +26 -0
  67. data/spec/dummy/public/500.html +26 -0
  68. data/spec/dummy/public/favicon.ico +0 -0
  69. data/spec/dummy/script/rails +6 -0
  70. data/spec/models/dynamic_datum_spec.rb +9 -0
  71. data/spec/models/dynamic_form_document_spec.rb +11 -0
  72. data/spec/models/dynamic_form_model_spec.rb +11 -0
  73. data/spec/models/dynamic_form_spec.rb +11 -0
  74. data/spec/spec_helper.rb +60 -0
  75. metadata +183 -0
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActionController::Base.wrap_parameters :format => [:json]
8
+
9
+ # Disable root element in JSON by default.
10
+ if defined?(ActiveRecord)
11
+ ActiveRecord::Base.include_root_in_json = false
12
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount ErpForms::Engine => "/erp_forms"
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe DynamicDatum do
4
+ it "can be instantiated" do
5
+ DynamicDatum.new.should be_an_instance_of(DynamicDatum)
6
+ end
7
+
8
+ it "can be saved successfully"
9
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe DynamicFormDocument do
4
+ it "can be instantiated" do
5
+ DynamicFormDocument.new.should be_an_instance_of(DynamicFormDocument)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ DynamicFormDocument.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe DynamicFormModel do
4
+ it "can be instantiated" do
5
+ DynamicFormModel.new.should be_an_instance_of(DynamicFormModel)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ DynamicFormModel.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe DynamicForm do
4
+ it "can be instantiated" do
5
+ DynamicForm.new.should be_an_instance_of(DynamicForm)
6
+ end
7
+
8
+ it "can be saved successfully" do
9
+ DynamicForm.create().should be_persisted
10
+ end
11
+ end
@@ -0,0 +1,60 @@
1
+ require 'spork'
2
+ require 'rake'
3
+
4
+ Spork.prefork do
5
+ # Loading more in this block will cause your tests to run faster. However,
6
+ # if you change any configuration or code from libraries loaded here, you'll
7
+ # need to restart spork for it take effect.
8
+
9
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
10
+ DUMMY_APP_ROOT=File.join(File.dirname(__FILE__), '/dummy')
11
+
12
+ require 'active_support'
13
+ require 'active_model'
14
+ require 'active_record'
15
+ require 'action_controller'
16
+
17
+ # Configure Rails Envinronment
18
+ ENV["RAILS_ENV"] = "spec"
19
+ require File.expand_path(DUMMY_APP_ROOT + "/config/environment.rb", __FILE__)
20
+
21
+ ActiveRecord::Base.configurations = YAML::load(IO.read(DUMMY_APP_ROOT + "/config/database.yml"))
22
+ ActiveRecord::Base.establish_connection(ENV["DB"] || "spec")
23
+ ActiveRecord::Migration.verbose = false
24
+
25
+ # Requires supporting ruby files with custom matchers and macros, etc,
26
+ # in spec/support/ and its subdirectories.
27
+ Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
28
+
29
+ require 'rspec/rails'
30
+ require 'erp_dev_svcs'
31
+
32
+ RSpec.configure do |config|
33
+ config.use_transactional_fixtures = true
34
+ config.include Sorcery::TestHelpers::Rails
35
+ config.include ErpDevSvcs
36
+ config.include ErpDevSvcs::ControllerSupport, :type => :controller
37
+ end
38
+ end
39
+
40
+ Spork.each_run do
41
+ #We have to execute the migrations from dummy app directory
42
+ Dir.chdir DUMMY_APP_ROOT
43
+ `rake db:drop`
44
+ Dir.chdir ENGINE_RAILS_ROOT
45
+
46
+ #We have to execute the migrations from dummy app directory
47
+ Dir.chdir DUMMY_APP_ROOT
48
+ `rake db:migrate`
49
+ Dir.chdir ENGINE_RAILS_ROOT
50
+
51
+ ErpDevSvcs::FactorySupport.load_engine_factories
52
+
53
+ require 'simplecov'
54
+ SimpleCov.start 'rails' do
55
+ add_filter "spec/"
56
+ end
57
+ #Need to explictly load the files in lib/ until we figure out how to
58
+ #get rails to autoload them for spec like it used to...
59
+ Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f}
60
+ end
metadata ADDED
@@ -0,0 +1,183 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: erp_forms
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Rick Koloski, Russell Holmes
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-06 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: dynamic_attributes
16
+ requirement: &2161004620 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - =
20
+ - !ruby/object:Gem::Version
21
+ version: 1.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2161004620
25
+ - !ruby/object:Gem::Dependency
26
+ name: erp_app
27
+ requirement: &2161003640 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *2161003640
36
+ - !ruby/object:Gem::Dependency
37
+ name: erp_dev_svcs
38
+ requirement: &2161001780 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2161001780
47
+ description: ErpForms provides dynamic form capability to existing and dynamic models.
48
+ Form Builder coming soon.
49
+ email:
50
+ - russonrails@gmail.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - public/javascripts/erp_app/desktop/applications/dynamic_forms/center_region.js
56
+ - public/javascripts/erp_app/desktop/applications/dynamic_forms/dynamic_data_grid.js
57
+ - public/javascripts/erp_app/desktop/applications/dynamic_forms/form_builder.js
58
+ - public/javascripts/erp_app/desktop/applications/dynamic_forms/module.js
59
+ - public/javascripts/erp_app/desktop/applications/dynamic_forms/west_region.js
60
+ - public/javascripts/erp_app/shared/dynamic_forms/dynamic_forms_validation.js
61
+ - app/assets/javascripts/erp_forms/application.js
62
+ - app/assets/stylesheets/erp_forms/application.css
63
+ - app/controllers/erp_forms/erp_app/desktop/dynamic_forms/base_controller.rb
64
+ - app/controllers/erp_forms/erp_app/desktop/dynamic_forms/data_controller.rb
65
+ - app/controllers/erp_forms/erp_app/desktop/dynamic_forms/forms_controller.rb
66
+ - app/controllers/erp_forms/erp_app/desktop/dynamic_forms/models_controller.rb
67
+ - app/helpers/erp_forms/application_helper.rb
68
+ - app/models/dynamic_datum.rb
69
+ - app/models/dynamic_form.rb
70
+ - app/models/dynamic_form_document.rb
71
+ - app/models/dynamic_form_model.rb
72
+ - app/views/layouts/application.html.erb
73
+ - app/views/layouts/erp_forms/application.html.erb
74
+ - app/widgets/dynamic_forms/base.rb
75
+ - app/widgets/dynamic_forms/javascript/dynamic_forms.js
76
+ - app/widgets/dynamic_forms/views/error.html.erb
77
+ - app/widgets/dynamic_forms/views/index.html.erb
78
+ - app/widgets/dynamic_forms/views/success.html.erb
79
+ - config/routes.rb
80
+ - db/data_migrations/20110608185830_create_default_dynamic_models_and_forms.rb
81
+ - db/data_migrations/20110822170240_update_contact_form_validation.rb
82
+ - db/data_migrations/20110828190913_create_desktop_app_dynamic_forms.rb
83
+ - db/data_migrations/20110830170240_update_contact_form.rb
84
+ - db/migrate/20110530193446_dynamic_forms.rb
85
+ - lib/erp_forms/dynamic_attributes_patch.rb
86
+ - lib/erp_forms/dynamic_form_field.rb
87
+ - lib/erp_forms/dynamic_grid_column.rb
88
+ - lib/erp_forms/engine.rb
89
+ - lib/erp_forms/extensions/active_record/has_dynamic_data.rb
90
+ - lib/erp_forms/extensions/active_record/has_dynamic_forms.rb
91
+ - lib/erp_forms/extensions/extensions.rb
92
+ - lib/erp_forms/extensions/railties/action_view.rb
93
+ - lib/erp_forms/version.rb
94
+ - lib/erp_forms.rb
95
+ - lib/tasks/erp_forms_tasks.rake
96
+ - GPL-3-LICENSE
97
+ - Rakefile
98
+ - README.rdoc
99
+ - spec/dummy/app/assets/javascripts/application.js
100
+ - spec/dummy/app/assets/stylesheets/application.css
101
+ - spec/dummy/app/controllers/application_controller.rb
102
+ - spec/dummy/app/helpers/application_helper.rb
103
+ - spec/dummy/app/views/layouts/application.html.erb
104
+ - spec/dummy/config/application.rb
105
+ - spec/dummy/config/boot.rb
106
+ - spec/dummy/config/database.yml
107
+ - spec/dummy/config/environment.rb
108
+ - spec/dummy/config/environments/spec.rb
109
+ - spec/dummy/config/initializers/backtrace_silencers.rb
110
+ - spec/dummy/config/initializers/inflections.rb
111
+ - spec/dummy/config/initializers/mime_types.rb
112
+ - spec/dummy/config/initializers/secret_token.rb
113
+ - spec/dummy/config/initializers/session_store.rb
114
+ - spec/dummy/config/initializers/wrap_parameters.rb
115
+ - spec/dummy/config/locales/en.yml
116
+ - spec/dummy/config/routes.rb
117
+ - spec/dummy/config.ru
118
+ - spec/dummy/public/404.html
119
+ - spec/dummy/public/422.html
120
+ - spec/dummy/public/500.html
121
+ - spec/dummy/public/favicon.ico
122
+ - spec/dummy/Rakefile
123
+ - spec/dummy/script/rails
124
+ - spec/models/dynamic_datum_spec.rb
125
+ - spec/models/dynamic_form_document_spec.rb
126
+ - spec/models/dynamic_form_model_spec.rb
127
+ - spec/models/dynamic_form_spec.rb
128
+ - spec/spec_helper.rb
129
+ homepage: http://development.compassagile.com
130
+ licenses: []
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ! '>='
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ requirements: []
148
+ rubyforge_project:
149
+ rubygems_version: 1.8.10
150
+ signing_key:
151
+ specification_version: 3
152
+ summary: ErpForms provides dynamic form capability to existing and dynamic models.
153
+ test_files:
154
+ - spec/dummy/app/assets/javascripts/application.js
155
+ - spec/dummy/app/assets/stylesheets/application.css
156
+ - spec/dummy/app/controllers/application_controller.rb
157
+ - spec/dummy/app/helpers/application_helper.rb
158
+ - spec/dummy/app/views/layouts/application.html.erb
159
+ - spec/dummy/config/application.rb
160
+ - spec/dummy/config/boot.rb
161
+ - spec/dummy/config/database.yml
162
+ - spec/dummy/config/environment.rb
163
+ - spec/dummy/config/environments/spec.rb
164
+ - spec/dummy/config/initializers/backtrace_silencers.rb
165
+ - spec/dummy/config/initializers/inflections.rb
166
+ - spec/dummy/config/initializers/mime_types.rb
167
+ - spec/dummy/config/initializers/secret_token.rb
168
+ - spec/dummy/config/initializers/session_store.rb
169
+ - spec/dummy/config/initializers/wrap_parameters.rb
170
+ - spec/dummy/config/locales/en.yml
171
+ - spec/dummy/config/routes.rb
172
+ - spec/dummy/config.ru
173
+ - spec/dummy/public/404.html
174
+ - spec/dummy/public/422.html
175
+ - spec/dummy/public/500.html
176
+ - spec/dummy/public/favicon.ico
177
+ - spec/dummy/Rakefile
178
+ - spec/dummy/script/rails
179
+ - spec/models/dynamic_datum_spec.rb
180
+ - spec/models/dynamic_form_document_spec.rb
181
+ - spec/models/dynamic_form_model_spec.rb
182
+ - spec/models/dynamic_form_spec.rb
183
+ - spec/spec_helper.rb