ultimate_turbo_modal 2.0.4 → 2.1.1

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 (164) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/TM_COMMANDS_GUIDE.md +0 -0
  3. data/.claude/commands/tm/add-dependency/add-dependency.md +0 -0
  4. data/.claude/commands/tm/add-subtask/add-subtask.md +0 -0
  5. data/.claude/commands/tm/add-subtask/convert-task-to-subtask.md +0 -0
  6. data/.claude/commands/tm/add-task/add-task.md +0 -0
  7. data/.claude/commands/tm/analyze-complexity/analyze-complexity.md +0 -0
  8. data/.claude/commands/tm/clear-subtasks/clear-all-subtasks.md +0 -0
  9. data/.claude/commands/tm/clear-subtasks/clear-subtasks.md +0 -0
  10. data/.claude/commands/tm/complexity-report/complexity-report.md +0 -0
  11. data/.claude/commands/tm/expand/expand-all-tasks.md +0 -0
  12. data/.claude/commands/tm/expand/expand-task.md +0 -0
  13. data/.claude/commands/tm/fix-dependencies/fix-dependencies.md +0 -0
  14. data/.claude/commands/tm/generate/generate-tasks.md +0 -0
  15. data/.claude/commands/tm/help.md +0 -0
  16. data/.claude/commands/tm/init/init-project-quick.md +0 -0
  17. data/.claude/commands/tm/init/init-project.md +0 -0
  18. data/.claude/commands/tm/learn.md +0 -0
  19. data/.claude/commands/tm/list/list-tasks-by-status.md +0 -0
  20. data/.claude/commands/tm/list/list-tasks-with-subtasks.md +0 -0
  21. data/.claude/commands/tm/list/list-tasks.md +0 -0
  22. data/.claude/commands/tm/models/setup-models.md +0 -0
  23. data/.claude/commands/tm/models/view-models.md +0 -0
  24. data/.claude/commands/tm/next/next-task.md +0 -0
  25. data/.claude/commands/tm/parse-prd/parse-prd-with-research.md +0 -0
  26. data/.claude/commands/tm/parse-prd/parse-prd.md +0 -0
  27. data/.claude/commands/tm/remove-dependency/remove-dependency.md +0 -0
  28. data/.claude/commands/tm/remove-subtask/remove-subtask.md +0 -0
  29. data/.claude/commands/tm/remove-task/remove-task.md +0 -0
  30. data/.claude/commands/tm/set-status/to-cancelled.md +0 -0
  31. data/.claude/commands/tm/set-status/to-deferred.md +0 -0
  32. data/.claude/commands/tm/set-status/to-done.md +0 -0
  33. data/.claude/commands/tm/set-status/to-in-progress.md +0 -0
  34. data/.claude/commands/tm/set-status/to-pending.md +0 -0
  35. data/.claude/commands/tm/set-status/to-review.md +0 -0
  36. data/.claude/commands/tm/setup/install-taskmaster.md +0 -0
  37. data/.claude/commands/tm/setup/quick-install-taskmaster.md +0 -0
  38. data/.claude/commands/tm/show/show-task.md +0 -0
  39. data/.claude/commands/tm/status/project-status.md +0 -0
  40. data/.claude/commands/tm/sync-readme/sync-readme.md +0 -0
  41. data/.claude/commands/tm/tm-main.md +0 -0
  42. data/.claude/commands/tm/update/update-single-task.md +0 -0
  43. data/.claude/commands/tm/update/update-task.md +0 -0
  44. data/.claude/commands/tm/update/update-tasks-from-id.md +0 -0
  45. data/.claude/commands/tm/utils/analyze-project.md +0 -0
  46. data/.claude/commands/tm/validate-dependencies/validate-dependencies.md +0 -0
  47. data/.claude/commands/tm/workflows/auto-implement-tasks.md +0 -0
  48. data/.claude/commands/tm/workflows/command-pipeline.md +0 -0
  49. data/.claude/commands/tm/workflows/smart-workflow.md +0 -0
  50. data/.cursor/rules/taskmaster/dev_workflow.mdc +424 -0
  51. data/.cursor/rules/taskmaster/taskmaster.mdc +558 -0
  52. data/.env.example +0 -0
  53. data/.taskmaster/CLAUDE.md +0 -0
  54. data/.taskmaster/config.json +37 -0
  55. data/.taskmaster/templates/example_prd.txt +0 -0
  56. data/.tool-versions +1 -1
  57. data/CHANGELOG.md +8 -0
  58. data/CLAUDE.md +82 -0
  59. data/Gemfile +1 -1
  60. data/Gemfile.lock +51 -125
  61. data/README.md +62 -98
  62. data/UPGRADING.md +55 -0
  63. data/VERSION +1 -1
  64. data/demo-app/.gitattributes +7 -0
  65. data/demo-app/.gitignore +34 -0
  66. data/demo-app/.ruby-version +1 -0
  67. data/demo-app/.tool-versions +2 -0
  68. data/demo-app/Gemfile +41 -0
  69. data/demo-app/Gemfile.lock +248 -0
  70. data/demo-app/Procfile.dev +3 -0
  71. data/demo-app/README.md +15 -0
  72. data/demo-app/Rakefile +6 -0
  73. data/demo-app/app/assets/builds/.keep +0 -0
  74. data/demo-app/app/assets/images/.keep +0 -0
  75. data/demo-app/app/assets/stylesheets/application.css +42 -0
  76. data/demo-app/app/controllers/application_controller.rb +10 -0
  77. data/demo-app/app/controllers/concerns/.keep +0 -0
  78. data/demo-app/app/controllers/concerns/set_flavor.rb +10 -0
  79. data/demo-app/app/controllers/hide_from_backends_controller.rb +34 -0
  80. data/demo-app/app/controllers/modal_controller.rb +11 -0
  81. data/demo-app/app/controllers/posts_controller.rb +69 -0
  82. data/demo-app/app/controllers/welcome_controller.rb +2 -0
  83. data/demo-app/app/helpers/application_helper.rb +9 -0
  84. data/demo-app/app/javascript/application.js +4 -0
  85. data/demo-app/app/javascript/controllers/application.js +13 -0
  86. data/demo-app/app/javascript/controllers/dark_mode_controller.js +28 -0
  87. data/demo-app/app/javascript/controllers/flash_controller.js +9 -0
  88. data/demo-app/app/javascript/controllers/hello_controller.js +7 -0
  89. data/demo-app/app/javascript/controllers/index.js +15 -0
  90. data/demo-app/app/models/application_record.rb +3 -0
  91. data/demo-app/app/models/concerns/.keep +0 -0
  92. data/demo-app/app/models/post.rb +4 -0
  93. data/demo-app/app/views/hide_from_backends/_notice.html.erb +10 -0
  94. data/demo-app/app/views/hide_from_backends/create.turbo_stream.erb +2 -0
  95. data/demo-app/app/views/hide_from_backends/new.html.erb +30 -0
  96. data/demo-app/app/views/layouts/application.html.erb +40 -0
  97. data/demo-app/app/views/modal/index.html.erb +45 -0
  98. data/demo-app/app/views/modal/show.html.erb +39 -0
  99. data/demo-app/app/views/posts/_form.html.erb +36 -0
  100. data/demo-app/app/views/posts/_post.html.erb +9 -0
  101. data/demo-app/app/views/posts/edit.html.erb +9 -0
  102. data/demo-app/app/views/posts/index.html.erb +14 -0
  103. data/demo-app/app/views/posts/new.html.erb +3 -0
  104. data/demo-app/app/views/posts/show.html.erb +21 -0
  105. data/demo-app/app/views/shared/_flash.html.erb +13 -0
  106. data/demo-app/app/views/welcome/index.html.erb +19 -0
  107. data/demo-app/bin/bundle +109 -0
  108. data/demo-app/bin/dev +7 -0
  109. data/demo-app/bin/rails +4 -0
  110. data/demo-app/bin/rake +4 -0
  111. data/demo-app/bin/setup +34 -0
  112. data/demo-app/config/application.rb +43 -0
  113. data/demo-app/config/boot.rb +3 -0
  114. data/demo-app/config/credentials.yml.enc +1 -0
  115. data/demo-app/config/database.yml +25 -0
  116. data/demo-app/config/environment.rb +14 -0
  117. data/demo-app/config/environments/development.rb +51 -0
  118. data/demo-app/config/environments/production.rb +67 -0
  119. data/demo-app/config/environments/test.rb +42 -0
  120. data/demo-app/config/initializers/assets.rb +7 -0
  121. data/demo-app/config/initializers/content_security_policy.rb +25 -0
  122. data/demo-app/config/initializers/filter_parameter_logging.rb +8 -0
  123. data/demo-app/config/initializers/inflections.rb +14 -0
  124. data/demo-app/config/initializers/new_framework_defaults_8_0.rb +30 -0
  125. data/demo-app/config/initializers/permissions_policy.rb +11 -0
  126. data/demo-app/config/initializers/ultimate_turbo_modal.rb +12 -0
  127. data/demo-app/config/initializers/ultimate_turbo_modal_tailwind.rb +21 -0
  128. data/demo-app/config/initializers/ultimate_turbo_modal_vanilla.rb +21 -0
  129. data/demo-app/config/locales/en.yml +33 -0
  130. data/demo-app/config/puma.rb +41 -0
  131. data/demo-app/config/routes.rb +9 -0
  132. data/demo-app/config.ru +6 -0
  133. data/demo-app/db/migrate/20230331002502_create_posts.rb +10 -0
  134. data/demo-app/db/migrate/20231031012703_add_post.rb +9 -0
  135. data/demo-app/db/migrate/20231128141054_add_publish_on_to_posts.rb +5 -0
  136. data/demo-app/db/schema.rb +22 -0
  137. data/demo-app/lib/assets/.keep +0 -0
  138. data/demo-app/lib/tasks/.keep +0 -0
  139. data/demo-app/log/.keep +0 -0
  140. data/demo-app/package.json +28 -0
  141. data/demo-app/postcss.config.js +7 -0
  142. data/demo-app/public/400.html +114 -0
  143. data/demo-app/public/404.html +114 -0
  144. data/demo-app/public/406-unsupported-browser.html +114 -0
  145. data/demo-app/public/422.html +114 -0
  146. data/demo-app/public/500.html +114 -0
  147. data/demo-app/public/apple-touch-icon-precomposed.png +0 -0
  148. data/demo-app/public/apple-touch-icon.png +0 -0
  149. data/demo-app/public/favicon.ico +0 -0
  150. data/demo-app/public/icon.png +0 -0
  151. data/demo-app/public/icon.svg +3 -0
  152. data/demo-app/public/img/bootstrap-logo-shadow.png +0 -0
  153. data/demo-app/public/img/unicat.jpg +0 -0
  154. data/demo-app/public/img/vanilla.png +0 -0
  155. data/demo-app/public/robots.txt +1 -0
  156. data/demo-app/tmp/.keep +0 -0
  157. data/demo-app/tmp/pids/.keep +0 -0
  158. data/demo-app/vendor/.keep +0 -0
  159. data/demo-app/yarn.lock +1022 -0
  160. data/javascript/modal_controller.js +63 -2
  161. data/javascript/package.json +4 -2
  162. data/javascript/yarn.lock +12 -0
  163. data/lib/ultimate_turbo_modal/configuration.rb +1 -0
  164. metadata +184 -4
