alchemy_cms 4.0.4 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35a5066f5fee296b67dd64a9d8ddd912a83a4197c4a0c101e9c4ede1973f1af2
|
4
|
+
data.tar.gz: 36bebc442b75517a7f39e15fb6bc7a80ec3f03c1a126a220dfef6dbc4c55e39c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e7de480331dd62d6a65cd477ad95d9e3648e693a6dcd7577ba6faa574204bd9a4fcb66c9b0c3c2599cbb74209f3ae18ff8866ab14c7e59b59fc2d6f3700ec3b
|
7
|
+
data.tar.gz: dbe2c4290d20bb68218f6628165086d3747a5cb6153b891c6618ed4789fae15e1fca231a6b5e6fd78357d20db730e6fbd83b1e845a5099e98fb5a160b03b98f9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 4.0.5 (unreleased)
|
4
|
+
|
5
|
+
- Do not cache sitemap in Turbolinks [#1463](https://github.com/AlchemyCMS/alchemy_cms/pull/1463) ([tvdeyen](https://github.com/tvdeyen))
|
6
|
+
- Skip folded deeper levels when rendering page tree [#1324](https://github.com/AlchemyCMS/alchemy_cms/pull/1324) ([pascalj](https://github.com/pascalj))
|
7
|
+
|
3
8
|
## 4.0.4 (2018-09-05)
|
4
9
|
|
5
10
|
- Allow Kaminari 1.x [#1467](https://github.com/AlchemyCMS/alchemy_cms/pull/1467) ([tvdeyen](https://github.com/tvdeyen))
|
@@ -15,5 +15,10 @@ module Alchemy
|
|
15
15
|
belongs_to :page, required: true
|
16
16
|
belongs_to :user, required: true,
|
17
17
|
class_name: Alchemy.user_class_name
|
18
|
+
|
19
|
+
def self.folded_for_user(user)
|
20
|
+
return none unless Alchemy.user_class < ActiveRecord::Base
|
21
|
+
where(user: user, folded: true)
|
22
|
+
end
|
18
23
|
end
|
19
24
|
end
|
@@ -10,23 +10,24 @@ module Alchemy
|
|
10
10
|
tree = []
|
11
11
|
path = [{id: object.parent_id, children: tree}]
|
12
12
|
page_list = object.self_and_descendants
|
13
|
-
skip_branch = false
|
14
13
|
base_level = object.level - 1
|
14
|
+
# Load folded pages in advance
|
15
|
+
folded_user_pages = FoldedPage.folded_for_user(opts[:user]).pluck(:page_id)
|
16
|
+
folded_depth = Float::INFINITY
|
15
17
|
|
16
18
|
page_list.each_with_index do |page, i|
|
17
19
|
has_children = page_list[i + 1] && page_list[i + 1].parent_id == page.id
|
18
|
-
folded = has_children &&
|
20
|
+
folded = has_children && folded_user_pages.include?(page.id)
|
19
21
|
|
20
|
-
if
|
21
|
-
next
|
22
|
-
|
23
|
-
|
22
|
+
if page.depth > folded_depth
|
23
|
+
next
|
24
|
+
else
|
25
|
+
folded_depth = Float::INFINITY
|
24
26
|
end
|
25
27
|
|
26
|
-
#
|
27
|
-
# full tree.
|
28
|
+
# If this page is folded, skip all pages that are on a higher level (further down the tree).
|
28
29
|
if folded && !opts[:full]
|
29
|
-
|
30
|
+
folded_depth = page.depth
|
30
31
|
end
|
31
32
|
|
32
33
|
if page.parent_id != path.last[:id]
|
data/lib/alchemy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2018-09-
|
16
|
+
date: 2018-09-17 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active_model_serializers
|