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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/admin/pages_controller.rb +0 -1
- data/app/helpers/admin/node_helper.rb +2 -11
- data/app/helpers/admin/url_helper.rb +12 -0
- data/app/models/page.rb +1 -1
- data/lib/trusty_cms/version.rb +1 -1
- 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: 94e21fe3c5c8a96301637f07c7a3520590884187a45d9e1f00aa39e81e129f5c
|
4
|
+
data.tar.gz: 769b855942bd1bb7ecdf193c062e47f45d77fe0561acc9b0b368f5a934e56408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec4b76f1b3009d3eb40fa9cd66f033967f9a3ebdeb022ccfbf04d60e88c11dfe7ee2a4dac88a879ecd57170903dd0de2705c8fb5ab50bb2426a34daf23065e37
|
7
|
+
data.tar.gz: 403fc527a1bf912a6498efc113082b360556df0fec15148f4cfeb7efdd213b62b04fa935d60f65f57134297f4685a2da0a1895c0957bb0b6a7719f1384635070
|
data/Gemfile.lock
CHANGED
@@ -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.
|
124
|
+
parent.present? ? clean_path("#{parent.path}/#{slug}") : clean_path(slug)
|
125
125
|
end
|
126
126
|
|
127
127
|
alias_method :url, :path
|
data/lib/trusty_cms/version.rb
CHANGED
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.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-
|
11
|
+
date: 2025-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-validator
|