aslakjo-comatose 2.0.5.3 → 2.0.5.7
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.
- data/comatose.gemspec +2 -2
- data/lib/comatose/configuration.rb +3 -0
- data/lib/comatose.rb +2 -0
- data/lib/comatose_admin_controller.rb +15 -3
- data/lib/comatose_page.rb +6 -1
- metadata +5 -4
data/comatose.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated on Tue May 20 20:13:12 -0500 2008
|
2
2
|
Gem::Specification.new do |s|
|
3
|
-
s.name = "comatose"
|
4
|
-
s.version = "2.0.5.
|
3
|
+
s.name = "aslakjo-comatose"
|
4
|
+
s.version = "2.0.5.7"
|
5
5
|
s.date = "2008-10-31" # 2008-05-20
|
6
6
|
s.summary = "Micro CMS designed for being embedded into existing Rails applications"
|
7
7
|
s.email = "matt@elucidata.net"
|
@@ -41,6 +41,9 @@ module Comatose
|
|
41
41
|
# 'Blockable' setters
|
42
42
|
blockable_attr_accessor :authorization
|
43
43
|
blockable_attr_accessor :admin_authorization
|
44
|
+
blockable_attr_accessor :after_page_save
|
45
|
+
blockable_attr_accessor :controller_before_new
|
46
|
+
blockable_attr_accessor :controller_before_update
|
44
47
|
blockable_attr_accessor :admin_get_author
|
45
48
|
blockable_attr_accessor :admin_get_root_page
|
46
49
|
blockable_attr_accessor :after_setup
|
data/lib/comatose.rb
CHANGED
@@ -24,6 +24,12 @@ class ComatoseAdminController < ActionController::Base
|
|
24
24
|
@page.updated_on = Time.now
|
25
25
|
@page.author = fetch_author_name
|
26
26
|
if @page.save
|
27
|
+
begin
|
28
|
+
instance_eval &Comatose.config.controller_before_update
|
29
|
+
rescue Exception => e
|
30
|
+
p e
|
31
|
+
end
|
32
|
+
|
27
33
|
expire_cms_page @page
|
28
34
|
expire_cms_fragment @page
|
29
35
|
flash[:notice] = "Saved changes to '#{@page.title}'"
|
@@ -39,6 +45,12 @@ class ComatoseAdminController < ActionController::Base
|
|
39
45
|
@page = ComatosePage.new params[:page]
|
40
46
|
@page.author = fetch_author_name
|
41
47
|
if @page.save
|
48
|
+
begin
|
49
|
+
instance_eval &Comatose.config.controller_before_new
|
50
|
+
rescue Exception => e
|
51
|
+
p e
|
52
|
+
end
|
53
|
+
|
42
54
|
flash[:notice] = "Created page '#{@page.title}'"
|
43
55
|
redirect_to :controller=>self.controller_name, :action=>'index'
|
44
56
|
end
|
@@ -59,8 +71,8 @@ class ComatoseAdminController < ActionController::Base
|
|
59
71
|
if params.has_key? :cmd
|
60
72
|
@target = ComatosePage.find params[:page]
|
61
73
|
case params[:cmd]
|
62
|
-
|
63
|
-
|
74
|
+
when 'up' then @target.move_higher
|
75
|
+
when 'down' then @target.move_lower
|
64
76
|
end
|
65
77
|
redirect_to :action=>'reorder', :id=>@page
|
66
78
|
end
|
@@ -160,7 +172,7 @@ class ComatoseAdminController < ActionController::Base
|
|
160
172
|
redirect_to :controller=>self.controller_name, :action=>'index'
|
161
173
|
end
|
162
174
|
|
163
|
-
protected
|
175
|
+
protected
|
164
176
|
|
165
177
|
def handle_authorization
|
166
178
|
if Comatose.config.admin_authorization.is_a? Proc
|
data/lib/comatose_page.rb
CHANGED
@@ -25,7 +25,7 @@ class ComatosePage < ActiveRecord::Base
|
|
25
25
|
|
26
26
|
#before_create :create_full_path
|
27
27
|
before_save :cache_full_path, :create_full_path
|
28
|
-
after_save :update_children_full_path
|
28
|
+
after_save :update_children_full_path, :after_save_hook
|
29
29
|
|
30
30
|
# Using before_validation so we can default the slug from the title
|
31
31
|
before_validation do |record|
|
@@ -107,6 +107,11 @@ class ComatosePage < ActiveRecord::Base
|
|
107
107
|
|
108
108
|
protected
|
109
109
|
|
110
|
+
def after_save_hook
|
111
|
+
instance_eval &Comatose.config.after_page_save
|
112
|
+
end
|
113
|
+
|
114
|
+
|
110
115
|
# Creates a URI path based on the Page tree
|
111
116
|
def create_full_path
|
112
117
|
if parent_node = self.parent
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aslakjo-comatose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.5.
|
4
|
+
version: 2.0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M@ McCray
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-31 00:00:00
|
12
|
+
date: 2008-10-31 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -108,7 +108,8 @@ files:
|
|
108
108
|
- views/layouts/comatose_content.html.erb
|
109
109
|
has_rdoc: true
|
110
110
|
homepage: http://comatose.rubyforge.org
|
111
|
-
licenses:
|
111
|
+
licenses: []
|
112
|
+
|
112
113
|
post_install_message:
|
113
114
|
rdoc_options:
|
114
115
|
- --main
|
@@ -132,7 +133,7 @@ requirements: []
|
|
132
133
|
rubyforge_project: comatose
|
133
134
|
rubygems_version: 1.3.5
|
134
135
|
signing_key:
|
135
|
-
specification_version:
|
136
|
+
specification_version: 3
|
136
137
|
summary: Micro CMS designed for being embedded into existing Rails applications
|
137
138
|
test_files:
|
138
139
|
- test/behaviors.rb
|