jekyll-attendease 0.6.26c → 0.6.26d
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/attendease_plugin/site_page_blocks_json.rb +42 -0
- data/lib/jekyll/attendease_plugin/tags.rb +7 -21
- data/lib/jekyll/attendease_plugin/version.rb +1 -1
- data/spec/lib/jekyll/attendease_plugin/event_data_generator_spec.rb +7 -7
- data/spec/lib/jekyll/attendease_plugin/organization_data_generator_spec.rb +1 -1
- data/spec/lib/jekyll/attendease_plugin/tags_spec.rb +15 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ebb4b439693d912cd035a3f10d35eba99fb3f7a
|
4
|
+
data.tar.gz: 78bfc9b241f534fd33d79945bcca288568947a34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18ce2aa1b17a3bc4c9adb6ed8067d2ec638d977ec1ad3075d9497b6c1213a3e20dd650297a226886518d78e829cf31e792574e4fb840164a3201b98020c84c98
|
7
|
+
data.tar.gz: 78d7151f7312771cc50e20974bbb4f69308e04750f8b283d33ab3853722f761f4e03c26687e65f73f62249584400465ee178986db4cbc85a41992d50c89c6b18
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Jekyll
|
2
|
+
module AttendeasePlugin
|
3
|
+
class SitePageBlocksJson < StaticFile
|
4
|
+
def initialize(site, base, page)
|
5
|
+
@site = site
|
6
|
+
@base = base
|
7
|
+
@dir = page['slug']
|
8
|
+
@name = 'index.json'
|
9
|
+
|
10
|
+
self.process(@name)
|
11
|
+
|
12
|
+
#require 'pry'
|
13
|
+
#binding.pry
|
14
|
+
#self.read_yaml(File.join(base, '_attendease', 'templates', 'pages'), 'default.html')
|
15
|
+
self.read_yaml(File.join(base, '_layouts'), "#{page['layout']}.html")
|
16
|
+
|
17
|
+
self.data['title'] = page['title']
|
18
|
+
self.data['layout'] = page['layout']
|
19
|
+
|
20
|
+
zones = {}
|
21
|
+
|
22
|
+
# create zone buckets
|
23
|
+
page['block_instances'].each do |i|
|
24
|
+
zones[i['zone']] = [] if zones[i['zone']].nil?
|
25
|
+
zones[i['zone']] << i
|
26
|
+
end
|
27
|
+
|
28
|
+
# sort each bucket by widget weight
|
29
|
+
zones.each do |k, zone|
|
30
|
+
zone.sort! { |x, y| x['weight'] <=> y['weight'] }
|
31
|
+
self.data[k] = ''
|
32
|
+
zone.each do |i|
|
33
|
+
self.data[k] << i['rendered_html']
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
self.data['site_page'] = page
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
@@ -94,23 +94,16 @@ module Jekyll
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def render(context)
|
97
|
-
portal_pages = context.registers[:site].data['
|
98
|
-
|
99
|
-
config = context.registers[:site].config['attendease']
|
97
|
+
portal_pages = context.registers[:site].data['portal_pages']
|
100
98
|
|
101
99
|
nav = []
|
102
100
|
if portal_pages.is_a?(Array)
|
103
101
|
portal_pages.sort! { |a, b| a['weight'] <=> b['weight'] }
|
104
|
-
key_mapping = { 'schedule' => 'sessions' }
|
105
102
|
portal_pages.select { |p| p['top_level'] }.each do |page|
|
106
103
|
if page['active'] && !page['hidden']
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
template = Liquid::Template.parse(super)
|
111
|
-
template.assigns['page'] = page
|
112
|
-
nav << template.render
|
113
|
-
end
|
104
|
+
template = Liquid::Template.parse(super)
|
105
|
+
template.assigns['page'] = page
|
106
|
+
nav << template.render
|
114
107
|
end
|
115
108
|
end
|
116
109
|
nav.join("\n")
|
@@ -133,21 +126,14 @@ module Jekyll
|
|
133
126
|
def render(context)
|
134
127
|
pages = context.registers[:site].data['pages']
|
135
128
|
|
136
|
-
config = context.registers[:site].config['attendease']
|
137
|
-
|
138
129
|
nav = []
|
139
130
|
if pages.is_a?(Array)
|
140
131
|
pages.sort! { |a, b| a['weight'] <=> b['weight'] }
|
141
|
-
key_mapping = { 'schedule' => 'sessions' }
|
142
132
|
pages.select { |p| p['top_level'] }.each do |page|
|
143
133
|
if page['active'] && !page['hidden']
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
template = Liquid::Template.parse(super)
|
148
|
-
template.assigns['page'] = page
|
149
|
-
nav << template.render
|
150
|
-
end
|
134
|
+
template = Liquid::Template.parse(super)
|
135
|
+
template.assigns['page'] = page
|
136
|
+
nav << template.render
|
151
137
|
end
|
152
138
|
end
|
153
139
|
nav.join("\n")
|
@@ -41,12 +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(
|
45
|
-
end
|
46
|
-
|
47
|
-
it 'populates a site wide portal pages array' do
|
48
|
-
expect(site.data['portal_pages'].class).to eq(Array)
|
49
|
-
expect(site.data['portal_pages'].length).to eq(6)
|
44
|
+
expect(site.data['pages'].length).to eq(5)
|
50
45
|
end
|
51
46
|
|
52
47
|
it 'populates a site wide event object' do
|
@@ -64,7 +59,7 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
|
|
64
59
|
|
65
60
|
it 'populates a site wide pages array' do
|
66
61
|
expect(site.data['pages'].class).to eq(Array)
|
67
|
-
expect(site.data['pages'].length).to eq(
|
62
|
+
expect(site.data['pages'].length).to eq(5)
|
68
63
|
end
|
69
64
|
|
70
65
|
it 'populates a site wide event object' do
|
@@ -80,6 +75,11 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
|
|
80
75
|
expect(site.data['sponsors']).to be_nil
|
81
76
|
end
|
82
77
|
|
78
|
+
it 'populates a site wide portal pages array' do
|
79
|
+
expect(site.data['portal_pages'].class).to eq(Array)
|
80
|
+
expect(site.data['portal_pages'].length).to eq(2)
|
81
|
+
end
|
82
|
+
|
83
83
|
end
|
84
84
|
|
85
85
|
end
|
@@ -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(
|
9
|
+
expect(site.data['pages'].length).to eq(5)
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'populates a site wide settings object' do
|
@@ -2,12 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe "Jekyll Attendease tags" do
|
4
4
|
let(:site) { build_site }
|
5
|
+
let(:cms_site) { build_site({ 'attendease' => { 'jekyll33' => true } }) }
|
5
6
|
let(:context) { { :registers => { :site => site, :page => {} } } }
|
7
|
+
let(:cms_context) { { :registers => { :site => cms_site, :page => {} } } }
|
6
8
|
|
7
9
|
def render(content)
|
8
10
|
::Liquid::Template.parse(content).render({}, context)
|
9
11
|
end
|
10
12
|
|
13
|
+
def cms_render(content)
|
14
|
+
::Liquid::Template.parse(content).render({}, cms_context)
|
15
|
+
end
|
16
|
+
|
11
17
|
context "{% attendease_auth_script %}" do
|
12
18
|
subject { render("{% attendease_auth_script %}") }
|
13
19
|
it { is_expected.to include "assets/attendease_event/auth.js" }
|
@@ -54,12 +60,20 @@ RSpec.describe "Jekyll Attendease tags" do
|
|
54
60
|
end
|
55
61
|
|
56
62
|
context "{% attendease_nav %}" do
|
57
|
-
subject { render("{% attendease_nav %}{% raw %}<li><a href=\"
|
63
|
+
subject { render("{% attendease_nav %}{% raw %}<li><a href=\"{{ page.href }}\">{{ page.name }}</a></li>{% endraw %}{% endattendease_nav %}") }
|
58
64
|
it { is_expected.to match(/<li><a href="\/schedule\/"/) }
|
59
65
|
|
60
66
|
# hidden page
|
61
67
|
it { is_expected.to_not match(/<li><a href="\/test\/"/) }
|
62
68
|
end
|
69
|
+
|
70
|
+
context "{% attendease_portal_nav %}" do
|
71
|
+
subject { cms_render("{% attendease_portal_nav %}{% raw %}<li><a href=\"{{ page.href }}\">{{ page.name }}</a></li>{% endraw %}{% endattendease_portal_nav %}") }
|
72
|
+
it { is_expected.to match(/<li><a href="\/"/) }
|
73
|
+
|
74
|
+
# hidden page
|
75
|
+
it { is_expected.to_not match(/<li><a href="\/test\/"/) }
|
76
|
+
end
|
63
77
|
end
|
64
78
|
|
65
79
|
def schedule_widget_data
|
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.
|
4
|
+
version: 0.6.26d
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Wood
|
@@ -183,6 +183,7 @@ files:
|
|
183
183
|
- lib/jekyll/attendease_plugin/schedule_session_page.rb
|
184
184
|
- lib/jekyll/attendease_plugin/schedule_sessions_page.rb
|
185
185
|
- lib/jekyll/attendease_plugin/site_page.rb
|
186
|
+
- lib/jekyll/attendease_plugin/site_page_blocks_json.rb
|
186
187
|
- lib/jekyll/attendease_plugin/site_pages_generator.rb
|
187
188
|
- lib/jekyll/attendease_plugin/sponsor_generator.rb
|
188
189
|
- lib/jekyll/attendease_plugin/sponsors_index_page.rb
|
@@ -238,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
239
|
version: 1.3.1
|
239
240
|
requirements: []
|
240
241
|
rubyforge_project:
|
241
|
-
rubygems_version: 2.
|
242
|
+
rubygems_version: 2.4.5.2
|
242
243
|
signing_key:
|
243
244
|
specification_version: 4
|
244
245
|
summary: Attendease event helper for Jekyll
|