trusty-cms 7.0.12 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6268c67cd5f36d603ddb9ce023b0fea8f265520abe38a8493314df631c928a8
4
- data.tar.gz: 31a91b7d8043ea76ffeb81dfc16bf78bd637227ac6236a355eade3a7f120b4d7
3
+ metadata.gz: 618e9b238cacf51c8c18350b0c9be7cb0d4888bed01644f224d829dbadb2070f
4
+ data.tar.gz: 4f31af9203e1131fb13c53758bd6fa8e10b9b747eba61539a5df17b7908ecca7
5
5
  SHA512:
6
- metadata.gz: 866984c6c322c001d7602acf0773850d44846a5155efc27fb2ff525d380a2c2deee855dd295b7ee73be72a1e05dbfd4056b10d1ecd618fe86d6361a96cdb7ed0
7
- data.tar.gz: 228b95c7d50664d8bd202aad0f0a97d74b39bf1594fa8ad745cf58d245f47ba44a86ca1faf4f37ac74511d266cfa4aeeb4adfcd814ffe0cc5e1f1384de7a700c
6
+ metadata.gz: 983189f270c8143c29187a46cc16f4d33d66ec2403fbd9c96f4c397e3b34f675460acbc08b2e5262b6434115678004b05e5e00fcca5785433675b175a44665c4
7
+ data.tar.gz: 1346ccda7ce5fac525ac34837e5a28d7c3cc6bee479ff20c5d71b20edbd3bc1ff5f7ced3ab9ea3f86fc630bb37a8900a87f48a6b2fde057d8ffa7dfd55dfb14a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (7.0.12)
4
+ trusty-cms (7.0.14)
5
5
  RedCloth (= 4.3.3)
6
6
  activestorage-validator
7
7
  acts_as_list (>= 0.9.5, < 1.3.0)
@@ -23,6 +23,10 @@ table {
23
23
  width: 100%;
24
24
  }
25
25
 
26
+ &.path {
27
+ min-width: 8em;
28
+ }
29
+
26
30
  &.status {
27
31
  min-width: 8em;
28
32
  }
@@ -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 = render_partial(page, index: 0, parent_index: nil, simple: false)
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
@@ -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|published|hidden|all"]
106
+ [status="draft|reviewed|scheduled|published|all"]
107
107
  [paginated="true"]
108
108
  [per_page="number"]
109
109
  >
data/app/models/status.rb CHANGED
@@ -32,6 +32,5 @@ 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'),
36
35
  ]
37
36
  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
@@ -234,6 +234,7 @@ en:
234
234
  parent_page: 'Parent Page'
235
235
  password: 'Password'
236
236
  password_confirmation: 'Confirm New Password'
237
+ path: 'Path'
237
238
  personal: 'Personal'
238
239
  personal_preferences: 'Personal Preferences'
239
240
  please_login: 'Please Login'
@@ -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|published|hidden|all\"]
144
+ [status=\"draft|reviewed|scheduled|published|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|published|hidden|all"]>
110
+ [order="asc|desc"] [status="draft|reviewed|scheduled|published|all"]>
111
111
  ...
112
112
  </r&#58;children&#58;each>
113
113
  </code></pre>
@@ -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
@@ -1,4 +1,3 @@
1
1
  module TrustyCms
2
- VERSION = '7.0.12'.freeze
2
+ VERSION = '7.0.14'.freeze
3
3
  end
4
-
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.12
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