trusty-cms 7.0.26 → 7.0.27

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: d45d76c458d982e12e398501691b9c80786772ae9a752b2476bcababf4f97ceb
4
- data.tar.gz: c5ff04b23662c3df08191e9780008c1f28b7eaffcb6f54a912dda3521f2bf22e
3
+ metadata.gz: 94e21fe3c5c8a96301637f07c7a3520590884187a45d9e1f00aa39e81e129f5c
4
+ data.tar.gz: 769b855942bd1bb7ecdf193c062e47f45d77fe0561acc9b0b368f5a934e56408
5
5
  SHA512:
6
- metadata.gz: 9b73ce6f51a809957d30ca3a51a67f2496db293b1160438608029d3a6e3ec40ea6aea40adad0d60374212a3475a508e900505b957890c486e505d47b15a3a69c
7
- data.tar.gz: 0b72e9b00f8dd0b2b5964f4d00f6d6cc085052a7c0e9635f48a6aee8325460d2890449b0a65200b490087c4b3d82c589d63987e987954c9e5278f92a4e315134
6
+ metadata.gz: ec4b76f1b3009d3eb40fa9cd66f033967f9a3ebdeb022ccfbf04d60e88c11dfe7ee2a4dac88a879ecd57170903dd0de2705c8fb5ab50bb2426a34daf23065e37
7
+ data.tar.gz: 403fc527a1bf912a6498efc113082b360556df0fec15148f4cfeb7efdd213b62b04fa935d60f65f57134297f4685a2da0a1895c0957bb0b6a7719f1384635070
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (7.0.26)
4
+ trusty-cms (7.0.27)
5
5
  RedCloth (= 4.3.3)
6
6
  activestorage-validator
7
7
  acts_as_list (>= 0.9.5, < 1.3.0)
@@ -3,7 +3,6 @@ class Admin::PagesController < Admin::ResourceController
3
3
  before_action :count_deleted_pages, only: [:destroy]
4
4
  before_action :set_page, only: %i[edit restore]
5
5
  rescue_from ActiveRecord::RecordInvalid, with: :validation_error
6
- include Admin::NodeHelper
7
6
  include Admin::PagesHelper
8
7
  include Admin::UrlHelper
9
8
 
@@ -1,4 +1,6 @@
1
1
  module Admin::NodeHelper
2
+ include Admin::UrlHelper
3
+
2
4
  def render_nodes(page, starting_index, parent_index = nil, simple = false)
3
5
  @rendered_html = ''
4
6
  render_node page, starting_index, parent_index, simple
@@ -25,17 +27,6 @@ module Admin::NodeHelper
25
27
  page
26
28
  end
27
29
 
28
- def format_path(path)
29
- return '' if path.nil? || path.empty?
30
-
31
- parts = path.split('/').reject(&:empty?)
32
- return 'Root' if parts.size == 1
33
- return '/' if parts.size == 2
34
-
35
- formatted_path = parts[1..-2].join('/')
36
- formatted_path.empty? ? '/' : "/#{formatted_path}"
37
- end
38
-
39
30
  def homepage
40
31
  @homepage ||= Page.find_by_parent_id(nil)
41
32
  end
@@ -1,6 +1,18 @@
1
1
  module Admin::UrlHelper
2
2
  require 'uri'
3
3
 
4
+ def format_path(path)
5
+ return '' if path.to_s.empty?
6
+
7
+ parts = path.split('/').reject(&:empty?)
8
+ parts_size = parts.size
9
+ return 'Root' if parts_size == 1
10
+ return '/' if parts_size == 2
11
+
12
+ formatted_path = parts[1..-2].join('/')
13
+ formatted_path.empty? ? '/' : "/#{formatted_path}"
14
+ end
15
+
4
16
  def generate_page_url(url, page)
5
17
  base_url = extract_base_url(url)
6
18
  build_url(base_url, page)
data/app/models/page.rb CHANGED
@@ -121,7 +121,7 @@ class Page < ActiveRecord::Base
121
121
  def path
122
122
  return '' if slug.blank?
123
123
 
124
- parent? ? parent.child_path(self) : clean_path(slug)
124
+ parent.present? ? clean_path("#{parent.path}/#{slug}") : clean_path(slug)
125
125
  end
126
126
 
127
127
  alias_method :url, :path
@@ -1,3 +1,3 @@
1
1
  module TrustyCms
2
- VERSION = '7.0.26'.freeze
2
+ VERSION = '7.0.27'.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.26
4
+ version: 7.0.27
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-04-02 00:00:00.000000000 Z
11
+ date: 2025-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activestorage-validator