occams 1.0.7.3 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/coveralls.yml +11 -9
- data/.github/workflows/rubyonrails.yml +17 -15
- data/.gitignore +18 -16
- data/CHANGELOG.md +21 -12
- data/CONTRIBUTING.md +3 -4
- data/Gemfile +6 -4
- data/README.md +3 -2
- data/app/models/concerns/occams/cms/with_fragments.rb +1 -1
- data/app/models/occams/cms/fragment.rb +1 -1
- data/app/models/occams/cms/layout.rb +3 -1
- data/app/models/occams/cms/revision.rb +1 -1
- data/app/views/layouts/occams/admin/cms/_left.html.haml +1 -1
- data/bin/rails +3 -3
- data/bin/rake +2 -2
- data/bin/setup +11 -11
- data/config/application.rb +24 -6
- data/config/boot.rb +1 -4
- data/config/database.yml +30 -1
- data/config/environments/development.rb +9 -11
- data/config/environments/production.rb +26 -22
- data/config/environments/test.rb +16 -7
- data/config/initializers/content_security_policy.rb +2 -3
- data/config/initializers/filter_parameter_logging.rb +3 -3
- data/config/initializers/inflections.rb +0 -1
- data/config/initializers/new_framework_defaults_7_1.rb +224 -0
- data/config/initializers/permissions_policy.rb +10 -9
- data/gemfiles/6.1.gemfile +7 -4
- data/gemfiles/7.0.gemfile +6 -4
- data/gemfiles/7.1.gemfile +37 -0
- data/lib/generators/occams/cms/README +10 -2
- data/lib/occams/configuration.rb +1 -1
- data/lib/occams/content/tags/asset.rb +2 -2
- data/lib/occams/content/tags/audio.rb +2 -2
- data/lib/occams/content/tags/breadcrumbs.rb +2 -2
- data/lib/occams/content/tags/checkbox.rb +2 -2
- data/lib/occams/content/tags/children.rb +2 -2
- data/lib/occams/content/tags/date.rb +2 -2
- data/lib/occams/content/tags/datetime.rb +2 -2
- data/lib/occams/content/tags/file.rb +3 -3
- data/lib/occams/content/tags/file_link.rb +3 -3
- data/lib/occams/content/tags/files.rb +2 -2
- data/lib/occams/content/tags/fragment.rb +2 -2
- data/lib/occams/content/tags/helper.rb +2 -2
- data/lib/occams/content/tags/markdown.rb +2 -2
- data/lib/occams/content/tags/mixins/file_content.rb +1 -1
- data/lib/occams/content/tags/number.rb +2 -2
- data/lib/occams/content/tags/page_file_link.rb +3 -3
- data/lib/occams/content/tags/partial.rb +2 -2
- data/lib/occams/content/tags/siblings.rb +2 -2
- data/lib/occams/content/tags/snippet.rb +2 -2
- data/lib/occams/content/tags/template.rb +2 -2
- data/lib/occams/content/tags/text.rb +2 -2
- data/lib/occams/content/tags/textarea.rb +3 -2
- data/lib/occams/content/tags/wysiwyg.rb +2 -2
- data/lib/occams/content/tags.rb +28 -0
- data/lib/occams/content.rb +1 -26
- data/lib/occams/extensions/acts_as_tree.rb +3 -3
- data/lib/occams/extensions/has_revisions.rb +3 -3
- data/lib/occams/extensions.rb +8 -0
- data/lib/occams/routing.rb +74 -5
- data/lib/occams/version.rb +1 -1
- data/lib/occams.rb +3 -3
- data/occams.gemspec +13 -13
- metadata +8 -4
data/config/environments/test.rb
CHANGED
@@ -10,12 +10,13 @@ require 'active_support/core_ext/integer/time'
|
|
10
10
|
defined?(Occams::Application) && Occams::Application.configure do
|
11
11
|
# Settings specified here will take precedence over those in config/application.rb.
|
12
12
|
|
13
|
-
#
|
14
|
-
config.
|
13
|
+
# While tests run files are not watched, reloading is not necessary.
|
14
|
+
config.enable_reloading = false
|
15
15
|
|
16
|
-
# Eager loading loads your
|
17
|
-
# this
|
18
|
-
#
|
16
|
+
# Eager loading loads your entire application. When running a single test locally,
|
17
|
+
# this is usually not necessary, and can slow down your test suite. However, it's
|
18
|
+
# recommended that you enable it in continuous integration systems to ensure eager
|
19
|
+
# loading is working properly before deploying your code.
|
19
20
|
config.eager_load = ENV['CI'].present?
|
20
21
|
|
21
22
|
# Configure public file server for tests with Cache-Control for performance.
|
@@ -30,7 +31,11 @@ defined?(Occams::Application) && Occams::Application.configure do
|
|
30
31
|
config.cache_store = :null_store
|
31
32
|
|
32
33
|
# Raise exceptions instead of rendering exception templates.
|
33
|
-
config.action_dispatch.show_exceptions =
|
34
|
+
config.action_dispatch.show_exceptions = if Gem::Version.new(Rails.version) < Gem::Version.new('7.1.0')
|
35
|
+
false
|
36
|
+
else
|
37
|
+
:none
|
38
|
+
end
|
34
39
|
|
35
40
|
# Disable request forgery protection in test environment.
|
36
41
|
config.action_controller.allow_forgery_protection = false
|
@@ -48,7 +53,6 @@ defined?(Occams::Application) && Occams::Application.configure do
|
|
48
53
|
# Print deprecation notices to the stderr.
|
49
54
|
config.active_support.deprecation = :stderr
|
50
55
|
|
51
|
-
config.active_job.queue_adapter = :inline
|
52
56
|
# Raise exceptions for disallowed deprecations.
|
53
57
|
config.active_support.disallowed_deprecation = :raise
|
54
58
|
|
@@ -60,4 +64,9 @@ defined?(Occams::Application) && Occams::Application.configure do
|
|
60
64
|
|
61
65
|
# Annotate rendered view with file names.
|
62
66
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
67
|
+
|
68
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7.1.0')
|
69
|
+
# Raise error when a before_action's only/except options reference missing actions
|
70
|
+
config.action_controller.raise_on_missing_callback_actions = true
|
71
|
+
end
|
63
72
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
2
|
# Be sure to restart your server when you modify this file.
|
4
3
|
|
5
4
|
# Define an application-wide content security policy.
|
@@ -18,9 +17,9 @@
|
|
18
17
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
19
18
|
# end
|
20
19
|
#
|
21
|
-
# # Generate session nonces for permitted importmap and inline
|
20
|
+
# # Generate session nonces for permitted importmap, inline scripts, and inline styles.
|
22
21
|
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
23
|
-
# config.content_security_policy_nonce_directives = %w(script-src)
|
22
|
+
# config.content_security_policy_nonce_directives = %w(script-src style-src)
|
24
23
|
#
|
25
24
|
# # Report violations without enforcing the policy.
|
26
25
|
# # config.content_security_policy_report_only = true
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
# Be sure to restart your server when you modify this file.
|
4
4
|
|
5
|
-
# Configure parameters to be filtered from the log file.
|
6
|
-
#
|
7
|
-
# notations and behaviors.
|
5
|
+
# Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
|
6
|
+
# Use this to limit dissemination of sensitive information.
|
7
|
+
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
8
8
|
Rails.application.config.filter_parameters += %i[
|
9
9
|
passw secret token _key crypt salt certificate otp ssn
|
10
10
|
]
|
@@ -0,0 +1,224 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Be sure to restart your server when you modify this file.
|
3
|
+
#
|
4
|
+
# This file eases your Rails 7.1 framework defaults upgrade.
|
5
|
+
#
|
6
|
+
# Uncomment each configuration one by one to switch to the new default.
|
7
|
+
# Once your application is ready to run with all new defaults, you can remove
|
8
|
+
# this file and set the `config.load_defaults` to `7.1`.
|
9
|
+
#
|
10
|
+
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
11
|
+
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
12
|
+
|
13
|
+
# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able
|
14
|
+
# to manually require files that are managed by the autoloader, which you shouldn't do anyway.
|
15
|
+
# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size
|
16
|
+
# of the bootsnap cache if you use it.
|
17
|
+
# Rails.application.config.add_autoload_paths_to_load_path = false
|
18
|
+
|
19
|
+
# Remove the default X-Download-Options headers since it is used only by Internet Explorer.
|
20
|
+
# If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`.
|
21
|
+
# Rails.application.config.action_dispatch.default_headers = {
|
22
|
+
# "X-Frame-Options" => "SAMEORIGIN",
|
23
|
+
# "X-XSS-Protection" => "0",
|
24
|
+
# "X-Content-Type-Options" => "nosniff",
|
25
|
+
# "X-Permitted-Cross-Domain-Policies" => "none",
|
26
|
+
# "Referrer-Policy" => "strict-origin-when-cross-origin"
|
27
|
+
# }
|
28
|
+
|
29
|
+
# Do not treat an `ActionController::Parameters` instance
|
30
|
+
# as equal to an equivalent `Hash` by default.
|
31
|
+
# Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
|
32
|
+
|
33
|
+
# Active Record Encryption now uses SHA-256 as its hash digest algorithm. Important: If you have
|
34
|
+
# data encrypted with previous Rails versions, there are two scenarios to consider:
|
35
|
+
#
|
36
|
+
# 1. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA1 (the default
|
37
|
+
# before Rails 7.0), you need to configure SHA-1 for Active Record Encryption too:
|
38
|
+
# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA1
|
39
|
+
# 2. If you have +config.active_support.key_generator_hash_digest_class+ configured as SHA256 (the new default
|
40
|
+
# in 7.0), then you need to configure SHA-256 for Active Record Encryption:
|
41
|
+
# Rails.application.config.active_record.encryption.hash_digest_class = OpenSSL::Digest::SHA256
|
42
|
+
#
|
43
|
+
# If you don't currently have data encrypted with Active Record encryption, you can disable this setting to
|
44
|
+
# configure the default behavior starting 7.1+:
|
45
|
+
# Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false
|
46
|
+
|
47
|
+
# No longer run after_commit callbacks on the first of multiple Active Record
|
48
|
+
# instances to save changes to the same database row within a transaction.
|
49
|
+
# Instead, run these callbacks on the instance most likely to have internal
|
50
|
+
# state which matches what was committed to the database, typically the last
|
51
|
+
# instance to save.
|
52
|
+
# Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
|
53
|
+
|
54
|
+
# Configures SQLite with a strict strings mode, which disables double-quoted string literals.
|
55
|
+
#
|
56
|
+
# SQLite has some quirks around double-quoted string literals.
|
57
|
+
# It first tries to consider double-quoted strings as identifier names, but if they don't exist
|
58
|
+
# it then considers them as string literals. Because of this, typos can silently go unnoticed.
|
59
|
+
# For example, it is possible to create an index for a non existing column.
|
60
|
+
# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details.
|
61
|
+
# Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true
|
62
|
+
|
63
|
+
# Disable deprecated singular associations names
|
64
|
+
# Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
|
65
|
+
|
66
|
+
# Enable the Active Job `BigDecimal` argument serializer, which guarantees
|
67
|
+
# roundtripping. Without this serializer, some queue adapters may serialize
|
68
|
+
# `BigDecimal` arguments as simple (non-roundtrippable) strings.
|
69
|
+
#
|
70
|
+
# When deploying an application with multiple replicas, old (pre-Rails 7.1)
|
71
|
+
# replicas will not be able to deserialize `BigDecimal` arguments from this
|
72
|
+
# serializer. Therefore, this setting should only be enabled after all replicas
|
73
|
+
# have been successfully upgraded to Rails 7.1.
|
74
|
+
# Rails.application.config.active_job.use_big_decimal_serializer = true
|
75
|
+
|
76
|
+
# Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or
|
77
|
+
# `write` are given an invalid `expires_at` or `expires_in` time.
|
78
|
+
# Options are `true`, and `false`. If `false`, the exception will be reported
|
79
|
+
# as `handled` and logged instead.
|
80
|
+
# Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true
|
81
|
+
|
82
|
+
# Specify whether Query Logs will format tags using the SQLCommenter format
|
83
|
+
# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format.
|
84
|
+
# Options are `:legacy` and `:sqlcommenter`.
|
85
|
+
# Rails.application.config.active_record.query_log_tags_format = :sqlcommenter
|
86
|
+
|
87
|
+
# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier`
|
88
|
+
# instances.
|
89
|
+
#
|
90
|
+
# The legacy default is `:marshal`, which is a potential vector for
|
91
|
+
# deserialization attacks in cases where a message signing secret has been
|
92
|
+
# leaked.
|
93
|
+
#
|
94
|
+
# In Rails 7.1, the new default is `:json_allow_marshal` which serializes and
|
95
|
+
# deserializes with `ActiveSupport::JSON`, but can fall back to deserializing
|
96
|
+
# with `Marshal` so that legacy messages can still be read.
|
97
|
+
#
|
98
|
+
# In Rails 7.2, the default will become `:json` which serializes and
|
99
|
+
# deserializes with `ActiveSupport::JSON` only.
|
100
|
+
#
|
101
|
+
# Alternatively, you can choose `:message_pack` or `:message_pack_allow_marshal`,
|
102
|
+
# which serialize with `ActiveSupport::MessagePack`. `ActiveSupport::MessagePack`
|
103
|
+
# can roundtrip some Ruby types that are not supported by JSON, and may provide
|
104
|
+
# improved performance, but it requires the `msgpack` gem.
|
105
|
+
#
|
106
|
+
# For more information, see
|
107
|
+
# https://guides.rubyonrails.org/v7.1/configuring.html#config-active-support-message-serializer
|
108
|
+
#
|
109
|
+
# If you are performing a rolling deploy of a Rails 7.1 upgrade, wherein servers
|
110
|
+
# that have not yet been upgraded must be able to read messages from upgraded
|
111
|
+
# servers, first deploy without changing the serializer, then set the serializer
|
112
|
+
# in a subsequent deploy.
|
113
|
+
# Rails.application.config.active_support.message_serializer = :json_allow_marshal
|
114
|
+
|
115
|
+
# Enable a performance optimization that serializes message data and metadata
|
116
|
+
# together. This changes the message format, so messages serialized this way
|
117
|
+
# cannot be read by older versions of Rails. However, messages that use the old
|
118
|
+
# format can still be read, regardless of whether this optimization is enabled.
|
119
|
+
#
|
120
|
+
# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
|
121
|
+
# not yet been upgraded must be able to read messages from upgraded servers,
|
122
|
+
# leave this optimization off on the first deploy, then enable it on a
|
123
|
+
# subsequent deploy.
|
124
|
+
# Rails.application.config.active_support.use_message_serializer_for_metadata = true
|
125
|
+
|
126
|
+
# Set the maximum size for Rails log files.
|
127
|
+
#
|
128
|
+
# `config.load_defaults 7.1` does not set this value for environments other than
|
129
|
+
# development and test.
|
130
|
+
#
|
131
|
+
# if Rails.env.local?
|
132
|
+
# Rails.application.config.log_file_size = 100 * 1024 * 1024
|
133
|
+
# end
|
134
|
+
|
135
|
+
# Enable raising on assignment to attr_readonly attributes. The previous
|
136
|
+
# behavior would allow assignment but silently not persist changes to the
|
137
|
+
# database.
|
138
|
+
# Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true
|
139
|
+
|
140
|
+
# Enable validating only parent-related columns for presence when the parent is mandatory.
|
141
|
+
# The previous behavior was to validate the presence of the parent record, which performed an extra query
|
142
|
+
# to get the parent every time the child record was updated, even when parent has not changed.
|
143
|
+
# Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false
|
144
|
+
|
145
|
+
# Enable precompilation of `config.filter_parameters`. Precompilation can
|
146
|
+
# improve filtering performance, depending on the quantity and types of filters.
|
147
|
+
# Rails.application.config.precompile_filter_parameters = true
|
148
|
+
|
149
|
+
# Enable before_committed! callbacks on all enrolled records in a transaction.
|
150
|
+
# The previous behavior was to only run the callbacks on the first copy of a record
|
151
|
+
# if there were multiple copies of the same record enrolled in the transaction.
|
152
|
+
# Rails.application.config.active_record.before_committed_on_all_records = true
|
153
|
+
|
154
|
+
# Disable automatic column serialization into YAML.
|
155
|
+
# To keep the historic behavior, you can set it to `YAML`, however it is
|
156
|
+
# recommended to explicitly define the serialization method for each column
|
157
|
+
# rather than to rely on a global default.
|
158
|
+
# Rails.application.config.active_record.default_column_serializer = nil
|
159
|
+
|
160
|
+
# Enable a performance optimization that serializes Active Record models
|
161
|
+
# in a faster and more compact way.
|
162
|
+
#
|
163
|
+
# To perform a rolling deploy of a Rails 7.1 upgrade, wherein servers that have
|
164
|
+
# not yet been upgraded must be able to read caches from upgraded servers,
|
165
|
+
# leave this optimization off on the first deploy, then enable it on a
|
166
|
+
# subsequent deploy.
|
167
|
+
# Rails.application.config.active_record.marshalling_format_version = 7.1
|
168
|
+
|
169
|
+
# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model.
|
170
|
+
# This matches the behaviour of all other callbacks.
|
171
|
+
# In previous versions of Rails, they ran in the inverse order.
|
172
|
+
# Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
|
173
|
+
|
174
|
+
# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
|
175
|
+
#
|
176
|
+
# Rails.application.config.active_record.commit_transaction_on_non_local_return = true
|
177
|
+
|
178
|
+
# Controls when to generate a value for <tt>has_secure_token</tt> declarations.
|
179
|
+
#
|
180
|
+
# Rails.application.config.active_record.generate_secure_token_on = :initialize
|
181
|
+
|
182
|
+
# ** Please read carefully, this must be configured in config/application.rb **
|
183
|
+
# Change the format of the cache entry.
|
184
|
+
# Changing this default means that all new cache entries added to the cache
|
185
|
+
# will have a different format that is not supported by Rails 7.0
|
186
|
+
# applications.
|
187
|
+
# Only change this value after your application is fully deployed to Rails 7.1
|
188
|
+
# and you have no plans to rollback.
|
189
|
+
# When you're ready to change format, add this to `config/application.rb` (NOT
|
190
|
+
# this file):
|
191
|
+
# config.active_support.cache_format_version = 7.1
|
192
|
+
|
193
|
+
# Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your
|
194
|
+
# platform.
|
195
|
+
#
|
196
|
+
# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action View to use HTML5-compliant
|
197
|
+
# sanitizers if they are supported, else fall back to HTML4 sanitizers.
|
198
|
+
#
|
199
|
+
# In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor.
|
200
|
+
#
|
201
|
+
# Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
202
|
+
|
203
|
+
# Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
|
204
|
+
# platform.
|
205
|
+
#
|
206
|
+
# `Rails::HTML::Sanitizer.best_supported_vendor` will cause Action Text to use HTML5-compliant
|
207
|
+
# sanitizers if they are supported, else fall back to HTML4 sanitizers.
|
208
|
+
#
|
209
|
+
# In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor.
|
210
|
+
#
|
211
|
+
# Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
|
212
|
+
|
213
|
+
# Configure the log level used by the DebugExceptions middleware when logging
|
214
|
+
# uncaught exceptions during requests
|
215
|
+
# Rails.application.config.action_dispatch.debug_exception_log_level = :error
|
216
|
+
|
217
|
+
# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
|
218
|
+
# parsers.
|
219
|
+
#
|
220
|
+
# Nokogiri::HTML5 isn't supported on JRuby, so JRuby applications must set this to :html4.
|
221
|
+
#
|
222
|
+
# In previous versions of Rails, these test helpers always used an HTML4 parser.
|
223
|
+
#
|
224
|
+
# Rails.application.config.dom_testing_default_html_version = :html5
|
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
# Be sure to restart your server when you modify this file.
|
2
3
|
|
3
4
|
# Define an application-wide HTTP permissions policy. For further
|
4
|
-
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
5
|
-
|
6
|
-
# Rails.application.config.permissions_policy do |
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# information see: https://developers.google.com/web/updates/2018/06/feature-policy
|
6
|
+
|
7
|
+
# Rails.application.config.permissions_policy do |policy|
|
8
|
+
# policy.camera :none
|
9
|
+
# policy.gyroscope :none
|
10
|
+
# policy.microphone :none
|
11
|
+
# policy.usb :none
|
12
|
+
# policy.fullscreen :self
|
13
|
+
# policy.payment :self, "https://secure.example.com"
|
13
14
|
# end
|
data/gemfiles/6.1.gemfile
CHANGED
@@ -10,11 +10,8 @@ gem 'rails', '~> 6.1.0'
|
|
10
10
|
group :development, :test do
|
11
11
|
gem 'autoprefixer-rails', '~> 8.1.0'
|
12
12
|
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
-
gem 'capybara', '~> 3.39.0'
|
14
13
|
gem 'image_processing', '>= 1.2'
|
15
|
-
gem '
|
16
|
-
gem 'selenium-webdriver', '~> 4.9.0'
|
17
|
-
gem 'sqlite3', '~> 1.4.2'
|
14
|
+
gem 'sqlite3', '~> 1.6.7'
|
18
15
|
end
|
19
16
|
|
20
17
|
group :development do
|
@@ -25,11 +22,17 @@ end
|
|
25
22
|
group :test do
|
26
23
|
gem 'brakeman', '~> 5.4.1'
|
27
24
|
gem 'bundler-audit', '~> 0.9.1'
|
25
|
+
gem 'capybara', '~> 3.39.0'
|
28
26
|
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
27
|
+
gem 'cuprite', '~> 0.14.3'
|
29
28
|
gem 'diffy', '~> 3.4.2'
|
30
29
|
gem 'equivalent-xml', '~> 0.6.0'
|
30
|
+
gem 'minitest', '~> 5.20.0'
|
31
31
|
gem 'minitest-reporters', '~> 1.6.1'
|
32
32
|
gem 'mocha', '~> 2.1.0', require: false
|
33
|
+
gem 'puma', '~> 6.4.0'
|
33
34
|
gem 'rails-controller-testing', '~> 1.0.5'
|
34
35
|
gem 'rubocop', '~> 1.56.0', require: false
|
36
|
+
gem 'selenium-webdriver', '~> 4.9.0'
|
37
|
+
gem 'simplecov', '~> 0.22.0', require: false
|
35
38
|
end
|
data/gemfiles/7.0.gemfile
CHANGED
@@ -10,11 +10,8 @@ gem 'rails', '~> 7.0.0'
|
|
10
10
|
group :development, :test do
|
11
11
|
gem 'autoprefixer-rails', '~> 8.1.0'
|
12
12
|
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
-
gem 'capybara', '~> 3.39.0'
|
14
13
|
gem 'image_processing', '>= 1.2'
|
15
|
-
gem '
|
16
|
-
gem 'selenium-webdriver', '~> 4.9.0'
|
17
|
-
gem 'sqlite3', '~> 1.4.2'
|
14
|
+
gem 'sqlite3', '~> 1.6.7'
|
18
15
|
end
|
19
16
|
|
20
17
|
group :development do
|
@@ -25,11 +22,16 @@ end
|
|
25
22
|
group :test do
|
26
23
|
gem 'brakeman', '~> 5.4.1'
|
27
24
|
gem 'bundler-audit', '~> 0.9.1'
|
25
|
+
gem 'capybara', '~> 3.39.0'
|
28
26
|
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
27
|
+
gem 'cuprite', '~> 0.14.3'
|
29
28
|
gem 'diffy', '~> 3.4.2'
|
30
29
|
gem 'equivalent-xml', '~> 0.6.0'
|
30
|
+
gem 'minitest', '~> 5.20.0'
|
31
31
|
gem 'minitest-reporters', '~> 1.6.1'
|
32
32
|
gem 'mocha', '~> 2.1.0', require: false
|
33
|
+
gem 'puma', '~> 6.4.0'
|
33
34
|
gem 'rails-controller-testing', '~> 1.0.5'
|
34
35
|
gem 'rubocop', '~> 1.56.0', require: false
|
36
|
+
gem 'simplecov', '~> 0.22.0', require: false
|
35
37
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
gemspec path: '../'
|
7
|
+
|
8
|
+
gem 'rails', '~> 7.1.0', '>= 7.1.1'
|
9
|
+
|
10
|
+
group :development, :test do
|
11
|
+
gem 'autoprefixer-rails', '~> 8.1.0'
|
12
|
+
gem 'byebug', '~> 10.0.0', platforms: %i[mri mingw x64_mingw]
|
13
|
+
gem 'image_processing', '>= 1.2'
|
14
|
+
gem 'sqlite3', '~> 1.6.7'
|
15
|
+
end
|
16
|
+
|
17
|
+
group :development do
|
18
|
+
gem 'listen', '~> 3.8.0'
|
19
|
+
gem 'web-console', '~> 4.2'
|
20
|
+
end
|
21
|
+
|
22
|
+
group :test do
|
23
|
+
gem 'brakeman', '~> 5.4.1'
|
24
|
+
gem 'bundler-audit', '~> 0.9.1'
|
25
|
+
gem 'capybara', '~> 3.39.0'
|
26
|
+
gem 'coveralls_reborn', '~> 0.28.0', require: false
|
27
|
+
gem 'cuprite', '~> 0.14.3'
|
28
|
+
gem 'diffy', '~> 3.4.2'
|
29
|
+
gem 'equivalent-xml', '~> 0.6.0'
|
30
|
+
gem 'minitest', '~> 5.20.0'
|
31
|
+
gem 'minitest-reporters', '~> 1.6.1'
|
32
|
+
gem 'mocha', '~> 2.1.0', require: false
|
33
|
+
gem 'puma', '~> 6.4.0'
|
34
|
+
gem 'rails-controller-testing', '~> 1.0.5'
|
35
|
+
gem 'rubocop', '~> 1.56.0', require: false
|
36
|
+
gem 'simplecov', '~> 0.22.0', require: false
|
37
|
+
end
|
@@ -11,7 +11,15 @@ You are almost done. Don't forget to:
|
|
11
11
|
[Optional] - If you want to store files in your CMS with ActiveStorage: `rails active_storage:install`
|
12
12
|
[Mandatory] - Create the tables in your database: `rails db:migrate`
|
13
13
|
|
14
|
-
Then
|
14
|
+
Then go to http://your-rails-app/admin to start adding content.
|
15
15
|
|
16
|
-
Default username and password are: user/pass
|
16
|
+
Default username and password are: user / pass
|
17
17
|
Change these defaults in config/initializers/occams.rb
|
18
|
+
|
19
|
+
----------------------------
|
20
|
+
IF YOU ARE ON RAILS 6.x
|
21
|
+
----------------------------
|
22
|
+
and encounter errors referencing webpacker:
|
23
|
+
ensure that you have nvm installed, and then run
|
24
|
+
- nvm install 13.7 && nvm use 13.7
|
25
|
+
- rails webpacker:install
|
data/lib/occams/configuration.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
# `type` - css | js - what we're outputting here
|
8
8
|
# `as` - url (default) | tag - output url or wrap it in the appropriate tag
|
9
9
|
#
|
10
|
-
class Occams::Content::
|
10
|
+
class Occams::Content::Tags::Asset < Occams::Content::Tag
|
11
11
|
attr_reader :identifier, :type, :as
|
12
12
|
|
13
13
|
def initialize(context:, params: [], source: nil)
|
@@ -53,5 +53,5 @@ class Occams::Content::Tag::Asset < Occams::Content::Tag
|
|
53
53
|
end
|
54
54
|
|
55
55
|
Occams::Content::Renderer.register_tag(
|
56
|
-
:asset, Occams::Content::
|
56
|
+
:asset, Occams::Content::Tags::Asset
|
57
57
|
)
|
@@ -14,7 +14,7 @@
|
|
14
14
|
# }
|
15
15
|
# and/or pass in style overrides with the 'style' parameter, as above
|
16
16
|
|
17
|
-
class Occams::Content::
|
17
|
+
class Occams::Content::Tags::Audio < Occams::Content::Tag
|
18
18
|
attr_reader :path, :style, :locals
|
19
19
|
|
20
20
|
def initialize(context:, params: [], source: nil)
|
@@ -35,5 +35,5 @@ class Occams::Content::Tag::Audio < Occams::Content::Tag
|
|
35
35
|
end
|
36
36
|
|
37
37
|
Occams::Content::Renderer.register_tag(
|
38
|
-
:audio, Occams::Content::
|
38
|
+
:audio, Occams::Content::Tags::Audio
|
39
39
|
)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# }
|
16
16
|
# and/or pass in style overrides with the 'style' parameter, as above
|
17
17
|
|
18
|
-
class Occams::Content::
|
18
|
+
class Occams::Content::Tags::Breadcrumbs < Occams::Content::Tag
|
19
19
|
attr_reader :links, :style, :locals
|
20
20
|
|
21
21
|
def initialize(context:, params: [], source: nil)
|
@@ -39,5 +39,5 @@ class Occams::Content::Tag::Breadcrumbs < Occams::Content::Tag
|
|
39
39
|
end
|
40
40
|
|
41
41
|
Occams::Content::Renderer.register_tag(
|
42
|
-
:breadcrumbs, Occams::Content::
|
42
|
+
:breadcrumbs, Occams::Content::Tags::Breadcrumbs
|
43
43
|
)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Tag for boolean content that is going to be rendered using checkbox
|
4
4
|
# {{ cms:checkbox identifier }}
|
5
5
|
#
|
6
|
-
class Occams::Content::
|
6
|
+
class Occams::Content::Tags::Checkbox < Occams::Content::Tags::Fragment
|
7
7
|
def content
|
8
8
|
fragment.boolean
|
9
9
|
end
|
@@ -23,5 +23,5 @@ class Occams::Content::Tag::Checkbox < Occams::Content::Tag::Fragment
|
|
23
23
|
end
|
24
24
|
|
25
25
|
Occams::Content::Renderer.register_tag(
|
26
|
-
:checkbox, Occams::Content::
|
26
|
+
:checkbox, Occams::Content::Tags::Checkbox
|
27
27
|
)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
# To exclude children, list their slugs with the 'exclude' parameter
|
16
16
|
# as comma-delimited string, e.g. as above - exclude: "404-page, search-page"
|
17
17
|
|
18
|
-
class Occams::Content::
|
18
|
+
class Occams::Content::Tags::Children < Occams::Content::Tag
|
19
19
|
attr_reader :style, :page_children, :locals
|
20
20
|
attr_accessor :list
|
21
21
|
|
@@ -48,5 +48,5 @@ class Occams::Content::Tag::Children < Occams::Content::Tag
|
|
48
48
|
end
|
49
49
|
|
50
50
|
Occams::Content::Renderer.register_tag(
|
51
|
-
:children, Occams::Content::
|
51
|
+
:children, Occams::Content::Tags::Children
|
52
52
|
)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# Tag for text content that is going to be rendered using text input with date widget
|
4
4
|
# {{ cms:date identifier }}
|
5
5
|
#
|
6
|
-
class Occams::Content::
|
6
|
+
class Occams::Content::Tags::Date < Occams::Content::Tags::Datetime
|
7
7
|
def form_field(object_name, view, index)
|
8
8
|
name = "#{object_name}[fragments_attributes][#{index}][datetime]"
|
9
9
|
options = { id: form_field_id, class: 'form-control', data: { 'cms-date' => true } }
|
@@ -15,5 +15,5 @@ class Occams::Content::Tag::Date < Occams::Content::Tag::Datetime
|
|
15
15
|
end
|
16
16
|
|
17
17
|
Occams::Content::Renderer.register_tag(
|
18
|
-
:date, Occams::Content::
|
18
|
+
:date, Occams::Content::Tags::Date
|
19
19
|
)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
#
|
6
6
|
# `strftime` - Format datetime string during rendering
|
7
7
|
#
|
8
|
-
class Occams::Content::
|
8
|
+
class Occams::Content::Tags::Datetime < Occams::Content::Tags::Fragment
|
9
9
|
attr_reader :strftime
|
10
10
|
|
11
11
|
def initialize(context:, params: [], source: nil)
|
@@ -38,5 +38,5 @@ class Occams::Content::Tag::Datetime < Occams::Content::Tag::Fragment
|
|
38
38
|
end
|
39
39
|
|
40
40
|
Occams::Content::Renderer.register_tag(
|
41
|
-
:datetime, Occams::Content::
|
41
|
+
:datetime, Occams::Content::Tags::Datetime
|
42
42
|
)
|
@@ -13,8 +13,8 @@ require_relative 'mixins/file_content'
|
|
13
13
|
# `crop` - imagemagic option. For example: "100x50+0+0"
|
14
14
|
# `class` - any html classes that you want on the result link or image tag. For example "class1 class2"
|
15
15
|
#
|
16
|
-
class Occams::Content::
|
17
|
-
include Occams::Content::
|
16
|
+
class Occams::Content::Tags::File < Occams::Content::Tags::Fragment
|
17
|
+
include Occams::Content::Tags::Mixins::FileContent
|
18
18
|
|
19
19
|
# @type ["url", "link", "image"]
|
20
20
|
attr_reader :as
|
@@ -66,5 +66,5 @@ protected
|
|
66
66
|
end
|
67
67
|
|
68
68
|
Occams::Content::Renderer.register_tag(
|
69
|
-
:file, Occams::Content::
|
69
|
+
:file, Occams::Content::Tags::File
|
70
70
|
)
|
@@ -13,8 +13,8 @@ require_relative 'mixins/file_content'
|
|
13
13
|
# `crop` - imagemagic option. For example: "100x50+0+0"
|
14
14
|
# `class` - any html classes that you want on the result link or image tag. For example "class1 class2"
|
15
15
|
#
|
16
|
-
class Occams::Content::
|
17
|
-
include Occams::Content::
|
16
|
+
class Occams::Content::Tags::FileLink < Occams::Content::Tag
|
17
|
+
include Occams::Content::Tags::Mixins::FileContent
|
18
18
|
|
19
19
|
# @return [String] A {Occams::Cms::Site#files} ID.
|
20
20
|
attr_reader :identifier
|
@@ -58,5 +58,5 @@ class Occams::Content::Tag::FileLink < Occams::Content::Tag
|
|
58
58
|
end
|
59
59
|
|
60
60
|
Occams::Content::Renderer.register_tag(
|
61
|
-
:file_link, Occams::Content::
|
61
|
+
:file_link, Occams::Content::Tags::FileLink
|
62
62
|
)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Example tag:
|
6
6
|
# {{ cms:files identifier }}
|
7
7
|
#
|
8
|
-
class Occams::Content::
|
8
|
+
class Occams::Content::Tags::Files < Occams::Content::Tags::File
|
9
9
|
def content
|
10
10
|
return '' if fragment.attachments.blank?
|
11
11
|
|
@@ -37,5 +37,5 @@ class Occams::Content::Tag::Files < Occams::Content::Tag::File
|
|
37
37
|
end
|
38
38
|
|
39
39
|
Occams::Content::Renderer.register_tag(
|
40
|
-
:files, Occams::Content::
|
40
|
+
:files, Occams::Content::Tags::Files
|
41
41
|
)
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# `namespace`:
|
9
9
|
# Just a string that allows grouping of form elements in the admin area
|
10
10
|
#
|
11
|
-
class Occams::Content::
|
11
|
+
class Occams::Content::Tags::Fragment < Occams::Content::Tag
|
12
12
|
attr_accessor :renderable
|
13
13
|
attr_reader :identifier, :namespace
|
14
14
|
|
@@ -48,7 +48,7 @@ class Occams::Content::Tag::Fragment < Occams::Content::Tag
|
|
48
48
|
|
49
49
|
# Tag renders its own form inputs via `form_field(template, index)`
|
50
50
|
# For example:
|
51
|
-
# class MyTag < Occams::Content::
|
51
|
+
# class MyTag < Occams::Content::Tags::Fragment
|
52
52
|
# def form_field(view, index, &block)
|
53
53
|
# # omit yield if you don't want default wrapper
|
54
54
|
# yield view.text_area "input_name", "value"
|