radiant-backend_archive_view-extension 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -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.3'
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: 17
5
- prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 3
10
- version: 1.0.3
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: 2012-08-17 00:00:00 +02: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
@@ -63,46 +50,32 @@ files:
63
50
  - lib/radiant-backend_archive_view-extension.rb
64
51
  - lib/tasks/backend_archive_view_extension_tasks.rake
65
52
  - radiant-backend_archive_view-extension.gemspec
66
- - Rakefile
67
- - README.md
68
53
  - spec/spec.opts
69
54
  - spec/spec_helper.rb
70
- has_rdoc: true
71
55
  homepage: https://github.com/jomz/radiant-backend_archive_view-extension
72
56
  licenses: []
73
-
57
+ metadata: {}
74
58
  post_install_message:
75
59
  rdoc_options: []
76
-
77
- require_paths:
60
+ require_paths:
78
61
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
80
- none: false
81
- requirements:
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
82
64
  - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- version: "0"
88
- required_rubygems_version: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
91
69
  - - ">="
92
- - !ruby/object:Gem::Version
93
- hash: 3
94
- segments:
95
- - 0
96
- version: "0"
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
97
72
  requirements: []
98
-
99
- rubyforge_project:
100
- rubygems_version: 1.5.3
73
+ rubygems_version: 3.1.2
101
74
  signing_key:
102
- specification_version: 3
75
+ specification_version: 4
103
76
  summary: Backend Archive View for Radiant CMS
104
- test_files:
105
- - spec/spec.opts
77
+ test_files:
106
78
  - spec/spec_helper.rb
79
+ - spec/spec.opts
107
80
  - features/support/env.rb
108
81
  - features/support/paths.rb