outpost-publishing 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +3 -0
- data/lib/assets/javascripts/outpost/content_alarm.js.coffee +10 -10
- data/lib/assets/javascripts/outpost/publishing.js.coffee +7 -7
- data/lib/assets/javascripts/outpost/publishing_helper.js.coffee +9 -9
- data/lib/outpost/publishing/version.rb +1 -1
- data/outpost-publishing.gemspec +0 -4
- metadata +5 -53
data/CHANGELOG.md
ADDED
@@ -9,10 +9,10 @@
|
|
9
9
|
class outpost.ContentAlarm extends outpost.PublishingHelper
|
10
10
|
constructor: (@options={}) ->
|
11
11
|
super
|
12
|
-
|
13
|
-
# The actual datetime input
|
12
|
+
|
13
|
+
# The actual datetime input
|
14
14
|
@datetimeField = @container.find("input.datetime")
|
15
|
-
|
15
|
+
|
16
16
|
# Alerts
|
17
17
|
@alerts =
|
18
18
|
isScheduled: new outpost.Notification(@notifications, "success", "This content is <strong>scheduled</strong> to be published.")
|
@@ -23,10 +23,10 @@ class outpost.ContentAlarm extends outpost.PublishingHelper
|
|
23
23
|
@hideFields() # Hidden by default.
|
24
24
|
@setTimestamp()
|
25
25
|
@notify()
|
26
|
-
|
26
|
+
|
27
27
|
# Event for when the timestamp field is changed
|
28
28
|
@datetimeField.on
|
29
|
-
update: (event) =>
|
29
|
+
update: (event) =>
|
30
30
|
@setTimestamp()
|
31
31
|
@notify()
|
32
32
|
|
@@ -39,22 +39,22 @@ class outpost.ContentAlarm extends outpost.PublishingHelper
|
|
39
39
|
|
40
40
|
notify: ->
|
41
41
|
@clearAlerts()
|
42
|
-
|
42
|
+
|
43
43
|
timestampFilled = !_.isEmpty(@timestamp)
|
44
44
|
isPending = @isPending()
|
45
45
|
isPublished = @isPublished()
|
46
|
-
|
46
|
+
|
47
47
|
# Show the fields if it's pending.
|
48
48
|
if isPending then @showFields() else @hideFields()
|
49
|
-
|
49
|
+
|
50
50
|
# When it IS scheduled
|
51
51
|
if isPending and timestampFilled
|
52
52
|
return @alert 'isScheduled'
|
53
|
-
|
53
|
+
|
54
54
|
# When it ISN'T scheduled
|
55
55
|
if isPending and !timestampFilled
|
56
56
|
return @alert 'isNotScheduled'
|
57
|
-
|
57
|
+
|
58
58
|
# This one assumes that the PublishingUI script
|
59
59
|
# will let the user know about Publishing Immediately.
|
60
60
|
if !isPending and !isPublished and timestampFilled
|
@@ -9,13 +9,13 @@
|
|
9
9
|
class outpost.Publishing extends outpost.PublishingHelper
|
10
10
|
constructor: (@options={}) ->
|
11
11
|
super
|
12
|
-
|
12
|
+
|
13
13
|
# Alerts
|
14
14
|
@alerts =
|
15
15
|
willPublish: new outpost.Notification(@notifications, "warning", "This content <strong>will be published</strong> immediately.")
|
16
16
|
isPublished: new outpost.Notification(@notifications, "success", "This content is <strong>published</strong>")
|
17
17
|
willUnpublish: new outpost.Notification(@notifications, "danger", "<strong>Warning!</strong> This content <strong>will be unpublished</strong> immediately.")
|
18
|
-
|
18
|
+
|
19
19
|
# Notify the scheduled status
|
20
20
|
@originalStatus = @setStatus() # also sets @status
|
21
21
|
@hideFields() # Hidden by default.
|
@@ -25,25 +25,25 @@ class outpost.Publishing extends outpost.PublishingHelper
|
|
25
25
|
|
26
26
|
notify: ->
|
27
27
|
@clearAlerts()
|
28
|
-
|
28
|
+
|
29
29
|
# No need to run these methods more than once
|
30
30
|
isPublished = @isPublished()
|
31
31
|
wasPublished = @wasPublished()
|
32
|
-
|
32
|
+
|
33
33
|
# Show the fields if it's published.
|
34
34
|
@showFields() if isPublished
|
35
|
-
|
35
|
+
|
36
36
|
# All the different scenarios
|
37
37
|
# Already published
|
38
38
|
if isPublished and wasPublished
|
39
39
|
@showFields()
|
40
40
|
return @alert 'isPublished'
|
41
|
-
|
41
|
+
|
42
42
|
# Publishing
|
43
43
|
if isPublished and !wasPublished
|
44
44
|
@hideFields()
|
45
45
|
return @alert 'willPublish'
|
46
|
-
|
46
|
+
|
47
47
|
# Unpublishing
|
48
48
|
if !isPublished and wasPublished
|
49
49
|
@hideFields()
|
@@ -7,7 +7,7 @@ class outpost.PublishingHelper
|
|
7
7
|
defaults:
|
8
8
|
statusPending: "3"
|
9
9
|
statusPublished: "5"
|
10
|
-
|
10
|
+
|
11
11
|
constructor: (@options={}) ->
|
12
12
|
_.defaults @options, @defaults
|
13
13
|
|
@@ -25,26 +25,26 @@ class outpost.PublishingHelper
|
|
25
25
|
change: (event) =>
|
26
26
|
@setStatus()
|
27
27
|
@notify()
|
28
|
-
|
28
|
+
|
29
29
|
#----------
|
30
30
|
# Get the current status from the dropdown
|
31
31
|
setStatus: ->
|
32
32
|
@status = $("option:selected", @statusField).val()
|
33
|
-
|
33
|
+
|
34
34
|
#----------
|
35
35
|
# Helpers for finding current and original status
|
36
36
|
isPending: ->
|
37
37
|
@status is @statusPending
|
38
|
-
|
38
|
+
|
39
39
|
isPublished: ->
|
40
40
|
@status is @statusPublished
|
41
|
-
|
41
|
+
|
42
42
|
wasPending: ->
|
43
43
|
@originalStatus is @statusPending
|
44
|
-
|
44
|
+
|
45
45
|
wasPublished: ->
|
46
46
|
@originalStatus is @statusPublished
|
47
|
-
|
47
|
+
|
48
48
|
#----------
|
49
49
|
# Handles scenarios
|
50
50
|
notify: ->
|
@@ -54,14 +54,14 @@ class outpost.PublishingHelper
|
|
54
54
|
# Render the notification
|
55
55
|
alert: (key) ->
|
56
56
|
@alerts[key].render()
|
57
|
-
|
57
|
+
|
58
58
|
#----------
|
59
59
|
# Mass-Detach all of the alerts
|
60
60
|
clearAlerts: ->
|
61
61
|
alert.detach() for name,alert of @alerts
|
62
62
|
|
63
63
|
#----------
|
64
|
-
|
64
|
+
|
65
65
|
showFields: ->
|
66
66
|
@container.show()
|
67
67
|
|
data/outpost-publishing.gemspec
CHANGED
@@ -17,8 +17,4 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "rspec-rails"
|
24
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outpost-publishing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,56 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '1.3'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.3'
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rake
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ! '>='
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: rspec-rails
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
12
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
62
14
|
description: Enhanced content publishing for Outpost.
|
63
15
|
email:
|
64
16
|
- bricker88@gmail.com
|
@@ -67,6 +19,7 @@ extensions: []
|
|
67
19
|
extra_rdoc_files: []
|
68
20
|
files:
|
69
21
|
- .gitignore
|
22
|
+
- CHANGELOG.md
|
70
23
|
- Gemfile
|
71
24
|
- MIT-LICENSE
|
72
25
|
- README.md
|
@@ -98,9 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
51
|
version: '0'
|
99
52
|
requirements: []
|
100
53
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.8.
|
54
|
+
rubygems_version: 1.8.11
|
102
55
|
signing_key:
|
103
56
|
specification_version: 3
|
104
57
|
summary: Outpost plugin for publishing helper UI.
|
105
58
|
test_files: []
|
106
|
-
has_rdoc:
|