radiant-concurrent_draft-extension 1.0.5 → 1.0.6
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/README.textile
CHANGED
@@ -55,6 +55,10 @@ Scheduled times are dependent on the ActiveRecord time setting. If you want to
|
|
55
55
|
|
56
56
|
<pre>config.active_record.default_timezone = :local</pre>
|
57
57
|
|
58
|
+
h2. To do
|
59
|
+
|
60
|
+
* Add draft controls to Page Index view, probably in the Status column.
|
61
|
+
|
58
62
|
h2. Acknowledgments
|
59
63
|
|
60
64
|
* Andrew conceived of the ideas for this extension and its initial design, and did model changes, migrations, and initial code for pages.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.6
|
@@ -29,24 +29,24 @@ module ConcurrentDraft::AdminControllerExtensions
|
|
29
29
|
case params[:commit]
|
30
30
|
when model_class.promote_now_text
|
31
31
|
model.promote_draft!
|
32
|
-
flash[:notice] = "
|
32
|
+
flash[:notice] = "Draft #{model_class.to_s.downcase} '#{model.display_name}' has been promoted and is now live."
|
33
33
|
when model_class.schedule_promotion_text
|
34
34
|
if model.update_attributes(params[model.class.name.underscore.intern])
|
35
|
-
flash[:notice] = "
|
35
|
+
flash[:notice] = "Draft #{model_class.to_s.downcase} '#{model.display_name}' will be promoted on #{model.draft_promotion_scheduled_at.to_s(:long_civilian)}."
|
36
36
|
else
|
37
37
|
flash[:error] = model.errors.full_messages.to_sentence
|
38
38
|
end
|
39
39
|
when model_class.cancel_promotion_text
|
40
40
|
model.cancel_promotion!
|
41
|
-
flash[:notice] = "
|
41
|
+
flash[:notice] = "Scheduled draft promotion of #{model_class.to_s.downcase} '#{model.display_name}' has been cancelled."
|
42
42
|
end
|
43
|
-
redirect_to :action => "
|
43
|
+
redirect_to :action => "index"
|
44
44
|
end
|
45
45
|
|
46
46
|
def unpublish
|
47
47
|
self.model = model_class.find(params[:id])
|
48
48
|
model.unpublish!
|
49
|
-
flash[:notice] = "#{model_class} has been unpublished and reset to draft mode
|
50
|
-
redirect_to :action => "
|
49
|
+
flash[:notice] = "#{model_class} '#{model.display_name}' has been unpublished and reset to draft mode."
|
50
|
+
redirect_to :action => "index"
|
51
51
|
end
|
52
52
|
end
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{radiant-concurrent_draft-extension}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrew vonderLuft", "Sean Cribbs"]
|
12
|
-
s.date = %q{2011-06
|
12
|
+
s.date = %q{2011-07-06}
|
13
13
|
s.description = %q{Enables draft versions of pages, snippets and layouts, which can be scheduled for promotion.}
|
14
14
|
s.email = %q{avonderluft@avlux.net}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -69,7 +69,7 @@ Gem::Specification.new do |s|
|
|
69
69
|
]
|
70
70
|
s.homepage = %q{https://github.com/avonderluft/radiant-concurrent_draft-extension}
|
71
71
|
s.require_paths = ["lib"]
|
72
|
-
s.rubygems_version = %q{1.
|
72
|
+
s.rubygems_version = %q{1.5.2}
|
73
73
|
s.summary = %q{Concurrent Draft Extension for Radiant CMS}
|
74
74
|
s.test_files = [
|
75
75
|
"spec/controllers/admin_controller_extensions_spec.rb",
|
@@ -22,6 +22,7 @@ shared_examples_for 'controller with scheduled draft promotion' do
|
|
22
22
|
|
23
23
|
it "should load the model" do
|
24
24
|
@klass.should_receive(:find).with('1').and_return(@object)
|
25
|
+
@object.should_receive(:display_name)
|
25
26
|
login_as :admin
|
26
27
|
do_post
|
27
28
|
assigns[@model_symbol].should == @object
|
@@ -41,9 +42,10 @@ shared_examples_for 'controller with scheduled draft promotion' do
|
|
41
42
|
end
|
42
43
|
|
43
44
|
it "should allow #{user}" do
|
45
|
+
@object.should_receive(:display_name)
|
44
46
|
do_post
|
45
47
|
response.should be_redirect
|
46
|
-
response.should redirect_to(:action => "
|
48
|
+
response.should redirect_to(:action => "index")
|
47
49
|
flash[:error].should be_blank
|
48
50
|
end
|
49
51
|
end
|
@@ -71,10 +73,12 @@ shared_examples_for 'controller with scheduled draft promotion' do
|
|
71
73
|
|
72
74
|
it "should promote the draft" do
|
73
75
|
@object.should_receive(:promote_draft!)
|
76
|
+
@object.should_receive(:display_name)
|
74
77
|
do_post
|
75
78
|
end
|
76
79
|
|
77
80
|
it "should set the flash message" do
|
81
|
+
@object.should_receive(:display_name)
|
78
82
|
do_post
|
79
83
|
flash[:notice].should match(/published|promoted/)
|
80
84
|
end
|
@@ -105,6 +109,7 @@ shared_examples_for 'controller with scheduled draft promotion' do
|
|
105
109
|
|
106
110
|
it "should set the flash notice message when the scheduled time is valid" do
|
107
111
|
@object.should_receive(:update_attributes).with(@post_attrs).and_return(true)
|
112
|
+
@object.should_receive(:display_name)
|
108
113
|
do_post
|
109
114
|
flash[:notice].should match(/will be promoted/)
|
110
115
|
end
|
@@ -118,6 +123,7 @@ shared_examples_for 'controller with scheduled draft promotion' do
|
|
118
123
|
|
119
124
|
describe "cancelling promotion" do
|
120
125
|
def do_post
|
126
|
+
@object.should_receive(:display_name)
|
121
127
|
post :schedule_draft_promotion, :id => '1', :commit => @klass.cancel_promotion_text
|
122
128
|
end
|
123
129
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-concurrent_draft-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 6
|
10
|
+
version: 1.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew vonderLuft
|
@@ -16,11 +16,10 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-06
|
19
|
+
date: 2011-07-06 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
prerelease: false
|
24
23
|
type: :runtime
|
25
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
25
|
none: false
|
@@ -37,6 +36,7 @@ dependencies:
|
|
37
36
|
version: 1.0.0.rc2
|
38
37
|
name: radiant
|
39
38
|
version_requirements: *id001
|
39
|
+
prerelease: false
|
40
40
|
description: Enables draft versions of pages, snippets and layouts, which can be scheduled for promotion.
|
41
41
|
email: avonderluft@avlux.net
|
42
42
|
executables: []
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements: []
|
127
127
|
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.
|
129
|
+
rubygems_version: 1.5.2
|
130
130
|
signing_key:
|
131
131
|
specification_version: 3
|
132
132
|
summary: Concurrent Draft Extension for Radiant CMS
|