trusty-cms 7.0.32 → 7.0.34
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.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/Gemfile.lock +10 -8
- data/app/models/page.rb +16 -2
- data/app/models/standard_tags.rb +1 -1
- data/app/models/status.rb +1 -0
- data/config/locales/en_available_tags.yml +1 -1
- data/lib/generators/language_extension/templates/available_tags.yml +1 -1
- data/lib/trusty_cms/version.rb +1 -1
- data/spec/spec_helper.rb +20 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6b86ba1e1cf29f8dd56b21dab2388ae52deb53a270a954d4edf58e0f00e0362
|
4
|
+
data.tar.gz: 9c758e59cf39a4846f2f7d9c86efef12ff78c8fa234b51645fd27e02276c5c98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac45e34396dd1c0f67b8f9a8dcb4f90453216d33b74f3548c0c71e21106a1394c40f2743cf69ccb63cbb1cc2245fcb92512c3a23496ac5767234f14c9d6a5b7
|
7
|
+
data.tar.gz: ae24233d4459d143037ee58c28629b5ca9040b127f0b1e05a58d58d9dead7a4e6ebe1b3d3726b3ca51bf4b689d0b87f8d17c9462c1bf318ee1de5a3f528ba9b3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trusty-cms (7.0.
|
4
|
+
trusty-cms (7.0.34)
|
5
5
|
RedCloth (= 4.3.3)
|
6
6
|
activestorage-validator
|
7
7
|
acts_as_list (>= 0.9.5, < 1.3.0)
|
@@ -168,7 +168,7 @@ GEM
|
|
168
168
|
devise (~> 4.0)
|
169
169
|
railties (>= 7.0, < 8.1)
|
170
170
|
rotp (~> 6.0)
|
171
|
-
diff-lcs (1.
|
171
|
+
diff-lcs (1.6.2)
|
172
172
|
diffy (3.4.4)
|
173
173
|
docile (1.4.1)
|
174
174
|
drb (2.2.1)
|
@@ -369,15 +369,15 @@ GEM
|
|
369
369
|
chunky_png (~> 1.0)
|
370
370
|
rqrcode_core (~> 2.0)
|
371
371
|
rqrcode_core (2.0.0)
|
372
|
-
rspec-core (3.13.
|
372
|
+
rspec-core (3.13.4)
|
373
373
|
rspec-support (~> 3.13.0)
|
374
|
-
rspec-expectations (3.13.
|
374
|
+
rspec-expectations (3.13.5)
|
375
375
|
diff-lcs (>= 1.2.0, < 2.0)
|
376
376
|
rspec-support (~> 3.13.0)
|
377
|
-
rspec-mocks (3.13.
|
377
|
+
rspec-mocks (3.13.5)
|
378
378
|
diff-lcs (>= 1.2.0, < 2.0)
|
379
379
|
rspec-support (~> 3.13.0)
|
380
|
-
rspec-rails (7.1.
|
380
|
+
rspec-rails (7.1.1)
|
381
381
|
actionpack (>= 7.0)
|
382
382
|
activesupport (>= 7.0)
|
383
383
|
railties (>= 7.0)
|
@@ -385,7 +385,7 @@ GEM
|
|
385
385
|
rspec-expectations (~> 3.13)
|
386
386
|
rspec-mocks (~> 3.13)
|
387
387
|
rspec-support (~> 3.13)
|
388
|
-
rspec-support (3.13.
|
388
|
+
rspec-support (3.13.4)
|
389
389
|
ruby-vips (2.2.2)
|
390
390
|
ffi (~> 1.12)
|
391
391
|
logger
|
@@ -404,6 +404,7 @@ GEM
|
|
404
404
|
simplecov-html (~> 0.11)
|
405
405
|
simplecov_json_formatter (~> 0.1)
|
406
406
|
simplecov-html (0.13.1)
|
407
|
+
simplecov-lcov (0.8.0)
|
407
408
|
simplecov_json_formatter (0.1.4)
|
408
409
|
sprockets (4.2.1)
|
409
410
|
concurrent-ruby (~> 1.0)
|
@@ -465,8 +466,9 @@ DEPENDENCIES
|
|
465
466
|
psych (= 5.2.2)
|
466
467
|
rails-observers
|
467
468
|
ransack
|
468
|
-
rspec-rails
|
469
|
+
rspec-rails (~> 7.1.1)
|
469
470
|
simplecov
|
471
|
+
simplecov-lcov
|
470
472
|
trusty-cms!
|
471
473
|
trustygems (~> 0.2.0)
|
472
474
|
|
data/app/models/page.rb
CHANGED
@@ -8,7 +8,10 @@ class Page < ActiveRecord::Base
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# Callbacks
|
11
|
-
before_save :update_virtual,
|
11
|
+
before_save :update_virtual,
|
12
|
+
:update_published_datetime,
|
13
|
+
:set_allowed_children_cache,
|
14
|
+
:handle_hidden_status
|
12
15
|
|
13
16
|
# Associations
|
14
17
|
acts_as_tree order: 'position ASC'
|
@@ -107,6 +110,10 @@ class Page < ActiveRecord::Base
|
|
107
110
|
status == Status[:published]
|
108
111
|
end
|
109
112
|
|
113
|
+
def hidden?
|
114
|
+
status == Status[:hidden]
|
115
|
+
end
|
116
|
+
|
110
117
|
def scheduled?
|
111
118
|
status == Status[:scheduled]
|
112
119
|
end
|
@@ -205,7 +212,7 @@ class Page < ActiveRecord::Base
|
|
205
212
|
|
206
213
|
path = clean_path(path) if clean
|
207
214
|
my_path = self.path
|
208
|
-
if (my_path == path) && (published? || can_view_drafts)
|
215
|
+
if (my_path == path) && (published? || hidden? || can_view_drafts)
|
209
216
|
return self
|
210
217
|
elsif path =~ /^#{Regexp.quote(my_path)}([^\/]*)/
|
211
218
|
slug_child = children.find_by_slug($1)
|
@@ -245,6 +252,13 @@ class Page < ActiveRecord::Base
|
|
245
252
|
self.allowed_children_cache = allowed_children_lookup.collect(&:name).join(',')
|
246
253
|
end
|
247
254
|
|
255
|
+
def handle_hidden_status
|
256
|
+
return unless status_id == Status[:hidden].id
|
257
|
+
return unless TrustyCms::Application.config.on_hidden_callback
|
258
|
+
|
259
|
+
TrustyCms::Application.config.on_hidden_callback.call(self)
|
260
|
+
end
|
261
|
+
|
248
262
|
class << self
|
249
263
|
def root
|
250
264
|
find_by_parent_id(nil)
|
data/app/models/standard_tags.rb
CHANGED
@@ -103,7 +103,7 @@ module StandardTags
|
|
103
103
|
<pre><code><r:children:each [offset="number"] [limit="number"]
|
104
104
|
[by="published_at|updated_at|created_at|slug|title|keywords|description"]
|
105
105
|
[order="asc|desc"]
|
106
|
-
[status="draft|reviewed|scheduled|published|all"]
|
106
|
+
[status="draft|reviewed|scheduled|published|hidden|all"]
|
107
107
|
[paginated="true"]
|
108
108
|
[per_page="number"]
|
109
109
|
>
|
data/app/models/status.rb
CHANGED
@@ -141,7 +141,7 @@ en:
|
|
141
141
|
<pre><code><r:children:each [offset=\"number\"] [limit=\"number\"]
|
142
142
|
[by=\"published_at|updated_at|created_at|slug|title|keywords|description\"]
|
143
143
|
[order=\"asc|desc\"]
|
144
|
-
[status=\"draft|reviewed|scheduled|published|all\"]
|
144
|
+
[status=\"draft|reviewed|scheduled|published|hidden|all\"]
|
145
145
|
[paginated=\"true\"]
|
146
146
|
[per_page=\"number\"]
|
147
147
|
>
|
@@ -107,7 +107,7 @@
|
|
107
107
|
|
108
108
|
<pre><code><r:children:each [offset="number"] [limit="number"]
|
109
109
|
[by="published_at|updated_at|created_at|slug|title|keywords|description"]
|
110
|
-
[order="asc|desc"] [status="draft|reviewed|scheduled|published|all"]>
|
110
|
+
[order="asc|desc"] [status="draft|reviewed|scheduled|published|hidden|all"]>
|
111
111
|
...
|
112
112
|
</r:children:each>
|
113
113
|
</code></pre>
|
data/lib/trusty_cms/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,14 +1,29 @@
|
|
1
1
|
ENV['RAILS_ENV'] ||= 'test'
|
2
|
-
require File.expand_path(
|
3
|
-
|
4
|
-
|
2
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
3
|
+
|
4
|
+
# Coverage setup
|
5
5
|
require 'simplecov'
|
6
|
+
require 'simplecov-lcov'
|
7
|
+
|
8
|
+
SimpleCov::Formatter::LcovFormatter.config do |config|
|
9
|
+
config.report_with_single_file = true
|
10
|
+
config.output_directory = 'coverage'
|
11
|
+
config.lcov_file_name = 'lcov.info'
|
12
|
+
end
|
13
|
+
|
14
|
+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
6
15
|
SimpleCov.start('rails')
|
7
|
-
include Warden::Test::Helpers
|
8
16
|
|
17
|
+
# Test framework setup
|
18
|
+
require 'rspec/rails'
|
19
|
+
require 'factory_bot_rails'
|
20
|
+
|
21
|
+
include Warden::Test::Helpers
|
9
22
|
Rails.backtrace_cleaner.remove_silencers!
|
10
|
-
|
23
|
+
|
24
|
+
# Support files and factories
|
11
25
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
26
|
+
|
12
27
|
FactoryBot.definition_file_paths = [File.expand_path('../factories', __FILE__)]
|
13
28
|
FactoryBot.find_definitions
|
14
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrustyCms CMS dev team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-validator
|