trusty-cms 7.0.13 → 7.0.14
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/assets/stylesheets/admin/partials/_table.scss +4 -0
- data/app/helpers/admin/node_helper.rb +26 -2
- data/app/views/admin/pages/_search_result_node.html.haml +25 -0
- data/app/views/admin/pages/search.html.haml +2 -0
- data/config/locales/en.yml +1 -0
- data/lib/trusty_cms/admin_ui.rb +2 -2
- data/lib/trusty_cms/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 618e9b238cacf51c8c18350b0c9be7cb0d4888bed01644f224d829dbadb2070f
|
4
|
+
data.tar.gz: 4f31af9203e1131fb13c53758bd6fa8e10b9b747eba61539a5df17b7908ecca7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983189f270c8143c29187a46cc16f4d33d66ec2403fbd9c96f4c397e3b34f675460acbc08b2e5262b6434115678004b05e5e00fcca5785433675b175a44665c4
|
7
|
+
data.tar.gz: 1346ccda7ce5fac525ac34837e5a28d7c3cc6bee479ff20c5d71b20edbd3bc1ff5f7ced3ab9ea3f86fc630bb37a8900a87f48a6b2fde057d8ffa7dfd55dfb14a
|
data/Gemfile.lock
CHANGED
@@ -11,9 +11,9 @@ module Admin::NodeHelper
|
|
11
11
|
index
|
12
12
|
end
|
13
13
|
|
14
|
-
def render_search_node(page)
|
14
|
+
def render_search_node(page, index = 0, parent_index = nil, simple = false)
|
15
15
|
@current_node = prepare_page(page)
|
16
|
-
@rendered_html =
|
16
|
+
@rendered_html = render_search_partial(page, index:, parent_index:, simple:, path: format_path(page.path))
|
17
17
|
end
|
18
18
|
|
19
19
|
def prepare_page(page)
|
@@ -25,6 +25,17 @@ module Admin::NodeHelper
|
|
25
25
|
page
|
26
26
|
end
|
27
27
|
|
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
|
+
|
28
39
|
def homepage
|
29
40
|
@homepage ||= Page.find_by_parent_id(nil)
|
30
41
|
end
|
@@ -106,4 +117,17 @@ module Admin::NodeHelper
|
|
106
117
|
branch: page.children.count.positive?,
|
107
118
|
}
|
108
119
|
end
|
120
|
+
|
121
|
+
def render_search_partial(page, index:, parent_index:, simple:, path:)
|
122
|
+
render partial: 'admin/pages/search_result_node',
|
123
|
+
locals: {
|
124
|
+
level: index,
|
125
|
+
index: index,
|
126
|
+
parent_index: parent_index,
|
127
|
+
page: page,
|
128
|
+
simple: simple,
|
129
|
+
branch: false,
|
130
|
+
path: path,
|
131
|
+
}
|
132
|
+
end
|
109
133
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
%tr.page
|
2
|
+
- render_region :node, :locals => { :page => page, :level => level, :simple => simple, :path => path } do |node|
|
3
|
+
- node.title_column do
|
4
|
+
%td.name
|
5
|
+
%span.w1
|
6
|
+
- if simple
|
7
|
+
= node_title
|
8
|
+
- else
|
9
|
+
%i.far.fa-file
|
10
|
+
= (link_to("#{node_title}".html_safe, edit_admin_page_path(page), :title => page.path)).html_safe
|
11
|
+
= page_type
|
12
|
+
= spinner
|
13
|
+
- node.path_column do
|
14
|
+
%td.path
|
15
|
+
= path
|
16
|
+
- node.status_column do
|
17
|
+
- unless simple
|
18
|
+
%td.status
|
19
|
+
%span.status{ :class => "#{page.status.name.downcase}_status", :title => "#{timestamp(page.published_at) if page.published_at}" }= t(page.status.name.downcase)
|
20
|
+
- node.actions_column do
|
21
|
+
- unless simple
|
22
|
+
%td.actions
|
23
|
+
= page.add_child_option
|
24
|
+
- if current_user.editor? || current_user.admin?
|
25
|
+
= page.remove_option
|
@@ -9,6 +9,8 @@
|
|
9
9
|
- render_region :sitemap_head do |sitemap_head|
|
10
10
|
- sitemap_head.title_column_header do
|
11
11
|
%th.name= t('page')
|
12
|
+
- sitemap_head.path_column_header do
|
13
|
+
%th.path= t('path')
|
12
14
|
- sitemap_head.status_column_header do
|
13
15
|
%th.status= t('status')
|
14
16
|
- sitemap_head.actions_column_header do
|
data/config/locales/en.yml
CHANGED
data/lib/trusty_cms/admin_ui.rb
CHANGED
@@ -178,8 +178,8 @@ module TrustyCms
|
|
178
178
|
index.node.concat %w{title_column status_column actions_column}
|
179
179
|
end
|
180
180
|
page.search = RegionSet.new do |search|
|
181
|
-
search.sitemap_head.concat %w{title_column_header status_column_header actions_column_header}
|
182
|
-
search.node.concat %w{title_column status_column actions_column}
|
181
|
+
search.sitemap_head.concat %w{title_column_header path_column_header status_column_header actions_column_header}
|
182
|
+
search.node.concat %w{title_column path_column status_column actions_column}
|
183
183
|
end
|
184
184
|
page.remove = page.children = page.index
|
185
185
|
page.new = page._part = page.edit
|
data/lib/trusty_cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrustyCms CMS dev team
|
@@ -834,6 +834,7 @@ files:
|
|
834
834
|
- app/views/admin/pages/_popups.html.haml
|
835
835
|
- app/views/admin/pages/_previous_versions.haml
|
836
836
|
- app/views/admin/pages/_search_form.html.haml
|
837
|
+
- app/views/admin/pages/_search_result_node.html.haml
|
837
838
|
- app/views/admin/pages/children.html.haml
|
838
839
|
- app/views/admin/pages/edit.html.haml
|
839
840
|
- app/views/admin/pages/index.html.haml
|