radiant-backend_archive_view-extension 1.0.1 → 1.0.4

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ba185040c45f503d70065ca89163f1c1a24740ba887d76684b034d7bf694eb82
4
+ data.tar.gz: af816f2daa484ac40f0a1f746a88f63531cd5ef168bd925f169c7f1074f1bcb1
5
+ SHA512:
6
+ metadata.gz: ddf37d2924281b0780d54315a4e27262de67dd6b58808c1d2a172c82efce667f608708b874b7e535e3335ed02d0f1e678e8b2b0a1ffa16545080089ee3c34e08
7
+ data.tar.gz: 774861486de4618131927bc36cf29fe4cffd06d9aa2d0f93e55f9dca0ae7b643eed583bb47f14425d1fcf8d5fc87c63db5276b41ad59199b168c246098f51f43
@@ -38,5 +38,7 @@
38
38
  :style => 'display: none;')
39
39
  - else
40
40
  = render_nodes page.tree_children, :level => level + 1, :simple => simple
41
+ - page.children.select{|c| c.class_name =~ /Archive(.*)IndexPage/}.each do |archive_index|
42
+ = render_node archive_index, :level => level + 1, :simple => simple
41
43
  - else
42
44
  = render_nodes page.children, :level => level + 1, :simple => simple
@@ -46,6 +46,9 @@
46
46
  :style => 'display: none;')
47
47
  - else
48
48
  = render_nodes page.tree_children, :level => level + 1, :simple => simple
49
+ - page.children.select{|c| c.class_name =~ /Archive(.*)IndexPage/}.each do |archive_index|
50
+ = render_node archive_index, :level => level + 1, :simple => simple
51
+
49
52
  - else
50
53
  = render_nodes page.children, :level => level + 1, :simple => simple
51
54
 
@@ -1,6 +1,8 @@
1
1
  - if @offset.nil? || @offset < 12
2
2
  - if @parent.respond_to?(:tree_children)
3
3
  = render_nodes @parent.tree_children[0...12], :level => @level + 1
4
+ - @parent.children.select{|c| c.class_name =~ /Archive(.*)IndexPage/}.each do |archive_index|
5
+ = render_node archive_index, :level => @level + 1
4
6
  - if @parent.tree_children.size > 12
5
7
  %tr{:class => "level_#{@level + 1} node_fetcher"}
6
8
  %td.nodes_fetcher{:style => "padding-left: #{padding_left(@level)}px; text-align: center", :colspan => 5}
@@ -9,6 +11,8 @@
9
11
  :class => 'busy', :id => "node_fetcher_#{@parent.id}_spinner",
10
12
  :alt => "", :title => "",
11
13
  :style => 'display: none;')
14
+ - else
15
+ = render_nodes models, :level => @level + 1
12
16
  - else
13
17
  - if @parent.respond_to?(:tree_children)
14
18
  - @parent.tree_children[@offset...@end].each do |child|
@@ -12,7 +12,7 @@ module ArchivePageTreeStructure
12
12
  end
13
13
  tree_children #+ children.find(:all, :conditions => ['virtual = ?', true])
14
14
  end
15
-
15
+
16
16
  def edge_date(first)
17
17
  if !first && children.find(:first, :conditions => 'updated_at is null')
18
18
  return Time.now
@@ -20,7 +20,7 @@ module ArchivePageTreeStructure
20
20
  order = first ? 'asc' : 'desc'
21
21
  child = children.find(:first, :order => "published_at #{order}", :conditions => 'not(published_at is null)')
22
22
  edge = child.published_at if child
23
- child = children.find(:first, :order => "updated_at #{order}", :conditions => 'published_at is null and not(updated_at is null)')
23
+ child = children.find(:first, :order => "updated_at #{order}", :conditions => 'pages.published_at is null and not(pages.updated_at is null)')
24
24
  if child
25
25
  if first
26
26
  edge = child.updated_at if !edge || child.updated_at < edge
@@ -30,7 +30,7 @@ module ArchivePageTreeStructure
30
30
  end
31
31
  edge
32
32
  end
33
-
33
+
34
34
  def tree_child(slug)
35
35
  first = [edge_date(true),Time.utc(slug.to_i)].max
36
36
  last = edge_date(false)
@@ -63,7 +63,7 @@ module ArchivePageTreeStructure
63
63
  Status.new(:name => ' ')
64
64
  end
65
65
  end
66
-
66
+
67
67
  class ArchiveYearTreePage < ArchiveTreePage
68
68
  def initialize(parent, start_time, end_time=nil)
69
69
  @parent = parent
@@ -91,7 +91,7 @@ module ArchivePageTreeStructure
91
91
  ArchiveMonthTreePage.new(@parent, @start_time.beginning_of_year.months_since(slug.to_i - 1))
92
92
  end
