bootstrap_form 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +21 -8
  3. data/.gitignore +4 -2
  4. data/.rubocop.yml +2 -1
  5. data/.yarnrc +5 -0
  6. data/CHANGELOG.md +11 -3
  7. data/CONTRIBUTING.md +101 -14
  8. data/Dangerfile +4 -4
  9. data/Dockerfile +5 -5
  10. data/Gemfile +5 -21
  11. data/README.md +68 -21
  12. data/RELEASING.md +12 -1
  13. data/Rakefile +7 -6
  14. data/bootstrap_form.gemspec +6 -8
  15. data/docker-compose.yml +6 -24
  16. data/gemfiles/6.0.gemfile +1 -1
  17. data/gemfiles/6.1.gemfile +1 -1
  18. data/gemfiles/7.0.gemfile +2 -3
  19. data/gemfiles/common.gemfile +28 -0
  20. data/gemfiles/edge.gemfile +3 -2
  21. data/lib/bootstrap_form/components/labels.rb +3 -9
  22. data/lib/bootstrap_form/components/validation.rb +36 -19
  23. data/lib/bootstrap_form/form_builder.rb +3 -0
  24. data/lib/bootstrap_form/form_group.rb +9 -6
  25. data/lib/bootstrap_form/form_group_builder.rb +10 -7
  26. data/lib/bootstrap_form/helpers/bootstrap.rb +7 -8
  27. data/lib/bootstrap_form/helpers/field.rb +26 -0
  28. data/lib/bootstrap_form/helpers.rb +1 -0
  29. data/lib/bootstrap_form/inputs/check_box.rb +22 -6
  30. data/lib/bootstrap_form/inputs/radio_button.rb +3 -3
  31. data/lib/bootstrap_form/version.rb +2 -1
  32. data/lib/bootstrap_form.rb +1 -1
  33. metadata +14 -146
  34. data/demo/.postcssrc.yml +0 -3
  35. data/demo/.ruby-version +0 -1
  36. data/demo/Gemfile +0 -80
  37. data/demo/Gemfile.lock +0 -261
  38. data/demo/Procfile.dev +0 -2
  39. data/demo/README.md +0 -17
  40. data/demo/Rakefile +0 -6
  41. data/demo/app/assets/builds/.keep +0 -0
  42. data/demo/app/assets/builds/application.js.LICENSE.txt +0 -9
  43. data/demo/app/assets/config/manifest.js +0 -2
  44. data/demo/app/assets/stylesheets/actiontext.css +0 -31
  45. data/demo/app/assets/stylesheets/actiontext.scss +0 -38
  46. data/demo/app/assets/stylesheets/application.scss +0 -1
  47. data/demo/app/controllers/application_controller.rb +0 -2
  48. data/demo/app/controllers/bootstrap_controller.rb +0 -29
  49. data/demo/app/controllers/users_controller.rb +0 -9
  50. data/demo/app/helpers/bootstrap_helper.rb +0 -27
  51. data/demo/app/javascript/application.js +0 -3
  52. data/demo/app/javascript/channels/consumer.js +0 -6
  53. data/demo/app/javascript/channels/index.js +0 -5
  54. data/demo/app/javascript/packs/application.js +0 -11
  55. data/demo/app/models/address.rb +0 -3
  56. data/demo/app/models/application_record.rb +0 -3
  57. data/demo/app/models/faux_user.rb +0 -9
  58. data/demo/app/models/skill.rb +0 -15
  59. data/demo/app/models/super_user.rb +0 -2
  60. data/demo/app/models/user.rb +0 -25
  61. data/demo/app/views/active_storage/blobs/_blob.html.erb +0 -14
  62. data/demo/app/views/bootstrap/form.html.erb +0 -67
  63. data/demo/app/views/layouts/action_text/contents/_content.html.erb +0 -3
  64. data/demo/app/views/layouts/application.html.erb +0 -76
  65. data/demo/bin/bundle +0 -3
  66. data/demo/bin/dev +0 -9
  67. data/demo/bin/rails +0 -4
  68. data/demo/bin/rake +0 -4
  69. data/demo/bin/setup +0 -36
  70. data/demo/bin/update +0 -31
  71. data/demo/bin/webpack +0 -15
  72. data/demo/bin/webpack-dev-server +0 -15
  73. data/demo/bin/yarn +0 -11
  74. data/demo/config/application.rb +0 -21
  75. data/demo/config/boot.rb +0 -5
  76. data/demo/config/database.yml +0 -21
  77. data/demo/config/environment.rb +0 -5
  78. data/demo/config/environments/development.rb +0 -60
  79. data/demo/config/environments/production.rb +0 -48
  80. data/demo/config/environments/test.rb +0 -46
  81. data/demo/config/initializers/application_controller_renderer.rb +0 -8
  82. data/demo/config/initializers/backtrace_silencers.rb +0 -7
  83. data/demo/config/initializers/cookies_serializer.rb +0 -5
  84. data/demo/config/initializers/filter_parameter_logging.rb +0 -4
  85. data/demo/config/initializers/inflections.rb +0 -16
  86. data/demo/config/initializers/mime_types.rb +0 -4
  87. data/demo/config/initializers/wrap_parameters.rb +0 -14
  88. data/demo/config/locales/en.yml +0 -33
  89. data/demo/config/puma.rb +0 -56
  90. data/demo/config/routes.rb +0 -6
  91. data/demo/config/spring.rb +0 -6
  92. data/demo/config/storage.yml +0 -35
  93. data/demo/config/webpack/development.js +0 -5
  94. data/demo/config/webpack/environment.js +0 -3
  95. data/demo/config/webpack/production.js +0 -5
  96. data/demo/config/webpack/test.js +0 -5
  97. data/demo/config/webpacker.yml +0 -92
  98. data/demo/config.ru +0 -5
  99. data/demo/db/schema.rb +0 -84
  100. data/demo/doc/screenshots/bootstrap/index/00_horizontal_form.png +0 -0
  101. data/demo/doc/screenshots/bootstrap/index/01_with_validation_error.png +0 -0
  102. data/demo/doc/screenshots/bootstrap/index/02_inline_form.png +0 -0
  103. data/demo/doc/screenshots/bootstrap/index/03_simple_action_text_example.png +0 -0
  104. data/demo/doc/screenshots/bootstrap/index/04_floating_labels.png +0 -0
  105. data/demo/doc/screenshots/bootstrap/readme/00_example.png +0 -0
  106. data/demo/doc/screenshots/bootstrap/readme/01_example.png +0 -0
  107. data/demo/doc/screenshots/bootstrap/readme/02_example.png +0 -0
  108. data/demo/doc/screenshots/bootstrap/readme/03_example.png +0 -0
  109. data/demo/doc/screenshots/bootstrap/readme/04_example.png +0 -0
  110. data/demo/doc/screenshots/bootstrap/readme/05_example.png +0 -0
  111. data/demo/doc/screenshots/bootstrap/readme/06_example.png +0 -0
  112. data/demo/doc/screenshots/bootstrap/readme/07_example.png +0 -0
  113. data/demo/doc/screenshots/bootstrap/readme/08_example.png +0 -0
  114. data/demo/doc/screenshots/bootstrap/readme/09_example.png +0 -0
  115. data/demo/doc/screenshots/bootstrap/readme/10_example.png +0 -0
  116. data/demo/doc/screenshots/bootstrap/readme/11_example.png +0 -0
  117. data/demo/doc/screenshots/bootstrap/readme/12_example.png +0 -0
  118. data/demo/doc/screenshots/bootstrap/readme/13_example.png +0 -0
  119. data/demo/doc/screenshots/bootstrap/readme/14_example.png +0 -0
  120. data/demo/doc/screenshots/bootstrap/readme/15_example.png +0 -0
  121. data/demo/doc/screenshots/bootstrap/readme/16_example.png +0 -0
  122. data/demo/doc/screenshots/bootstrap/readme/17_example.png +0 -0
  123. data/demo/doc/screenshots/bootstrap/readme/18_example.png +0 -0
  124. data/demo/doc/screenshots/bootstrap/readme/19_example.png +0 -0
  125. data/demo/doc/screenshots/bootstrap/readme/20_example.png +0 -0
  126. data/demo/doc/screenshots/bootstrap/readme/21_example.png +0 -0
  127. data/demo/doc/screenshots/bootstrap/readme/22_example.png +0 -0
  128. data/demo/doc/screenshots/bootstrap/readme/23_example.png +0 -0
  129. data/demo/doc/screenshots/bootstrap/readme/24_example.png +0 -0
  130. data/demo/doc/screenshots/bootstrap/readme/25_example.png +0 -0
  131. data/demo/doc/screenshots/bootstrap/readme/26_example.png +0 -0
  132. data/demo/doc/screenshots/bootstrap/readme/27_example.png +0 -0
  133. data/demo/doc/screenshots/bootstrap/readme/28_example.png +0 -0
  134. data/demo/doc/screenshots/bootstrap/readme/29_example.png +0 -0
  135. data/demo/doc/screenshots/bootstrap/readme/30_example.png +0 -0
  136. data/demo/doc/screenshots/bootstrap/readme/31_example.png +0 -0
  137. data/demo/doc/screenshots/bootstrap/readme/32_example.png +0 -0
  138. data/demo/doc/screenshots/bootstrap/readme/33_example.png +0 -0
  139. data/demo/doc/screenshots/bootstrap/readme/34_example.png +0 -0
  140. data/demo/doc/screenshots/bootstrap/readme/35_example.png +0 -0
  141. data/demo/doc/screenshots/bootstrap/readme/36_example.png +0 -0
  142. data/demo/doc/screenshots/bootstrap/readme/37_example.png +0 -0
  143. data/demo/doc/screenshots/bootstrap/readme/38_example.png +0 -0
  144. data/demo/doc/screenshots/bootstrap/readme/39_example.png +0 -0
  145. data/demo/doc/screenshots/bootstrap/readme/40_example.png +0 -0
  146. data/demo/doc/screenshots/bootstrap/readme/41_example.png +0 -0
  147. data/demo/doc/screenshots/bootstrap/readme/42_example.png +0 -0
  148. data/demo/doc/screenshots/bootstrap/readme/43_example.png +0 -0
  149. data/demo/doc/screenshots/bootstrap/readme/44_example.png +0 -0
  150. data/demo/doc/screenshots/bootstrap/readme/45_example.png +0 -0
  151. data/demo/doc/screenshots/bootstrap/readme/46_example.png +0 -0
  152. data/demo/doc/screenshots/bootstrap/readme/47_example.png +0 -0
  153. data/demo/doc/screenshots/bootstrap/readme/48_example.png +0 -0
  154. data/demo/doc/screenshots/bootstrap/readme/49_example.png +0 -0
  155. data/demo/doc/screenshots/bootstrap/readme/50_example.png +0 -0
  156. data/demo/log/.keep +0 -0
  157. data/demo/package.json +0 -21
  158. data/demo/public/favicon.ico +0 -0
  159. data/demo/test/application_system_test_case.rb +0 -8
  160. data/demo/test/controllers/bootstrap_controller_test.rb +0 -8
  161. data/demo/test/controllers/users_controller_test.rb +0 -13
  162. data/demo/test/fixtures/action_text/rich_texts.yml +0 -4
  163. data/demo/test/fixtures/users.yml +0 -2
  164. data/demo/test/system/bootstrap_test.rb +0 -84
  165. data/demo/test/test_helper.rb +0 -10
  166. data/demo/webpack.config.js +0 -20
  167. data/demo/yarn.lock +0 -7176
  168. data/gemfiles/5.2.gemfile +0 -4
