minimum_viable_product 0.6.7 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/mvp +2 -3
  4. data/minimum_viable_product.gemspec +89 -3
  5. data/project/Gemfile +33 -0
  6. data/project/Gemfile.lock +437 -0
  7. data/project/Procfile +2 -0
  8. data/project/README.md +117 -0
  9. data/project/Rakefile +14 -0
  10. data/project/app/controllers/application_controller.rb +12 -0
  11. data/project/app/controllers/conversions_controller.rb +24 -0
  12. data/project/app/controllers/examples_controller.rb +2 -0
  13. data/project/app/controllers/home_controller.rb +7 -0
  14. data/project/app/decorators/.keep +0 -0
  15. data/project/app/helpers/application_helper.rb +24 -0
  16. data/project/app/mailers/.keep +0 -0
  17. data/project/app/models/conversion.rb +4 -0
  18. data/project/app/views/examples/index.html.erb +1 -0
  19. data/project/app/views/examples/mustache.html.erb +18 -0
  20. data/project/app/views/examples/mustache/template.mustache +1 -0
  21. data/project/app/views/home/conversion.html.erb +12 -0
  22. data/project/app/views/home/index.html.erb +28 -0
  23. data/project/app/views/layouts/_header.html.erb +16 -0
  24. data/project/app/views/layouts/_includes.html.erb +7 -0
  25. data/project/app/views/layouts/application.html.erb +17 -0
  26. data/project/app/views/layouts/modal.html.erb +14 -0
  27. data/project/assets/images/.keep +0 -0
  28. data/project/assets/images/favicon.ico +0 -0
  29. data/project/assets/javascripts/controllers/home.coffee +15 -0
  30. data/project/assets/javascripts/pack.js +9 -0
  31. data/project/assets/stylesheets/config/variables.scss +876 -0
  32. data/project/assets/stylesheets/layout/basic.scss +6 -0
  33. data/project/assets/stylesheets/layout/carousel.scss +127 -0
  34. data/project/assets/stylesheets/layout/cover.scss +129 -0
  35. data/project/assets/stylesheets/lib/spacing.scss +55 -0
  36. data/project/assets/stylesheets/skin/style.scss +16 -0
  37. data/project/assets/stylesheets/style.scss +8 -0
  38. data/project/bin/bundle +3 -0
  39. data/project/bin/rails +9 -0
  40. data/project/bin/rake +9 -0
  41. data/project/bin/setup +32 -0
  42. data/project/bin/spring +15 -0
  43. data/project/config.ru +4 -0
  44. data/project/config/application.rb +32 -0
  45. data/project/config/boot.rb +3 -0
  46. data/project/config/database.yml +19 -0
  47. data/project/config/environment.rb +5 -0
  48. data/project/config/environments/development.rb +67 -0
  49. data/project/config/environments/production.rb +93 -0
  50. data/project/config/environments/test.rb +42 -0
  51. data/project/config/initializers/assets.rb +11 -0
  52. data/project/config/initializers/backtrace_silencers.rb +7 -0
  53. data/project/config/initializers/cookies_serializer.rb +3 -0
  54. data/project/config/initializers/filter_parameter_logging.rb +4 -0
  55. data/project/config/initializers/inflections.rb +16 -0
  56. data/project/config/initializers/mime_types.rb +4 -0
  57. data/project/config/initializers/mustache.rb +7 -0
  58. data/project/config/initializers/rails_admin.rb +43 -0
  59. data/project/config/initializers/session_store.rb +3 -0
  60. data/project/config/initializers/simple_form.rb +177 -0
  61. data/project/config/initializers/wrap_parameters.rb +14 -0
  62. data/project/config/locales/en.yml +23 -0
  63. data/project/config/locales/simple_form.en.yml +31 -0
  64. data/project/config/routes.rb +13 -0
  65. data/project/config/secrets.yml +8 -0
  66. data/project/config/sitemap.rb +28 -0
  67. data/project/db/migrate/20160728235100_create_conversions.rb +9 -0
  68. data/project/db/schema.rb +25 -0
  69. data/project/db/seeds.rb +7 -0
  70. data/project/lib/assets/.keep +0 -0
  71. data/project/lib/tasks/heroku.rake +70 -0
  72. data/project/log/.keep +0 -0
  73. data/project/log/development.log +48216 -0
  74. data/project/log/production.log +0 -0
  75. data/project/package.json +44 -0
  76. data/project/public/404.html +67 -0
  77. data/project/public/422.html +67 -0
  78. data/project/public/500.html +66 -0
  79. data/project/public/assets/javascripts/448c34a56d699c29117adc64c43affeb.woff2 +0 -0
  80. data/project/public/assets/javascripts/89889688147bd7575d6327160d64e760.svg +288 -0
  81. data/project/public/assets/javascripts/e18bbf611f2a2e43afc071aa2f4e1512.ttf +0 -0
  82. data/project/public/assets/javascripts/f4769f9bdb7466be65088239c12046d1.eot +0 -0
  83. data/project/public/assets/javascripts/fa2772327f55d8198301fdb8bcfc8158.woff +0 -0
  84. data/project/public/assets/javascripts/pack.js +31367 -0
  85. data/project/public/assets/javascripts/pack.js.map +1 -0
  86. data/project/public/assets/pack.js +17220 -0
  87. data/project/public/assets/style.css +7477 -0
  88. data/project/vendor/assets/javascripts/.keep +0 -0
  89. data/project/vendor/assets/stylesheets/.keep +0 -0
  90. data/project/webpack.config.js +67 -0
  91. metadata +88 -2
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,19 @@
1
+ default: &default
2
+ adapter: postgresql
3
+ pool: 5
4
+ timeout: 5000
5
+
6
+ development:
7
+ <<: *default
8
+ database: __PROJECT_NAME_SLUG___development
9
+
10
+ # Warning: The database defined as "test" will be erased and
11
+ # re-generated from your development database when you run "rake".
12
+ # Do not set this db to the same as development or production.
13
+ test:
14
+ <<: *default
15
+ database: __PROJECT_NAME_SLUG___test
16
+
17
+ production:
18
+ <<: *default
19
+ database: __PROJECT_NAME_SLUG___development
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,67 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+ if ENV['DELIVER_MAIL']=='true'
19
+ puts
20
+ puts
21
+ puts "WARNING WARNING WARNING WARNING WARNING WARNING"
22
+ puts "Mailing turned on in development"
23
+ puts
24
+ puts
25
+ config.action_mailer.delivery_method = :postmark
26
+ config.action_mailer.postmark_settings = { :api_token => ENV['POSTMARK_API_TOKEN'] }
27
+ else
28
+ config.action_mailer.delivery_method = :letter_opener
29
+ end
30
+
31
+ # Print deprecation notices to the Rails logger.
32
+ config.active_support.deprecation = :log
33
+
34
+ # Raise an error on page load if there are pending migrations.
35
+ config.active_record.migration_error = :page_load
36
+
37
+ # Disable serving static files from the `/public` folder by default since
38
+ # Apache or NGINX already handles this.
39
+ config.serve_static_files = true
40
+
41
+ # Compress JavaScripts and CSS.
42
+ # config.assets.js_compressor = :uglifier
43
+ # config.assets.css_compressor = :sass
44
+
45
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
46
+ config.assets.compile = true
47
+
48
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
49
+ # yet still be able to expire them through the digest params.
50
+ config.assets.digest = true
51
+
52
+ # Debug mode disables concatenation and preprocessing of assets.
53
+ # This option may cause significant delays in view rendering with a large
54
+ # number of complex assets.
55
+ config.assets.debug = true
56
+
57
+ # Rails assets are so noisy. Quiet them down.
58
+ config.assets.quiet = true
59
+
60
+ # Adds additional error checking when serving assets at runtime.
61
+ # Checks for improperly declared sprockets dependencies.
62
+ # Raises helpful error messages.
63
+ config.assets.raise_runtime_errors = true
64
+
65
+ # Raises error for missing translations
66
+ # config.action_view.raise_on_missing_translations = true
67
+ end
@@ -0,0 +1,93 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # set FORCE_SSL=true in your .env
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+ if ENV['POSTMARK_API_TOKEN']
67
+ config.action_mailer.delivery_method = :postmark
68
+ config.action_mailer.postmark_settings = { :api_token => ENV['POSTMARK_API_TOKEN'] }
69
+ elsif ENV['MAILTRAP_USERNAME']
70
+ config.action_mailer.delivery_method = :smtp
71
+ config.action_mailer.smtp_settings = {
72
+ :user_name => ENV['MAILTRAP_USERNAME'],
73
+ :password => ENV['MAILTRAP_PASSWORD'],
74
+ :address => 'mailtrap.io',
75
+ :domain => 'mailtrap.io',
76
+ :port => '2525',
77
+ :authentication => :cram_md5
78
+ }
79
+ end
80
+
81
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
82
+ # the I18n.default_locale when a translation cannot be found).
83
+ config.i18n.fallbacks = true
84
+
85
+ # Send deprecation notices to registered listeners.
86
+ config.active_support.deprecation = :notify
87
+
88
+ # Use default logging formatter so that PID and timestamp are not suppressed.
89
+ config.log_formatter = ::Logger::Formatter.new
90
+
91
+ # Do not dump schema after migrations.
92
+ config.active_record.dump_schema_after_migration = false
93
+ end
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ Rails.application.config.assets.paths << Rails.root.join('public', 'assets', 'javascripts')
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,7 @@
1
+ SmtRails.configure do |config|
2
+ config.template_extension = 'mustache' # change extension of mustache templates
3
+ config.action_view_key = 'mustache' # change name of key for rendering in ActionView mustache template
4
+ config.template_namespace = 'SMT' # change templates namespace in javascript
5
+ # config.template_base_path = Rails.root.join("assets", "templates") # templates dir
6
+ config.template_base_path = Rails.root.join("app", "views")
7
+ end
@@ -0,0 +1,43 @@
1
+ RailsAdmin.config do |config|
2
+ config.authorize_with do
3
+ if ENV["ADMIN_USER"] && ENV["ADMIN_PASSWORD"]
4
+ authenticate_or_request_with_http_basic('Site Message') do |username, password|
5
+ username == ENV["ADMIN_USER"] && password == ENV["ADMIN_PASSWORD"]
6
+ end
7
+ end
8
+ end
9
+ ### Popular gems integration
10
+
11
+ ## == Devise ==
12
+ # config.authenticate_with do
13
+ # warden.authenticate! scope: :user
14
+ # end
15
+ # config.current_user_method(&:current_user)
16
+
17
+ ## == Cancan ==
18
+ # config.authorize_with :cancan
19
+
20
+ ## == Pundit ==
21
+ # config.authorize_with :pundit
22
+
23
+ ## == PaperTrail ==
24
+ # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
25
+
26
+ ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
27
+
28
+ config.actions do
29
+ dashboard # mandatory
30
+ index # mandatory
31
+ new
32
+ export
33
+ bulk_delete
34
+ show
35
+ edit
36
+ delete
37
+ show_in_app
38
+
39
+ ## With an audit adapter, you can add:
40
+ # history_index
41
+ # history_show
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '___PROJECT_NAME_SLUG___session'
@@ -0,0 +1,177 @@
1
+ SimpleForm.setup do |config|
2
+ config.label_text = lambda { |label, required, explicit_label| "#{label}" }
3
+ config.error_notification_class = 'alert alert-danger'
4
+ config.button_class = 'btn btn-default'
5
+ config.boolean_label_class = nil
6
+
7
+ config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
8
+ b.use :html5
9
+ b.use :placeholder
10
+ b.optional :maxlength
11
+ b.optional :pattern
12
+ b.optional :min_max
13
+ b.optional :readonly
14
+ b.use :label, class: 'form-control-label'
15
+
16
+ b.use :input, class: 'form-control'
17
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
18
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
19
+ end
20
+
21
+ config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
22
+ b.use :html5
23
+ b.use :placeholder
24
+ b.optional :maxlength
25
+ b.optional :readonly
26
+ b.use :label, class: 'form-control-label'
27
+
28
+ b.use :input
29
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
30
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
31
+ end
32
+
33
+ config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
34
+ b.use :html5
35
+ b.optional :readonly
36
+
37
+ b.wrapper tag: 'div', class: 'checkbox' do |ba|
38
+ ba.use :label_input
39
+ end
40
+
41
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
42
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
43
+ end
44
+
45
+ config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
46
+ b.use :html5
47
+ b.optional :readonly
48
+ b.use :label, class: 'form-control-label'
49
+ b.use :input
50
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
51
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
52
+ end
53
+
54
+ config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
55
+ b.use :html5
56
+ b.use :placeholder
57
+ b.optional :maxlength
58
+ b.optional :pattern
59
+ b.optional :min_max
60
+ b.optional :readonly
61
+ b.use :label, class: 'col-sm-3 form-control-label'
62
+
63
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
64
+ ba.use :input, class: 'form-control'
65
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
66
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
67
+ end
68
+ end
69
+
70
+ config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
71
+ b.use :html5
72
+ b.use :placeholder
73
+ b.optional :maxlength
74
+ b.optional :readonly
75
+ b.use :label, class: 'col-sm-3 form-control-label'
76
+
77
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
78
+ ba.use :input
79
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
80
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
81
+ end
82
+ end
83
+
84
+ config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
85
+ b.use :html5
86
+ b.optional :readonly
87
+
88
+ b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
89
+ wr.wrapper tag: 'div', class: 'checkbox' do |ba|
90
+ ba.use :label_input
91
+ end
92
+
93
+ wr.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
94
+ wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
95
+ end
96
+ end
97
+
98
+ config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
99
+ b.use :html5
100
+ b.optional :readonly
101
+
102
+ b.use :label, class: 'col-sm-3 form-control-label'
103
+
104
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
105
+ ba.use :input
106
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
107
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
108
+ end
109
+ end
110
+
111
+ config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
112
+ b.use :html5
113
+ b.use :placeholder
114
+ b.optional :maxlength
115
+ b.optional :pattern
116
+ b.optional :min_max
117
+ b.optional :readonly
118
+ b.use :label, class: 'sr-only'
119
+
120
+ b.use :input, class: 'form-control'
121
+ b.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
122
+ b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
123
+ end
124
+
125
+ config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
126
+ b.use :html5
127
+ b.optional :readonly
128
+ b.use :label, class: 'form-control-label'
129
+ b.wrapper tag: 'div', class: 'form-inline' do |ba|
130
+ ba.use :input, class: 'form-control'
131
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
132
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
133
+ end
134
+ end
135
+ # Wrappers for forms and inputs using the Bootstrap toolkit.
136
+ # Check the Bootstrap docs (http://getbootstrap.com)
137
+ # to learn about the different styles for forms and inputs,
138
+ # buttons and other elements.
139
+ config.default_wrapper = :vertical_form
140
+ config.wrapper_mappings = {
141
+ check_boxes: :vertical_radio_and_checkboxes,
142
+ radio_buttons: :vertical_radio_and_checkboxes,
143
+ file: :vertical_file_input,
144
+ boolean: :vertical_boolean,
145
+ datetime: :multi_select,
146
+ date: :multi_select,
147
+ time: :multi_select
148
+ }
149
+
150
+ config.wrappers :vertical_input_group, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
151
+ b.use :html5
152
+ b.use :placeholder
153
+ b.use :label, class: 'form-control-label'
154
+
155
+ b.wrapper tag: 'div' do |ba|
156
+ ba.wrapper tag: 'div', class: 'input-group col-sm-12' do |append|
157
+ append.use :input, class: 'form-control'
158
+ end
159
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
160
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
161
+ end
162
+ end
163
+
164
+ config.wrappers :horizontal_input_group, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|
165
+ b.use :html5
166
+ b.use :placeholder
167
+ b.use :label, class: 'col-sm-3 form-control-label'
168
+
169
+ b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
170
+ ba.wrapper tag: 'div', class: 'input-group col-sm-12' do |append|
171
+ append.use :input, class: 'form-control'
172
+ end
173
+ ba.use :error, wrap_with: { tag: 'span', class: 'form-control-feedback' }
174
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
175
+ end
176
+ end
177
+ end