@@ -0,0 +1,67 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
10
+ config.eager_load = true
11
+
12
+ # Full error reports are disabled.
13
+ config.consider_all_requests_local = false
14
+
15
+ # Turn on fragment caching in view templates.
16
+ config.action_controller.perform_caching = true
17
+
18
+ # Cache assets for far-future expiry since they are all digest stamped.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
20
+
21
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
22
+ # config.asset_host = "http://assets.example.com"
23
+
24
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
25
+ config.assume_ssl = true
26
+
27
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
28
+ config.force_ssl = true
29
+
30
+ # Skip http-to-https redirect for the default health check endpoint.
31
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
32
+
33
+ # Log to STDOUT with the current request id as a default log tag.
34
+ config.log_tags = [ :request_id ]
35
+ config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
36
+
37
+ # Change to "debug" to log everything (including potentially personally-identifiable information!)
38
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
39
+
40
+ # Prevent health checks from clogging up the logs.
41
+ config.silence_healthcheck_path = "/up"
42
+
43
+ # Don't log any deprecations.
44
+ config.active_support.report_deprecations = false
45
+
46
+ # Replace the default in-process memory cache store with a durable alternative.
47
+ # config.cache_store = :mem_cache_store
48
+
49
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
50
+ # the I18n.default_locale when a translation cannot be found).
51
+ config.i18n.fallbacks = true
52
+
53
+ # Do not dump schema after migrations.
54
+ config.active_record.dump_schema_after_migration = false
55
+
56
+ # Only use :id for inspections in production.
57
+ config.active_record.attributes_for_inspect = [ :id ]
58
+
59
+ # Enable DNS rebinding protection and other `Host` header attacks.
60
+ # config.hosts = [
61
+ # "example.com", # Allow requests from example.com
62
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
63
+ # ]
64
+ #
65
+ # Skip DNS rebinding protection for the default health check endpoint.
66
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
67
+ end
@@ -0,0 +1,42 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ # While tests run files are not watched, reloading is not necessary.
10
+ config.enable_reloading = false
11
+
12
+ # Eager loading loads your entire application. When running a single test locally,
13
+ # this is usually not necessary, and can slow down your test suite. However, it's
14
+ # recommended that you enable it in continuous integration systems to ensure eager
15
+ # loading is working properly before deploying your code.
16
+ config.eager_load = ENV["CI"].present?
17
+
18
+ # Configure public file server for tests with cache-control for performance.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
20
+
21
+ # Show full error reports.
22
+ config.consider_all_requests_local = true
23
+ config.cache_store = :null_store
24
+
25
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
26
+ config.action_dispatch.show_exceptions = :rescuable
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Print deprecation notices to the stderr.
32
+ config.active_support.deprecation = :stderr
33
+
34
+ # Raises error for missing translations.
35
+ # config.i18n.raise_on_missing_translations = true
36
+
37
+ # Annotate rendered view with file names.
38
+ # config.action_view.annotate_rendered_view_with_filenames = true
39
+
40
+ # Raise error when a before_action's only/except options reference missing actions.
41
+ config.action_controller.raise_on_missing_callback_actions = true
42
+ end
@@ -0,0 +1,7 @@
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 << Emoji.images_path
@@ -0,0 +1,25 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy.
4
+ # See the Securing Rails Applications Guide for more information:
5
+ # https://guides.rubyonrails.org/security.html#content-security-policy-header
6
+
7
+ # Rails.application.configure do
8
+ # config.content_security_policy do |policy|
9
+ # policy.default_src :self, :https
10
+ # policy.font_src :self, :https, :data
11
+ # policy.img_src :self, :https, :data
12
+ # policy.object_src :none
13
+ # policy.script_src :self, :https
14
+ # policy.style_src :self, :https
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+ #
19
+ # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20
+ # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21
+ # config.content_security_policy_nonce_directives = %w(script-src style-src)
22
+ #
23
+ # # Report violations without enforcing the policy.
24
+ # # config.content_security_policy_report_only = true
25
+ # end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4
+ # Use this to limit dissemination of sensitive information.
5
+ # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6
+ Rails.application.config.filter_parameters += [
7
+ :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
8
+ ]
@@ -0,0 +1,14 @@
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) { |inflect| inflect.acronym "UI" }
@@ -0,0 +1,30 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file eases your Rails 8.0 framework defaults upgrade.
4
+ #
5
+ # Uncomment each configuration one by one to switch to the new default.
6
+ # Once your application is ready to run with all new defaults, you can remove
7
+ # this file and set the `config.load_defaults` to `8.0`.
8
+ #
9
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
10
+ # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
11
+
12
+ ###
13
+ # Specifies whether `to_time` methods preserve the UTC offset of their receivers or preserves the timezone.
14
+ # If set to `:zone`, `to_time` methods will use the timezone of their receivers.
15
+ # If set to `:offset`, `to_time` methods will use the UTC offset.
16
+ # If `false`, `to_time` methods will convert to the local system UTC offset instead.
17
+ #++
18
+ # Rails.application.config.active_support.to_time_preserves_timezone = :zone
19
+
20
+ ###
21
+ # When both `If-Modified-Since` and `If-None-Match` are provided by the client
22
+ # only consider `If-None-Match` as specified by RFC 7232 Section 6.
23
+ # If set to `false` both conditions need to be satisfied.
24
+ #++
25
+ # Rails.application.config.action_dispatch.strict_freshness = true
26
+
27
+ ###
28
+ # Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks.
29
+ #++
30
+ # Regexp.timeout = 1
@@ -0,0 +1,11 @@
1
+ # Define an application-wide HTTP permissions policy. For further
2
+ # information see https://developers.google.com/web/updates/2018/06/feature-policy
3
+ #
4
+ # Rails.application.config.permissions_policy do |f|
5
+ # f.camera :none
6
+ # f.gyroscope :none
7
+ # f.microphone :none
8
+ # f.usb :none
9
+ # f.fullscreen :self
10
+ # f.payment :self, "https://secure.example.com"
11
+ # end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ UltimateTurboModal.configure do |config|
4
+ config.flavor = :tailwind
5
+ # config.close_button = true
6
+ # config.advance = true
7
+ # config.padding = true
8
+ # config.header = true
9
+ # config.header_divider = true
10
+ # config.footer_divider = true
11
+ # config.allowed_click_outside_selector = []
12
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Tailwind CSS v4
4
+ module UltimateTurboModal::Flavors
5
+ class Tailwind < UltimateTurboModal::Base
6
+ DIV_DIALOG_CLASSES = "relative group z-50"
7
+ DIV_OVERLAY_CLASSES = "fixed inset-0 bg-gray-900/70 transition-opacity dark:bg-gray-900/80"
8
+ DIV_OUTER_CLASSES = "fixed inset-0 overflow-y-auto sm:max-w-[80%] md:max-w-3xl sm:mx-auto m-4"
9
+ DIV_INNER_CLASSES = "flex min-h-full items-start justify-center pt-[10vh] sm:p-4"
10
+ DIV_CONTENT_CLASSES = "relative transform max-h-screen overflow-hidden rounded-lg bg-white text-left shadow-lg transition-all sm:my-8 sm:max-w-3xl dark:bg-gray-800 dark:text-white"
11
+ DIV_MAIN_CLASSES = "group-data-[padding=true]:p-4 group-data-[padding=true]:pt-2 overflow-y-auto max-h-[75vh]"
12
+ DIV_HEADER_CLASSES = "flex justify-between items-center w-full py-4 rounded-t dark:border-gray-600 group-data-[header-divider=true]:border-b group-data-[header=false]:absolute"
13
+ DIV_TITLE_CLASSES = "pl-4"
14
+ DIV_TITLE_H_CLASSES = "group-data-[title=false]:hidden text-lg font-semibold text-gray-900 dark:text-white"
15
+ DIV_FOOTER_CLASSES = "flex p-4 rounded-b dark:border-gray-600 group-data-[footer-divider=true]:border-t"
16
+ BUTTON_CLOSE_CLASSES = "mr-4 group-data-[close-button=false]:hidden"
17
+ BUTTON_CLOSE_SR_ONLY_CLASSES = "sr-only"
18
+ CLOSE_BUTTON_TAG_CLASSES = "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
19
+ ICON_CLOSE_CLASSES = "w-5 h-5"
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Vanilla CSS
4
+ module UltimateTurboModal::Flavors
5
+ class Vanilla < UltimateTurboModal::Base
6
+ DIV_DIALOG_CLASSES = "modal-container"
7
+ DIV_OVERLAY_CLASSES = "modal-overlay"
8
+ DIV_OUTER_CLASSES = "modal-outer"
9
+ DIV_INNER_CLASSES = "modal-inner"
10
+ DIV_CONTENT_CLASSES = "modal-content"
11
+ DIV_MAIN_CLASSES = "modal-main"
12
+ DIV_HEADER_CLASSES = "modal-header"
13
+ DIV_TITLE_CLASSES = "modal-title"
14
+ DIV_TITLE_H_CLASSES = "modal-title-h"
15
+ DIV_FOOTER_CLASSES = "modal-footer"
16
+ BUTTON_CLOSE_CLASSES = "modal-close"
17
+ BUTTON_CLOSE_SR_ONLY_CLASSES = "sr-only"
18
+ CLOSE_BUTTON_TAG_CLASSES = "modal-close-button"
19
+ ICON_CLOSE_CLASSES = "modal-close-icon"
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t "hello"
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t("hello") %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # "true": "foo"
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at https://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,41 @@
1
+ # This configuration file will be evaluated by Puma. The top-level methods that
2
+ # are invoked here are part of Puma's configuration DSL. For more information
3
+ # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4
+ #
5
+ # Puma starts a configurable number of processes (workers) and each process
6
+ # serves each request in a thread from an internal thread pool.
7
+ #
8
+ # You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
9
+ # should only set this value when you want to run 2 or more workers. The
10
+ # default is already 1.
11
+ #
12
+ # The ideal number of threads per worker depends both on how much time the
13
+ # application spends waiting for IO operations and on how much you wish to
14
+ # prioritize throughput over latency.
15
+ #
16
+ # As a rule of thumb, increasing the number of threads will increase how much
17
+ # traffic a given process can handle (throughput), but due to CRuby's
18
+ # Global VM Lock (GVL) it has diminishing returns and will degrade the
19
+ # response time (latency) of the application.
20
+ #
21
+ # The default is set to 3 threads as it's deemed a decent compromise between
22
+ # throughput and latency for the average Rails application.
23
+ #
24
+ # Any libraries that use a connection pool or another resource pool should
25
+ # be configured to provide at least as many connections as the number of
26
+ # threads. This includes Active Record's `pool` parameter in `database.yml`.
27
+ threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
28
+ threads threads_count, threads_count
29
+
30
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
31
+ port ENV.fetch("PORT", 3000)
32
+
33
+ # Allow puma to be restarted by `bin/rails restart` command.
34
+ plugin :tmp_restart
35
+
36
+ # Run the Solid Queue supervisor inside of Puma for single-server deployments
37
+ plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
38
+
39
+ # Specify the PID file. Defaults to tmp/pids/server.pid in development.
40
+ # In other environments, only set the PID file if requested.
41
+ pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
@@ -0,0 +1,9 @@
1
+ Rails.application.routes.draw do
2
+ resources :modal
3
+ resources :posts
4
+ resource :hide_from_backend, only: [:new, :create]
5
+ # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
6
+
7
+ # Defines the root path route ("/")
8
+ root to: "welcome#index"
9
+ end
@@ -0,0 +1,6 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require_relative "config/environment"
4
+
5
+ run Rails.application
6
+ Rails.application.load_server
@@ -0,0 +1,10 @@
1
+ class CreatePosts < ActiveRecord::Migration[7.0]
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title
5
+ t.string :body
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ class AddPost < ActiveRecord::Migration[7.0]
2
+ def up
3
+ Post.create(title: "Hello, world!", body: "This is my first post.")
4
+ end
5
+
6
+ def down
7
+ raise ActiveRecord::IrreversibleMigration
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddPublishOnToPosts < ActiveRecord::Migration[7.0]
2
+ def change
3
+ add_column :posts, :publish_on, :date
4
+ end
5
+ end
@@ -0,0 +1,22 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema[7.0].define(version: 2023_11_28_141054) do
14
+ create_table "posts", force: :cascade do |t|
15
+ t.string "title"
16
+ t.string "body"
17
+ t.datetime "created_at", null: false
18
+ t.datetime "updated_at", null: false
19
+ t.date "publish_on"
20
+ end
21
+
22
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "app",
3
+ "private": "true",
4
+ "dependencies": {
5
+ "@hotwired/stimulus": "^3.2.2",
6
+ "@hotwired/turbo-rails": "^8.0.0",
7
+ "@tailwindcss/aspect-ratio": "^0.4.2",
8
+ "@tailwindcss/forms": "^0.5.6",
9
+ "@tailwindcss/postcss": "^4.1.3",
10
+ "@tailwindcss/typography": "^0.5.10",
11
+ "autoprefixer": "^10.4.16",
12
+ "el-transition": "^0.0.7",
13
+ "esbuild": "^0.19.5",
14
+ "flatpickr": "^4.6.13",
15
+ "idiomorph": "^0.7.3",
16
+ "postcss": "^8.4.31",
17
+ "postcss-cli": "^10.1.0",
18
+ "postcss-import": "^15.1.0",
19
+ "stimulus-flatpickr": "^3.0.0-0",
20
+ "tailwindcss": "^4.1.3",
21
+ "ultimate_turbo_modal": "file:../javascript"
22
+ },
23
+ "scripts": {
24
+ "build": "esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=/assets",
25
+ "build:css": "postcss ./app/assets/stylesheets/application.css -o ./app/assets/builds/application.css"
26
+ },
27
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
28
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ plugins: [
3
+ require('postcss-import'),
4
+ require('autoprefixer'),
5
+ require('@tailwindcss/postcss')
6
+ ],
7
+ }
@@ -0,0 +1,114 @@
1
+ <!doctype html>
2
+
3
+ <html lang="en">
4
+
5
+ <head>
6
+
7
+ <title>The server cannot process the request due to a client error (400 Bad Request)</title>
8
+
9
+ <meta charset="utf-8">
10
+ <meta name="viewport" content="initial-scale=1, width=device-width">
11
+ <meta name="robots" content="noindex, nofollow">
12
+
13
+ <style>
14
+
15
+ *, *::before, *::after {
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ * {
20
+ margin: 0;
21
+ }
22
+
23
+ html {
24
+ font-size: 16px;
25
+ }
26
+
27
+ body {
28
+ background: #FFF;
29
+ color: #261B23;
30
+ display: grid;
31
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
32
+ font-size: clamp(1rem, 2.5vw, 2rem);
33
+ -webkit-font-smoothing: antialiased;
34
+ font-style: normal;
35
+ font-weight: 400;
36
+ letter-spacing: -0.0025em;
37
+ line-height: 1.4;
38
+ min-height: 100vh;
39
+ place-items: center;
40
+ text-rendering: optimizeLegibility;
41
+ -webkit-text-size-adjust: 100%;
42
+ }
43
+
44
+ a {
45
+ color: inherit;
46
+ font-weight: 700;
47
+ text-decoration: underline;
48
+ text-underline-offset: 0.0925em;
49
+ }
50
+
51
+ b, strong {
52
+ font-weight: 700;
53
+ }
54
+
55
+ i, em {
56
+ font-style: italic;
57
+ }
58
+
59
+ main {
60
+ display: grid;
61
+ gap: 1em;
62
+ padding: 2em;
63
+ place-items: center;
64
+ text-align: center;
65
+ }
66
+
67
+ main header {
68
+ width: min(100%, 12em);
69
+ }
70
+
71
+ main header svg {
72
+ height: auto;
73
+ max-width: 100%;
74
+ width: 100%;
75
+ }
76
+
77
+ main article {
78
+ width: min(100%, 30em);
79
+ }
80
+
81
+ main article p {
82
+ font-size: 75%;
83
+ }
84
+
85
+ main article br {
86
+
87
+ display: none;
88
+
89
+ @media(min-width: 48em) {
90
+ display: inline;
91
+ }
92
+
93
+ }
94
+
95
+ </style>
96
+
97
+ </head>
98
+
99
+ <body>
100
+
101
+ <!-- This file lives in public/400.html -->
102
+
103
+ <main>
104
+ <header>
105
+ <svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" fill="#f0eff0"/><path d="m123.606 85.4445c3.212 1.0523 5.538 4.2089 5.538 8.0301 0 6.1472-4.209 9.5254-11.298 9.5254h-15.617v-34.0033h14.565c7.089 0 11.353 3.1566 11.353 9.2484 0 3.6551-2.049 6.3134-4.541 7.1994zm-12.904-2.9905h5.095c2.603 0 3.988-.9968 3.988-3.1013 0-2.1044-1.385-3.0459-3.988-3.0459h-5.095zm0 6.6456v6.5902h5.981c2.492 0 3.877-1.3291 3.877-3.2674 0-2.049-1.385-3.3228-3.877-3.3228zm43.786 13.9004h-8.362v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.083-2.769-9.083-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.483 1.3845v-1.606c0-1.606-.942-2.9905-3.046-2.9905-1.606 0-2.548.7199-2.935 1.8275h-8.197c.72-4.8181 4.985-8.6393 11.409-8.6393 7.088 0 11.131 3.7659 11.131 10.2453zm-8.362-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm27.996 6.9779v-1.994c-1.163 1.329-3.599 2.548-6.147 2.548-7.199 0-11.131-5.8151-11.131-13.0145s3.932-13.0143 11.131-13.0143c2.548 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.664-1.3291-2.159-2.326-3.821-2.326-2.99 0-4.763 2.4368-4.763 5.6488s1.773 5.5934 4.763 5.5934c1.717 0 3.157-.9415 3.821-2.326zm35.471-2.049h-3.101v11.2421h-8.806v-34.0033h15.285c7.31 0 12.35 4.1535 12.35 11.5744 0 5.1503-2.603 8.6947-6.757 10.2453l7.975 12.1836h-9.858zm-3.101-15.2849v8.1962h5.538c3.156 0 4.596-1.606 4.596-4.0981s-1.44-4.0981-4.596-4.0981zm36.957 17.8323h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm30.98 27.5234v-10.799c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.9259-11.132-13.0145 0-7.144 3.932-13.0143 11.132-13.0143 2.547 0 4.984 1.2184 6.147 2.5475v-1.9937h8.695v33.726zm0-17.9981v-6.5902c-.665-1.3291-2.105-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.661 0 3.156-.9415 3.821-2.326zm36.789-15.7279v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.996 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm19.084 16.2263h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.963 5.095 11.963 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm13.428 11.0206h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.762-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm27.538-.8861v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.993-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.871 0-9.193-2.769-9.193-9.0819z" fill="#d30001"/></svg>
106
+ </header>
107
+ <article>
108
+ <p><strong>The server cannot process the request due to a client error.</strong> Please check the request and try again. If you’re the application owner check the logs for more information.</p>
109
+ </article>
110
+ </main>
111
+
112
+ </body>
113
+
114
+ </html>