jekyll-attendease 0.6.35 → 0.6.36

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
- SHA1:
3
- metadata.gz: 6834d5e7fc8f967800886cd50777404496db56ac
4
- data.tar.gz: 10c4bffd6d79a7676bd841c9f98fcad866df5f06
2
+ SHA256:
3
+ metadata.gz: 91f26e90c3718351baba3daf388a84933d521404a7696fdad1f4282b28af3f0a
4
+ data.tar.gz: 346e48fdbae2dbf2da200949d89d443c641878180c3d3028e27e102fd0826eb5
5
5
  SHA512:
6
- metadata.gz: 99f958de8eebfc428d04e61acddf6bb45041222ca1fb6d26a0a596f827739ac4ebfe4125510d998fa189636d78d8910467a68e25645192dfd4e21e4cda583b41
7
- data.tar.gz: 55b9177d22c4aa8bf01be24fbc27bcdf6a18f851469ea4464f1e1f279f01494aae200df514d2ebdc3e64c5f2d495dc6e1a650a032fbb489c91f51a094e03f91a
6
+ metadata.gz: add92b15d90cf2bd82612410f13af598d96981889c9129c11eb09e5c4ae7e8e7ca78bedde369fd1fcc7e7c8a36603f2edabeabc12a7413e1680604001f76bd7e
7
+ data.tar.gz: 416469c348ba3c9ea0fb02aba0cb86b62011cfe1e00a6b8b622cbb6bc7dfd4630f658c2129f6dee0b8b7cd00384b1845ba714b59c1aa54d21aa53f9c6b3bc115
@@ -151,7 +151,31 @@ module Jekyll
151
151
 
152
152
  def render(context)
153
153
  config = context.registers[:site].config['attendease']
154
- #data = context.registers[:site].data
154
+ site_settings = context.registers[:site].data['site_settings']
155
+ parent_pages_are_clickable = config['parent_pages_are_clickable']
156
+
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
162
+
163
+ page_keys = %w[id name href weight active root children parent]
164
+
165
+ pages = context.registers[:site].data[page_data_source]
166
+ .reject { |p| p['hidden'] }
167
+ .map do |page|
168
+ page = page.select { |key| page_keys.include?(key) }
169
+
170
+ page['children'] = page['children']
171
+ .reject { |p| p['hidden'] }
172
+ .map { |child| child.select { |key| page_keys.include?(key) } }
173
+ .sort_by { |p| p['weight'] }
174
+
175
+ page
176
+ end
177
+ .sort_by { |p| p['weight'] }
178
+
155
179
  env = config['environment']
156
180
 
157
181
  if config['mode'] == 'organization'
@@ -165,7 +189,9 @@ module Jekyll
165
189
  privateSite: #{ config['private_site'] },
166
190
  authApiEndpoint: "#{ config['auth_host'] }api",
167
191
  orgLocales: #{ config['available_portal_locales'] },
168
- features: #{ config['features'].to_json }
192
+ features: #{ config['features'].to_json },
193
+ pages: #{ pages.to_json },
194
+ settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} }
169
195
  }
170
196
  })(window)
171
197
  </script>
@@ -183,7 +209,9 @@ _EOT
183
209
  orgId: "#{ config['organization_id'] }",
184
210
  privateSite: #{ config['private_site'] },
185
211
  authApiEndpoint: "#{ config['auth_host'] }api",
186
- features: #{ config['features'].to_json }
212
+ features: #{ config['features'].to_json },
213
+ pages: #{ pages.to_json },
214
+ settings: { parentPagesAreClickable: #{!!parent_pages_are_clickable} }
187
215
  }
188
216
  })(window)
189
217
  </script>
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- VERSION = '0.6.35'
3
+ VERSION = '0.6.36'
4
4
  end
5
5
  end
@@ -41,7 +41,7 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
41
41
 
42
42
  it 'populates a site wide pages array' do
43
43
  expect(site.data['pages'].class).to eq(Array)
44
- expect(site.data['pages'].length).to eq(6)
44
+ expect(site.data['pages'].length).to eq(7)
45
45
  end
46
46
 
47
47
  it 'populates a site wide event object' do
@@ -59,7 +59,7 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
59
59
 
60
60
  it 'populates a site wide pages array' do
61
61
  expect(site.data['pages'].class).to eq(Array)
62
- expect(site.data['pages'].length).to eq(6)
62
+ expect(site.data['pages'].length).to eq(7)
63
63
  end
64
64
 
65
65
  it 'populates a site wide event object' do
@@ -6,7 +6,7 @@ RSpec.describe Jekyll::AttendeasePlugin::OrganizationDataGenerator do
6
6
 
7
7
  it 'populates a site wide pages array' do
8
8
  expect(site.data['pages'].class).to eq(Array)
9
- expect(site.data['pages'].length).to eq(6)
9
+ expect(site.data['pages'].length).to eq(7)
10
10
  end
11
11
 
12
12
  it 'populates a site wide settings object' do
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.35
4
+ version: 0.6.36
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: 2017-10-27 00:00:00.000000000 Z
14
+ date: 2018-07-16 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.2.5
241
+ rubygems_version: 2.7.7
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Attendease event helper for Jekyll