trusty-cms 7.0.33 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68134124cffa9c5b3650517c2108983ac808d261e6dded72aaf00fa427e3716e
4
- data.tar.gz: 3051946f3c7eb0e0efc1b7e8b455c1e09a87bbe55520dd2159e6a2d2b3cbd22b
3
+ metadata.gz: d6b86ba1e1cf29f8dd56b21dab2388ae52deb53a270a954d4edf58e0f00e0362
4
+ data.tar.gz: 9c758e59cf39a4846f2f7d9c86efef12ff78c8fa234b51645fd27e02276c5c98
5
5
  SHA512:
6
- metadata.gz: 2b8b5f3240e1d390467553d2eab703cfe97e18032aa8f8d8b18a9d48d4a5c4bf3eedf831c1b6bd383b68a7e915bae2a5f90a96b8656f85c27bb134a73746ff4e
7
- data.tar.gz: 0bc388d5a0ae02d0a9ec52d0cdca50a4de10ae33fb1cd3620bdb1271b69162bd6bdd8f64395b2cd8e165ed6cb623736cfd66639bf78bed7562d5d1bacc8728d8
6
+ metadata.gz: 4ac45e34396dd1c0f67b8f9a8dcb4f90453216d33b74f3548c0c71e21106a1394c40f2743cf69ccb63cbb1cc2245fcb92512c3a23496ac5767234f14c9d6a5b7
7
+ data.tar.gz: ae24233d4459d143037ee58c28629b5ca9040b127f0b1e05a58d58d9dead7a4e6ebe1b3d3726b3ca51bf4b689d0b87f8d17c9462c1bf318ee1de5a3f528ba9b3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (7.0.33)
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)
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, :update_published_datetime, :set_allowed_children_cache
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)
@@ -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
@@ -32,5 +32,6 @@ class Status
32
32
  Status.new(id: 50, name: 'Reviewed'),
33
33
  Status.new(id: 90, name: 'Scheduled'),
34
34
  Status.new(id: 100, name: 'Published'),
35
+ Status.new(id: 101, name: 'Hidden'),
35
36
  ]
36
37
  end
@@ -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&#58;children&#58;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&#58;children&#58;each>
113
113
  </code></pre>
@@ -1,3 +1,3 @@
1
1
  module TrustyCms
2
- VERSION = '7.0.33'.freeze
2
+ VERSION = '7.0.34'.freeze
3
3
  end
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.33
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-12 00:00:00.000000000 Z
11
+ date: 2025-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage-validator