jekyll-attendease 0.6.37 → 0.6.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: adfee171d0c1f66d494c12a096c87bd2b64032fa689a95dff42405e4faefd627
4
- data.tar.gz: 4763d446b8e8fa7677a2250793986fd2433b7a47b9a5d631456425594aeb0e4b
2
+ SHA1:
3
+ metadata.gz: f595d607f6427a967ba807233e0f6b1e1d55a510
4
+ data.tar.gz: 57ec4f0a60928244e36ab44403a9434f5c785a52
5
5
  SHA512:
6
- metadata.gz: f12ada600304e8eade0fdabd9bdc030965e37662aab91b0654a88b1329aa7a494087c026535e557a132840e14c828174942c889350f7de7e849df598b5023038
7
- data.tar.gz: e5efd65aab925c61dceac9688004fd8d13670c59d686b938328da44e66a252595239d0e478be452ee21334245d17b7fb43d345b49cd0461b76ddaa644e312cb3
6
+ metadata.gz: d46fac7405d254dbbab9b5211b9a1502aebc012aa57266390a043effe6a3f892feb7390c427986bbce972690762ba78e7efeebfe0b70836e3d6df4c5a18b0ca1
7
+ data.tar.gz: 5bdcf31ac6b82a30c14768802cad1907efa8b876ccfad18538bd1bf8418fad02979cb813ab9ebbc0bc772ad6ef213cd37e309c8f95af89839526d9f5cfc9a791
@@ -151,18 +151,19 @@ module Jekyll
151
151
 
152
152
  def render(context)
153
153
  config = context.registers[:site].config['attendease']
154
- site_settings = context.registers[:site].data['site_settings']
155
- parent_pages_are_clickable = config['parent_pages_are_clickable']
154
+ siteSettings = context.registers[:site].data['site_settings'].delete_if {|key, value| ['analytics', 'meta'].include? key }
156
155
 
157
- page_data_source = if site_settings['advanced'] && site_settings['advanced']['portal_pages_in_the_event_website']
158
- 'portal_pages'
159
- else
160
- 'pages'
161
- end
156
+ organizationSiteSettings = {}
157
+ if context.registers[:site].data['organization_site_settings']
158
+ organizationSiteSettings = context.registers[:site].data['organization_site_settings'].delete_if {|key, value| ['analytics', 'meta'].include? key }
159
+ end
160
+
161
+ parent_pages_are_clickable = config['parent_pages_are_clickable']
162
162
 
163
163
  page_keys = %w[id name href weight active root children parent]
164
164
 
165
- pages = context.registers[:site].data[page_data_source]
165
+ pages = {}
166
+ pages = context.registers[:site].data['pages']
166
167
  .select { |p| p['root'] }
167
168
  .reject { |p| p['hidden'] }
168
169
  .map do |page|
@@ -177,6 +178,25 @@ module Jekyll
177
178
  end
178
179
  .sort_by { |p| p['weight'] }
179
180
 
181
+ portal_pages = {}
182
+ if (context.registers[:site].data['portal_pages'])
183
+ portal_pages = context.registers[:site].data['portal_pages']
184
+ .select { |p| p['root'] }
185
+ .reject { |p| p['hidden'] }
186
+ .map do |page|
187
+ page = page.select { |key| page_keys.include?(key) }
188
+
189
+ page['children'] = page['children']
190
+ .reject { |p| p['hidden'] }
191
+ .map { |child| child.select { |key| page_keys.include?(key) } }
192
+ .sort_by { |p| p['weight'] }
193
+
194
+ page
195
+ end
196
+ .sort_by { |p| p['weight'] }
197
+ end
198
+
199
+
180
200
  env = config['environment']
181
201
 
182
202
  if config['mode'] == 'organization'
@@ -185,14 +205,15 @@ module Jekyll
185
205
  (function(w) {
186
206
  w.AttendeaseConstants = {
187
207
  locale: "en",
188
- orgApiEndpoint: "#{ config['api_host'] }api",
208
+ orgURL: "#{ config['api_host'] }",
189
209
  orgId: "#{ config['source_id'] }",
190
210
  privateSite: #{ config['private_site'] },
191
211
  authApiEndpoint: "#{ config['auth_host'] }api",
192
212
  orgLocales: #{ config['available_portal_locales'] },
193
213
  features: #{ config['features'].to_json },
194
214
  pages: #{ pages.to_json },
195
- settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} }
215
+ settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} },
216
+ siteSettings: #{ siteSettings.to_json }
196
217
  }
197
218
  })(window)
198
219
  </script>
@@ -206,13 +227,16 @@ _EOT
206
227
  locale: "#{ config['locale'] }",
207
228
  eventApiEndpoint: "#{ config['api_host'] }api",
208
229
  eventId: "#{ config['source_id'] }",
209
- orgApiEndpoint: "#{ config['organization_url'] }api",
230
+ orgURL: "#{ config['organization_url'] }",
210
231
  orgId: "#{ config['organization_id'] }",
211
232
  privateSite: #{ config['private_site'] },
212
233
  authApiEndpoint: "#{ config['auth_host'] }api",
213
234
  features: #{ config['features'].to_json },
214
235
  pages: #{ pages.to_json },
215
- settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} }
236
+ portalPages: #{ portal_pages.to_json },
237
+ settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} },
238
+ siteSettings: #{ siteSettings.to_json },
239
+ organizationSiteSettings: #{ organizationSiteSettings.to_json }
216
240
  }
217
241
  })(window)
218
242
  </script>
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- VERSION = '0.6.37'
3
+ VERSION = '0.6.38'
4
4
  end
5
5
  end
@@ -87,7 +87,7 @@ RSpec.describe "Jekyll Attendease tags" do
87
87
  it { is_expected.to match(/locale: "en"/) }
88
88
  it { is_expected.to match(/eventApiEndpoint: "https:\/\/foobar\/api"/) }
89
89
  it { is_expected.to match(/eventId: "foobar"/) }
90
- it { is_expected.to match(/orgApiEndpoint: "https:\/\/foobar\.org\/api"/) }
90
+ it { is_expected.to match(/orgURL: "https:\/\/foobar.org\/"/) }
91
91
  it { is_expected.to match(/orgId: "batbaz"/) }
92
92
  it { is_expected.to match(/authApiEndpoint: "https:\/\/foobar.auth\/api"/) }
93
93
  it { is_expected.to match(/dashboard.attendease.com\/webpack_assets\/blockrenderer.bundle.js/) }
@@ -104,7 +104,7 @@ RSpec.describe "Jekyll Attendease tags" do
104
104
  subject { org_render("{% attendease_block_renderer %}") }
105
105
 
106
106
  it { is_expected.to match(/locale: "en"/) }
107
- it { is_expected.to match(/orgApiEndpoint: "https:\/\/foobar\/api"/) }
107
+ it { is_expected.to match(/orgURL: "https:\/\/foobar\/"/) }
108
108
  it { is_expected.to match(/orgId: "foobar"/) }
109
109
  it { is_expected.to match(/authApiEndpoint: "https:\/\/foobar.auth\/api"/) }
110
110
  it { is_expected.to match(/dashboard.attendease.com\/webpack_assets\/blockrenderer.bundle.js/) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-attendease
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.37
4
+ version: 0.6.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wood
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-07-16 00:00:00.000000000 Z
14
+ date: 2018-09-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: httparty
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.7.7
241
+ rubygems_version: 2.2.5
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Attendease event helper for Jekyll