jekyll-action-network 0.5.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/action-network/action.rb +13 -1
- data/lib/jekyll/action-network/collection.rb +4 -4
- data/lib/jekyll/action-network/generator.rb +1 -0
- data/lib/jekyll/action-network/settings.yaml +48 -36
- data/lib/jekyll/action-network/utils.rb +2 -0
- data/lib/jekyll/action-network/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34887e85b8ecb2273d1b7ee047e55872d19270ad23d9eb5d00a1edb354e8dc27
|
4
|
+
data.tar.gz: 5107ff03442f0ef0cd957153c4358b95bc920ea6a00b692af7d4e7b477609ec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c837f993a137e4b7989c1c564e068e8e3fef8e03b5d953d52db9c4f655a19f8bbe63e94dad14c1fa4f4179e4f39cb97eafb316765eb686cc8dc73b8572c7d39
|
7
|
+
data.tar.gz: 37b7d9a4f4f87d4f8e751d0b85346ab01693be0e03020376c723615d03a4650c75c53e05a433e46b2400459f791ebf6b61ef815bfb3f31cbb4e5ffcfb1acb0bd
|
@@ -6,12 +6,13 @@ module Jekyll
|
|
6
6
|
# An action network action, call the +doc+ method to get a
|
7
7
|
# Jekyll::Document for this action
|
8
8
|
class Action
|
9
|
-
def initialize(site, name, collection, config, action)
|
9
|
+
def initialize(site, name, collection, config, action, settings)
|
10
10
|
@site = site
|
11
11
|
@collection = collection
|
12
12
|
@config = config
|
13
13
|
@action = action
|
14
14
|
@name = name
|
15
|
+
@settings = settings
|
15
16
|
@utils = Jekyll::ActionNetwork::Utils.new
|
16
17
|
end
|
17
18
|
|
@@ -43,9 +44,20 @@ module Jekyll
|
|
43
44
|
@front_matter["slug"] = slug
|
44
45
|
@front_matter["embed_code"] = @utils.make_embed_code(@action["browser_url"])
|
45
46
|
@front_matter["action_type"] = @name
|
47
|
+
@front_matter["action_network_endpoint"] = endpoint
|
48
|
+
@front_matter["action_network_blindpost"] = blindpost
|
46
49
|
@front_matter
|
47
50
|
end
|
48
51
|
|
52
|
+
def endpoint
|
53
|
+
@action['_links']['self']['href']
|
54
|
+
end
|
55
|
+
|
56
|
+
def blindpost
|
57
|
+
linked_type = @settings['endpoint_mappings'][@name]
|
58
|
+
return @action['_links']["osdi:#{linked_type}"]['href'] if linked_type
|
59
|
+
end
|
60
|
+
|
49
61
|
def content
|
50
62
|
@content ||= @action[@config["content"]]
|
51
63
|
end
|
@@ -33,7 +33,7 @@ module Jekyll
|
|
33
33
|
def documents
|
34
34
|
documents = []
|
35
35
|
filtered_actions.each do |action_data|
|
36
|
-
action = Jekyll::ActionNetwork::Action.new(@site, @name, collection, config, action_data)
|
36
|
+
action = Jekyll::ActionNetwork::Action.new(@site, @name, collection, config, action_data, @settings)
|
37
37
|
documents << action.doc
|
38
38
|
end
|
39
39
|
documents
|
@@ -47,17 +47,17 @@ module Jekyll
|
|
47
47
|
def actions
|
48
48
|
return @actions if @actions
|
49
49
|
|
50
|
-
@actions = @
|
50
|
+
@actions = @client.send(@name).all
|
51
51
|
@actions.concat(all_ec_events) if @name == "events" && config["include_event_campaigns"]
|
52
52
|
@actions.uniq(&:action_network_id)
|
53
53
|
end
|
54
54
|
|
55
55
|
def all_ec_events
|
56
|
-
event_campaigns = @
|
56
|
+
event_campaigns = @client.event_campaigns.all
|
57
57
|
events = []
|
58
58
|
event_campaigns.each do |event_campaign|
|
59
59
|
ec_client = @client.event_campaigns(event_campaign.action_network_id)
|
60
|
-
events.concat(
|
60
|
+
events.concat(ec_client.events.all)
|
61
61
|
end
|
62
62
|
events
|
63
63
|
end
|
@@ -24,6 +24,7 @@ fields:
|
|
24
24
|
- call_to_action
|
25
25
|
- "action_network:event_campaign_id"
|
26
26
|
- type
|
27
|
+
- created_date
|
27
28
|
embed:
|
28
29
|
resources:
|
29
30
|
forms: form
|
@@ -37,6 +38,11 @@ embed:
|
|
37
38
|
layout_only: <link href='https://actionnetwork.org/css/style-embed-whitelabel-v3.css' rel='stylesheet' type='text/css' />
|
38
39
|
actions:
|
39
40
|
collection: actions
|
41
|
+
endpoint_mappings:
|
42
|
+
forms: submissions
|
43
|
+
events: attendances
|
44
|
+
petitions: signatures
|
45
|
+
advocacy_campaigns: outreaches
|
40
46
|
key: ENV_ACTION_NETWORK_API_KEY
|
41
47
|
defaults:
|
42
48
|
petitions:
|
@@ -49,8 +55,9 @@ defaults:
|
|
49
55
|
petition_text: petition_text
|
50
56
|
browser_url: browser_url
|
51
57
|
featured_image_url: image
|
52
|
-
target:
|
58
|
+
target: petition_target
|
53
59
|
"action_network:sponsor": sponsor
|
60
|
+
created_date: date
|
54
61
|
events:
|
55
62
|
collection: events
|
56
63
|
layout: an-event
|
@@ -69,6 +76,7 @@ defaults:
|
|
69
76
|
visibility: visibility
|
70
77
|
capacity: capacity
|
71
78
|
"action_network:sponsor": sponsor
|
79
|
+
created_date: date
|
72
80
|
event_campaigns:
|
73
81
|
collection: event_campaigns
|
74
82
|
layout: an-event_campaign
|
@@ -82,38 +90,42 @@ defaults:
|
|
82
90
|
total_events: total_events
|
83
91
|
total_rsvps: total_rsvps
|
84
92
|
"action_network:sponsor": sponsor
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
93
|
+
created_date: date
|
94
|
+
advocacy_campaigns:
|
95
|
+
collection: advocacy_campaigns
|
96
|
+
layout: an-advocacy_campaign
|
97
|
+
content: description
|
98
|
+
mappings:
|
99
|
+
title: title
|
100
|
+
description: description
|
101
|
+
type: categories
|
102
|
+
browser_url: browser_url
|
103
|
+
featured_image_url: image
|
104
|
+
"action_network:sponsor": sponsor
|
105
|
+
targets: targets
|
106
|
+
total_outreaches: total_outreaches
|
107
|
+
created_date: date
|
108
|
+
forms:
|
109
|
+
collection: forms
|
110
|
+
layout: an-form
|
111
|
+
content: description
|
112
|
+
mappings:
|
113
|
+
title: title
|
114
|
+
description: description
|
115
|
+
call_to_action: call_to_action
|
116
|
+
browser_url: browser_url
|
117
|
+
featured_image_url: image
|
118
|
+
"action_network:sponsor": sponsor
|
119
|
+
created_date: date
|
120
|
+
campaigns:
|
121
|
+
collection: campaigns
|
122
|
+
layout: an-campaign
|
123
|
+
content: description
|
124
|
+
mappings:
|
125
|
+
title: title
|
126
|
+
description: description
|
127
|
+
browser_url: browser_url
|
128
|
+
featured_image_url: image
|
129
|
+
actions: actions
|
130
|
+
"action_network:sponsor": sponsor
|
131
|
+
created_date: date
|
@@ -18,6 +18,8 @@ module Jekyll
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def make_embed_code(browser_url, style = nil)
|
21
|
+
return unless browser_url
|
22
|
+
|
21
23
|
relative_url = browser_url.split("://")[1].sub("actionnetwork.org/", "")
|
22
24
|
split_url = relative_url.split("/")
|
23
25
|
css = settings["embed"]["styles"][style] if style
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-action-network
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Irving
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: action_network_rest
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.11.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.11.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dotenv
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|