@@ -1,38 +0,0 @@
1
- //
2
- // Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
3
- // the trix-editor content (whether displayed or under editing). Feel free to incorporate this
4
- // inclusion directly in any other asset bundle and remove this file.
5
- //
6
- //= require trix/dist/trix
7
- // When using `application.scss`, this has to be `import`, not `require`.
8
- @import "trix/dist/trix";
9
-
10
- // We need to override trix.css’s image gallery styles to accommodate the
11
- // <action-text-attachment> element we wrap around attachments. Otherwise,
12
- // images in galleries will be squished by the max-width: 33%; rule.
13
- .trix-content {
14
- .attachment-gallery {
15
- > action-text-attachment,
16
- > .attachment {
17
- flex: 1 0 33%;
18
- padding: 0 0.5em;
19
- max-width: 33%;
20
- }
21
-
22
- &.attachment-gallery--2,
23
- &.attachment-gallery--4 {
24
- > action-text-attachment,
25
- > .attachment {
26
- flex-basis: 50%;
27
- max-width: 50%;
28
- }
29
- }
30
- }
31
-
32
- action-text-attachment {
33
- .attachment {
34
- padding: 0 !important;
35
- max-width: 100% !important;
36
- }
37
- }
38
- }
@@ -1 +0,0 @@
1
- // @import "actiontext";
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,29 +0,0 @@
1
- class BootstrapController < ApplicationController
2
- def form
3
- load_models
4
- end
5
-
6
- def fragment
7
- @erb = params[:erb]
8
-
9
- @erb.prepend '<div class="p-3 border">'
10
- @erb << "</div>"
11
- load_models
12
- render inline: @erb, layout: "application" # rubocop: disable Rails/RenderInline
13
- end
14
-
15
- private
16
-
17
- def load_models
18
- @collection = [
19
- Address.new(id: 1, street: "Foo"),
20
- Address.new(id: 2, street: "Bar")
21
- ]
22
-
23
- @user = User.new email: "steve@example.com"
24
-
25
- @user_with_error = User.new email: "steve.example.com"
26
- @user_with_error.errors.add(:email)
27
- @user_with_error.errors.add(:misc)
28
- end
29
- end
@@ -1,9 +0,0 @@
1
- class UsersController < ApplicationController
2
- def create
3
- redirect_to root_path
4
- end
5
-
6
- def update
7
- redirect_to root_path
8
- end
9
- end
@@ -1,27 +0,0 @@
1
- module BootstrapHelper
2
- def form_with_source(&block)
3
- form_html = capture(&block)
4
-
5
- tag.div(class: "example") do
6
- concat(form_html)
7
- concat(toggle)
8
- concat(codemirror(form_html))
9
- end
10
- end
11
-
12
- private
13
-
14
- def codemirror(form_html)
15
- tag.div(class: "code", style: "display: none") do
16
- tag.textarea(class: "codemirror") do
17
- HtmlBeautifier.beautify(form_html.strip.gsub(">", ">\n").gsub("<", "\n<"))
18
- end
19
- end
20
- end
21
-
22
- def toggle
23
- tag.button(class: "toggle btn btn-sm btn-info") do
24
- "Toggle Source Code"
25
- end
26
- end
27
- end
@@ -1,3 +0,0 @@
1
- // Entry point for the build script in your package.json
2
- import "trix"
3
- import "@rails/actiontext"
@@ -1,6 +0,0 @@
1
- // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
-
4
- import { createConsumer } from "@rails/actioncable"
5
-
6
- export default createConsumer()
@@ -1,5 +0,0 @@
1
- // Load all the channels within this directory and all subdirectories.
2
- // Channel files must be named *_channel.js.
3
-
4
- const channels = require.context('.', true, /_channel\.js$/)
5
- channels.keys().forEach(channels)
@@ -1,11 +0,0 @@
1
- // This file is automatically compiled by Webpack, along with any other files
2
- // present in this directory. You're encouraged to place your actual application logic in
3
- // a relevant structure within app/javascript and only use these pack files to reference
4
- // that code so it'll be compiled.
5
-
6
- require("@rails/ujs").start()
7
- require("turbolinks").start()
8
- require("@rails/activestorage").start()
9
- require("channels")
10
- require("trix")
11
- require("@rails/actiontext")
@@ -1,3 +0,0 @@
1
- class Address < ApplicationRecord
2
- belongs_to :user
3
- end
@@ -1,3 +0,0 @@
1
- class ApplicationRecord < ActiveRecord::Base
2
- self.abstract_class = true
3
- end
@@ -1,9 +0,0 @@
1
- class FauxUser
2
- attr_accessor :email, :password, :comments, :misc
3
-
4
- def initialize(attributes={})
5
- attributes.each do |name, value|
6
- send("#{name}=", value)
7
- end
8
- end
9
- end
@@ -1,15 +0,0 @@
1
- class Skill
2
- attr_accessor :id, :name
3
-
4
- def initialize(id:, name:)
5
- @id = id
6
- @name = name
7
- end
8
-
9
- def self.all
10
- [
11
- Skill.new(id: 1, name: "Mind reading"),
12
- Skill.new(id: 2, name: "Farming")
13
- ]
14
- end
15
- end
@@ -1,2 +0,0 @@
1
- class SuperUser < User
2
- end
@@ -1,25 +0,0 @@
1
- class User < ApplicationRecord
2
- attr_accessor :remember_me
3
-
4
- serialize :preferences
5
-
6
- validates :email, presence: true, length: { minimum: 5 }
7
- validates :terms, acceptance: { accept: true }
8
-
9
- has_one :address
10
- accepts_nested_attributes_for :address
11
-
12
- has_rich_text(:life_story) if Rails::VERSION::STRING > "6"
13
-
14
- def age
15
- 42
16
- end
17
-
18
- def feet
19
- 5
20
- end
21
-
22
- def inches
23
- 7
24
- end
25
- end
@@ -1,14 +0,0 @@
1
- <figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
2
- <% if blob.representable? %>
3
- <%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
4
- <% end %>
5
-
6
- <figcaption class="attachment__caption">
7
- <% if caption = blob.try(:caption) %>
8
- <%= caption %>
9
- <% else %>
10
- <span class="attachment__name"><%= blob.filename %></span>
11
- <span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
12
- <% end %>
13
- </figcaption>
14
- </figure>
@@ -1,67 +0,0 @@
1
- <h3>Horizontal Form</h3>
2
-
3
- <%= form_with_source do %>
4
- <%= bootstrap_form_with model: @user, layout: :horizontal, local: true do |form| %>
5
- <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
6
- <%= form.password_field :password, placeholder: "Password" %>
7
- <%= form.select :status, [['activated', 1], ['blocked', 2]], prompt: "Please Select" %>
8
- <%= form.text_area :misc %>
9
- <%= form.check_box :terms, label: "Agree to Terms" %>
10
- <%= form.collection_check_boxes :misc, @collection, :id, :street %>
11
- <%= form.collection_radio_buttons :misc, @collection, :id, :street %>
12
- <%= form.file_field :misc %>
13
- <%= form.datetime_select :misc, include_blank: true %>
14
-
15
- <%= form.submit %>
16
- <% end %>
17
- <% end %>
18
-
19
- <h3>With Validation Error</h3>
20
-
21
- <%= form_with_source do %>
22
- <%= bootstrap_form_for @user_with_error, layout: :horizontal do |form| %>
23
- <%= form.alert_message "This is an alert" %>
24
- <%= form.error_summary %>
25
- <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
26
- <%= form.collection_check_boxes :misc, @collection, :id, :street %>
27
- <%= form.submit %>
28
- <% end %>
29
- <% end %>
30
-
31
- <h3>Inline Form</h3>
32
-
33
- <%= form_with_source do %>
34
- <%= bootstrap_form_for @user, layout: :inline do |form| %>
35
- <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
36
- <%= form.password_field :password, placeholder: "Password" %>
37
- <%= form.check_box :terms, label: "Agree to Terms" %>
38
- <%= form.collection_check_boxes :misc, @collection, :id, :street %>
39
- <%= form.submit %>
40
- <% end %>
41
- <% end %>
42
-
43
- <h3>Simple Action Text Example</h3>
44
-
45
- <%= form_with_source do %>
46
- <%= bootstrap_form_for @user, url: "/" do |form| %>
47
- <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else" %>
48
- <%= form.password_field :password, placeholder: "Password" %>
49
- <%= form.check_box :terms, label: "Agree to Terms" %>
50
- <%= form.collection_check_boxes :misc, @collection, :id, :street %>
51
- <%= form.rich_text_area(:life_story) if Rails::VERSION::STRING > "6" %>
52
- <%= form.submit %>
53
- <% end %>
54
- <% end %>
55
-
56
- <h3>Floating Labels</h3>
57
-
58
- <%= form_with_source do %>
59
- <%= bootstrap_form_for @user do |form| %>
60
- <%= form.email_field :email, placeholder: "Enter Email", label: "Email address", help: "We'll never share your email with anyone else", floating: true %>
61
- <%= form.password_field :password, placeholder: "Password", floating: true %>
62
- <%= form.text_field :misc, floating: true %>
63
- <%= form.text_area :comments, floating: true %>
64
- <%= form.select :status, [["Active", 1], ["Inactive", 2]], include_blank: "Select a value", floating: true %>
65
- <%= form.submit %>
66
- <% end %>
67
- <% end %>
@@ -1,3 +0,0 @@
1
- <div class="trix-content">
2
- <%= yield -%>
3
- </div>
@@ -1,76 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <!-- Required meta tags -->
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7
-
8
- <!-- Bootstrap CSS -->
9
- <!-- CSS only -->
10
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
11
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.min.css">
12
-
13
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
14
- <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload', defer: true %>
15
-
16
- <style type="text/css">
17
- .example {
18
- padding: 1.5em;
19
- border: .2rem solid #f7f7f9;
20
- margin-bottom: 3em;
21
- }
22
- .toggle {
23
- margin-top: 1.5em;
24
- }
25
- .code {
26
- margin-top: 1rem;
27
- }
28
- .CodeMirror {
29
- border: 1px solid #eee;
30
- height: auto;
31
- }
32
- .rails-bootstrap-forms-datetime-select select {
33
- display: inline-block;
34
- width: auto;
35
- }
36
- </style>
37
-
38
- <title>Hello, world!</title>
39
- <%= csrf_meta_tags %>
40
- <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
41
- </head>
42
-
43
- <body>
44
- <div class="container">
45
- <%= yield %>
46
- </div>
47
-
48
- <!-- Optional JavaScript -->
49
- <!-- JavaScript Bundle with Popper -->
50
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
51
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/codemirror.min.js"></script>
52
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/mode/htmlmixed/htmlmixed.min.js"></script>
53
- <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.33.0/mode/xml/xml.min.js"></script>
54
-
55
- <script type="text/javascript">
56
- const buttons = document.querySelectorAll('button.toggle');
57
- const buttonsArray = Array.prototype.slice.call(buttons);
58
- buttonsArray.forEach(function(elem) {
59
- elem.addEventListener('click', function() {
60
- const example = this.closest('.example');
61
- if (example.querySelector('.code').style.display === "block") {
62
- example.querySelector('.code').style.display = "none";
63
- } else {
64
- example.querySelector('.code').style.display = "block";
65
- }
66
- CodeMirror.fromTextArea(example.querySelector('textarea.codemirror'), {
67
- mode: 'htmlmixed',
68
- tabSize: 2,
69
- lineNumbers: true,
70
- viewportMargin: Infinity,
71
- });
72
- });
73
- });
74
- </script>
75
- </body>
76
- </html>
data/demo/bin/bundle DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
3
- load Gem.bin_path("bundler", "bundle")
data/demo/bin/dev DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- if ! command -v foreman &> /dev/null
4
- then
5
- echo "Installing foreman..."
6
- gem install foreman
7
- fi
8
-
9
- foreman start -f Procfile.dev
data/demo/bin/rails DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path("../config/application", __dir__)
3
- require_relative "../config/boot"
4
- require "rails/commands"
data/demo/bin/rake DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative "../config/boot"
3
- require "rake"
4
- Rake.application.run
data/demo/bin/setup DELETED
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require "fileutils"
3
- include FileUtils
4
-
5
- # path to your application root.
6
- APP_ROOT = File.expand_path("..", __dir__)
7
-
8
- def system!(*args)
9
- system(*args) || abort("\n== Command #{args} failed ==")
10
- end
11
-
12
- chdir APP_ROOT do
13
- # This script is a starting point to setup your application.
14
- # Add necessary setup steps to this file.
15
-
16
- puts "== Installing dependencies =="
17
- system! "gem install bundler --conservative"
18
- system("bundle check") || system!("bundle install")
19
-
20
- # Install JavaScript dependencies if using Yarn
21
- # system('bin/yarn')
22
-
23
- # puts "\n== Copying sample files =="
24
- # unless File.exist?('config/database.yml')
25
- # cp 'config/database.yml.sample', 'config/database.yml'
26
- # end
27
-
28
- puts "\n== Preparing database =="
29
- system! "bin/rails db:setup"
30
-
31
- puts "\n== Removing old logs and tempfiles =="
32
- system! "bin/rails log:clear tmp:clear"
33
-
34
- puts "\n== Restarting application server =="
35
- system! "bin/rails restart"
36
- end
data/demo/bin/update DELETED
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require "fileutils"
3
- include FileUtils
4
-
5
- # path to your application root.
6
- APP_ROOT = File.expand_path("..", __dir__)
7
-
8
- def system!(*args)
9
- system(*args) || abort("\n== Command #{args} failed ==")
10
- end
11
-
12
- chdir APP_ROOT do
13
- # This script is a way to update your development environment automatically.
14
- # Add necessary update steps to this file.
15
-
16
- puts "== Installing dependencies =="
17
- system! "gem install bundler --conservative"
18
- system("bundle check") || system!("bundle install")
19
-
20
- # Install JavaScript dependencies if using Yarn
21
- # system('bin/yarn')
22
-
23
- puts "\n== Updating database =="
24
- system! "bin/rails db:migrate"
25
-
26
- puts "\n== Removing old logs and tempfiles =="
27
- system! "bin/rails log:clear tmp:clear"
28
-
29
- puts "\n== Restarting application server =="
30
- system! "bin/rails restart"
31
- end
data/demo/bin/webpack DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
- ENV["NODE_ENV"] ||= "development"
5
-
6
- require "pathname"
7
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8
- Pathname.new(__FILE__).realpath)
9
-
10
- require "rubygems"
11
- require "bundler/setup"
12
-
13
- require "webpacker"
14
- require "webpacker/webpack_runner"
15
- Webpacker::WebpackRunner.run(ARGV)
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
4
- ENV["NODE_ENV"] ||= "development"
5
-
6
- require "pathname"
7
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
8
- Pathname.new(__FILE__).realpath)
9
-
10
- require "rubygems"
11
- require "bundler/setup"
12
-
13
- require "webpacker"
14
- require "webpacker/dev_server_runner"
15
- Webpacker::DevServerRunner.run(ARGV)
data/demo/bin/yarn DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path("..", __dir__)
3
- Dir.chdir(APP_ROOT) do
4
- begin
5
- exec "yarnpkg #{ARGV.join(' ')}"
6
- rescue Errno::ENOENT
7
- warn "Yarn executable was not detected in the system."
8
- warn "Download Yarn at https://yarnpkg.com/en/docs/install"
9
- exit 1
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- require_relative "boot"
2
-
3
- require "rails/all"
4
-
5
- Bundler.require(*Rails.groups)
6
- require "bootstrap_form"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Initialize configuration defaults for originally generated Rails version.
11
-
12
- config.respond_to?(:load_defaults) &&
13
- config.load_defaults([Rails::VERSION::MAJOR, Rails::VERSION::MINOR].join("."))
14
-
15
- config.secret_key_base = "ignore" if config.respond_to?(:secret_key_base)
16
-
17
- # Settings in config/environments/* take precedence over those specified here.
18
- # Application configuration should go into files in config/initializers
19
- # -- all .rb files in that directory are automatically loaded.
20
- end
21
- end
data/demo/config/boot.rb DELETED
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
3
-
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../lib', __dir__)
@@ -1,21 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
- timeout: 5000
11
-
12
- development:
13
- <<: *default
14
- database: db/development.sqlite3
15
-
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
- test:
20
- <<: *default
21
- database: db/test.sqlite3
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require_relative 'application'
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!
@@ -1,60 +0,0 @@
1
- Rails.application.configure do
2
- # Verifies that versions and hashed value of the package contents in the project's package.json
3
- # config.webpacker.check_yarn_integrity = true
4
- # Settings specified here will take precedence over those in config/application.rb.
5
-
6
- # In the development environment your application's code is reloaded on
7
- # every request. This slows down response time but is perfect for development
8
- # since you don't have to restart the web server when you make code changes.
9
- config.cache_classes = false
10
-
11
- # Do not eager load code on boot.
12
- config.eager_load = false
13
-
14
- # Show full error reports.
15
- config.consider_all_requests_local = true
16
-
17
- # Enable/disable caching. By default caching is disabled.
18
- # Run rails dev:cache to toggle caching.
19
- if Rails.root.join("tmp/caching-dev.txt").exist?
20
- config.action_controller.perform_caching = true
21
-
22
- config.cache_store = :memory_store
23
- config.public_file_server.headers = {
24
- "Cache-Control" => "public, max-age=#{2.days.to_i}"
25
- }
26
- else
27
- config.action_controller.perform_caching = false
28
-
29
- config.cache_store = :null_store
30
- end
31
-
32
- # Store uploaded files on the local file system (see config/storage.yml for options)
33
- config.active_storage.service = :local if config.respond_to?(:active_storage)
34
-
35
- # Don't care if the mailer can't send.
36
- config.action_mailer.raise_delivery_errors = false
37
-
38
- config.action_mailer.perform_caching = false
39
-
40
- # Print deprecation notices to the Rails logger.
41
- config.active_support.deprecation = :log
42
-
43
- # Raise an error on page load if there are pending migrations.
44
- config.active_record.migration_error = :page_load
45
-
46
- # Debug mode disables concatenation and preprocessing of assets.
47
- # This option may cause significant delays in view rendering with a large
48
- # number of complex assets.
49
- # config.assets.debug = true
50
-
51
- # Suppress logger output for asset requests.
52
- # config.assets.quiet = true
53
-
54
- # Raises error for missing translations
55
- # config.action_view.raise_on_missing_translations = true
56
-
57
- # Use an evented file watcher to asynchronously detect changes in source code,
58
- # routes, locales, etc. This feature depends on the listen gem.
59
- # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
60
- end