jekyll-attendease 0.6.26b → 0.6.26c

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
2
  SHA1:
3
- metadata.gz: 8a31c582c795e694e2f0e28b41df5da7e140fcd5
4
- data.tar.gz: 9b0b6fff4047eaf3b3f46ea1bef450ad503c49fe
3
+ metadata.gz: 2bfbbef619b2af7fdb902279cda93fff38a0fb48
4
+ data.tar.gz: 08ad5ab294e3c9dec9ea68a449f4418634056724
5
5
  SHA512:
6
- metadata.gz: 2212ef903ef0bf54cbc02f8cba2b6c764847bafb64f798bd721844b41e36b7ca2c1f269e62626feabe1cb73031eb3a6d59601f89b6981af4dfd579e0a94a54bb
7
- data.tar.gz: 387909db6325a33134f76b891a94e9dc0dbb2f33fb1ad418c903ff6b2d8508e40c7794844c3df917d5f688bf252bc01e5239fbc5090059536e54824fe77f780d
6
+ metadata.gz: 853ea57545323172b35feb61cdad2a848f223879b59d969b5257dcc060a9e666d9a48b140b74fb4ab45ca8e079ca550516aa9eb8759734e81cc3785be873daca
7
+ data.tar.gz: 2950c22214bfb22b39966c188ab6ee49468aad11f3b65597ea4c6ca2cdd4c5910938bfe8692be84ad28874f4a5a240d38d093d00d0d31a8351b5471e09aad1cc
@@ -14,5 +14,6 @@ Liquid::Template.register_tag('attendease_auth_account', Jekyll::AttendeaseP
14
14
  Liquid::Template.register_tag('attendease_auth_action', Jekyll::AttendeasePlugin::AuthActionTag)
15
15
  Liquid::Template.register_tag('attendease_t', Jekyll::AttendeasePlugin::TranslateTag)
16
16
  Liquid::Template.register_tag('attendease_nav', Jekyll::AttendeasePlugin::NavigationTag)
17
+ Liquid::Template.register_tag('attendease_portal_nav', Jekyll::AttendeasePlugin::PortalNavigationTag)
17
18
 
18
19
  Liquid::Template.register_filter(Jekyll::AttendeasePlugin::Filters)
@@ -36,7 +36,7 @@ module Jekyll
36
36
  FileUtils.mkdir_p(@attendease_data_path)
37
37
 
38
38
  if site.config.cms_theme?
39
- data_files = %w{ site event pages site_settings }.map { |m| "#{m}.json"} << 'lingo.yml'
39
+ data_files = %w{ site event pages portal_pages site_settings }.map { |m| "#{m}.json"} << 'lingo.yml'
40
40
  else
41
41
  data_files = %w{ site event sessions presenters rooms filters venues sponsors pages site_settings }.map { |m| "#{m}.json"} << 'lingo.yml'
42
42
  end
@@ -83,6 +83,42 @@ module Jekyll
83
83
  end
84
84
 
85
85
  #require 'pry'
86
+ class PortalNavigationTag < Liquid::Block
87
+ def initialize(tag_name, params, tokens)
88
+ super
89
+ @options = {}
90
+ params.split(/\s/).each do |keypair|
91
+ opt = keypair.split('=')
92
+ @options[opt[0]] = opt[1] if opt.length == 2
93
+ end
94
+ end
95
+
96
+ def render(context)
97
+ portal_pages = context.registers[:site].data['porta_pages']
98
+
99
+ config = context.registers[:site].config['attendease']
100
+
101
+ nav = []
102
+ if portal_pages.is_a?(Array)
103
+ portal_pages.sort! { |a, b| a['weight'] <=> b['weight'] }
104
+ key_mapping = { 'schedule' => 'sessions' }
105
+ portal_pages.select { |p| p['top_level'] }.each do |page|
106
+ if page['active'] && !page['hidden']
107
+ # only activate nav links if there is content
108
+ config_key = "has_#{key_mapping[page['page_key']] || page['page_key']}"
109
+ if config[config_key].nil? || (!config[config_key].nil? && config[config_key] == true)
110
+ template = Liquid::Template.parse(super)
111
+ template.assigns['page'] = page
112
+ nav << template.render
113
+ end
114
+ end
115
+ end
116
+ nav.join("\n")
117
+ else
118
+ ''
119
+ end
120
+ end
121
+ end
86
122
 
87
123
  class NavigationTag < Liquid::Block
88
124
  def initialize(tag_name, params, tokens)
@@ -122,4 +158,3 @@ module Jekyll
122
158
  end
123
159
  end
124
160
  end
125
-
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AttendeasePlugin
3
- VERSION = '0.6.26b'
3
+ VERSION = '0.6.26c'
4
4
  end
5
5
  end
@@ -44,6 +44,11 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
44
44
  expect(site.data['pages'].length).to eq(10)
45
45
  end
46
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)
50
+ end
51
+
47
52
  it 'populates a site wide event object' do
48
53
  expect(site.data['event'].class).to eq(Hash)
49
54
  end
@@ -78,4 +83,3 @@ RSpec.describe Jekyll::AttendeasePlugin::EventDataGenerator do
78
83
  end
79
84
 
80
85
  end
81
-
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.26b
4
+ version: 0.6.26c
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Wood
@@ -183,7 +183,6 @@ 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
187
186
  - lib/jekyll/attendease_plugin/site_pages_generator.rb
188
187
  - lib/jekyll/attendease_plugin/sponsor_generator.rb
189
188
  - lib/jekyll/attendease_plugin/sponsors_index_page.rb
@@ -239,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
238
  version: 1.3.1
240
239
  requirements: []
241
240
  rubyforge_project:
242
- rubygems_version: 2.2.5
241
+ rubygems_version: 2.6.11
243
242
  signing_key:
244
243
  specification_version: 4
245
244
  summary: Attendease event helper for Jekyll
@@ -1,42 +0,0 @@
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
-