93
93
  end
94
-
94
+
95
95
  class ArchiveMonthTreePage < ArchiveTreePage
96
96
  def initialize(parent, start_time)
97
97
  @parent = parent
@@ -108,16 +108,16 @@ module ArchivePageTreeStructure
108
108
  end
109
109
  def tree_children
110
110
  end_time = @start_time.next_month.beginning_of_month
111
- condition_string = 'virtual = ? and (published_at >= ? and published_at < ? or (published_at is null and ('
112
- condition_string += 'updated_at is null or ' if Time.now.utc.beginning_of_month == @start_time.beginning_of_month
113
- condition_string += '(updated_at >= ? and updated_at < ?))))'
114
- @parent.children.find(:all,
111
+ condition_string = 'pages.virtual = ? and (pages.published_at >= ? and pages.published_at < ? or (pages.published_at is null and ('
112
+ condition_string += 'pages.updated_at is null or ' if Time.now.utc.beginning_of_month == @start_time.beginning_of_month
113
+ condition_string += '(pages.updated_at >= ? and pages.updated_at < ?))))'
114
+ @parent.children.find(:all,
115
115
  :conditions => [
116
- condition_string,
116
+ condition_string,
117
117
  false,
118
- @start_time,
118
+ @start_time,
119
119
  end_time,
120
- @start_time,
120
+ @start_time,
121
121
  end_time,
122
122
  ],
123
123
  :order => 'published_at desc, updated_at desc'
@@ -1,8 +1,8 @@
1
1
  module RadiantBackendArchiveViewExtension
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.4'
3
3
  SUMMARY = %q{Backend Archive View for Radiant CMS}
4
4
  DESCRIPTION = %q{Helps organize ArchivePages with many children.}
5
5
  URL = "https://github.com/jomz/radiant-backend_archive_view-extension"
6
6
  AUTHORS = ["Benny Degezelle"]
7
7
  EMAIL = ["hi@monkeypatch.be"]
8
- end
8
+ end
metadata CHANGED
@@ -1,51 +1,38 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: radiant-backend_archive_view-extension
3
- version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 1
10
- version: 1.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.4
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Benny Degezelle
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2011-11-18 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
11
+ date: 2022-06-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
22
14
  name: radiant
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
27
17
  - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 15424051
30
- segments:
31
- - 1
32
- - 0
33
- - 0
34
- - rc
35
- - 3
18
+ - !ruby/object:Gem::Version
36
19
  version: 1.0.0.rc3
37
20
  type: :runtime
38
- version_requirements: *id001
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.0.0.rc3
39
27
  description: Helps organize ArchivePages with many children.
40
- email:
28
+ email:
41
29
  - hi@monkeypatch.be
42
30
  executables: []
43
-
44
31
  extensions: []
45
-
46
32
  extra_rdoc_files: []
47
-
48
- files:
33
+ files:
34
+ - README.md
35
+ - Rakefile
49
36
  - app/views/admin/pages/_copy_move_extra_td.html.haml
50
37
  - app/views/admin/pages/_node.html.haml
51
38
  - app/views/admin/pages/_nodes.html.haml
@@ -62,48 +49,33 @@ files:
62
49
  - lib/pages_controller_extensions.rb
63
50
  - lib/radiant-backend_archive_view-extension.rb
64
51
  - lib/tasks/backend_archive_view_extension_tasks.rake
65
- - radiant-backend_archive_view-extension-1.0.0.gem
66
52
  - radiant-backend_archive_view-extension.gemspec
67
- - Rakefile
68
- - README.md
69
53
  - spec/spec.opts
70
54
  - spec/spec_helper.rb
71
- has_rdoc: true
72
55
  homepage: https://github.com/jomz/radiant-backend_archive_view-extension
73
56
  licenses: []
74
-
57
+ metadata: {}
75
58
  post_install_message:
76
59
  rdoc_options: []
77
-
78
- require_paths:
60
+ require_paths:
79
61
  - lib
80
- required_ruby_version: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
83
64
  - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 3
86
- segments:
87
- - 0
88
- version: "0"
89
- required_rubygems_version: !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
92
69
  - - ">="
93
- - !ruby/object:Gem::Version
94
- hash: 3
95
- segments:
96
- - 0
97
- version: "0"
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
98
72
  requirements: []
99
-
100
- rubyforge_project:
101
- rubygems_version: 1.5.3
73
+ rubygems_version: 3.1.2
102
74
  signing_key:
103
- specification_version: 3
75
+ specification_version: 4
104
76
  summary: Backend Archive View for Radiant CMS
105
- test_files:
106
- - spec/spec.opts
77
+ test_files:
107
78
  - spec/spec_helper.rb
79
+ - spec/spec.opts
108
80
  - features/support/env.rb
109
81
  - features/support/paths.rb