pageflow 13.5.0 → 13.6.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pageflow might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d65914a5c0e8255f5d2791a221435172ad9c71a413be337da5797ca121b3aa08
4
- data.tar.gz: 97c08215f8fffd43e31a7e7f2d6df5cda9235a4806aae88e1def9fc56535fdf7
3
+ metadata.gz: 9e9dac37ddc4c26d594df5452f6bcf4a972fbccdc46538e764938984d93f6792
4
+ data.tar.gz: faf7217c3dd9128b6ab5ddf303a62f3a9df0364063ef0ba2e7156390660385be
5
5
  SHA512:
6
- metadata.gz: 3925ed6f51dca3e7143deeeb1f828038d1587cc1dd8215542f3f8aef0f1a4cb9950c55ff41488b56ffd86c41de92c9f6eb147e78ebd8d5e119f65bd995b2f7a7
7
- data.tar.gz: 8039b72eed4a82ca24cf6c3789b5bcf0fbaa230c21b906a58d454a5deca8e8d15a2bc151ceb86d674c1980069fbf74269b009ef5b8bba0386571dc7c5bb9e950
6
+ metadata.gz: b8fbafc373c8c663037d5b67b27df6ad5df0586da48e286cd456c218a76f4a63a249a3097948aa27ef31aa36204b626c8a2d32633054d4692c5fd239d3458a94
7
+ data.tar.gz: c8190274933517b76c164c13fb78423341af6b37989a760a8ba466dfd183df293b11bdda3c2df117a49694637cd5843dd41a2519e2d8c42c5adbaf0bed38625f
@@ -1,18 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
- ### Version 13.5.0
3
+ ### Version 13.6.0
4
4
 
5
- 2019-03-05
5
+ 2019-03-07
6
6
 
7
- [Compare changes](https://github.com/codevise/pageflow/compare/13-4-stable...v13.5.0)
7
+ [Compare changes](https://github.com/codevise/pageflow/compare/13-5-stable...v13.6.0)
8
8
 
9
- - Improve text area link dialog
10
- ([#1130](https://github.com/codevise/pageflow/pull/1130))
11
- - Allow setting browser feature flags via query string in debug mode
12
- ([#1130](https://github.com/codevise/pageflow/pull/1130))
13
- - Fix cracking noises in audios on Safari
14
- ([#1127](https://github.com/codevise/pageflow/pull/1127))
9
+ - Add shared specs to pageflow-support to lint page types
10
+ ([#1134](https://github.com/codevise/pageflow/pull/1134))
15
11
 
16
12
  See
17
- [13-4-stable branch](https://github.com/codevise/pageflow/blob/13-4-stable/CHANGELOG.md)
13
+ [13-5-stable branch](https://github.com/codevise/pageflow/blob/13-5-stable/CHANGELOG.md)
18
14
  for previous changes.
@@ -8,6 +8,12 @@ module Pageflow
8
8
  as: :page_type)
9
9
  end
10
10
 
11
+ def page_type_json_seed(json, page_type)
12
+ if page_type.json_seed_template
13
+ json.partial!(template: page_type.json_seed_template, locals: {page_type: page_type})
14
+ end
15
+ end
16
+
11
17
  def page_type_templates(entry)
12
18
  safe_join(Pageflow.config.page_types.map do |page_type|
13
19
  content_tag(:script,
@@ -17,6 +17,4 @@ json.thumbnail_candidates(page_type.thumbnail_candidates) do |candidate|
17
17
  end
18
18
  end
19
19
 
20
- if page_type.json_seed_template
21
- json.partial!(:template => page_type.json_seed_template, :locals => {:page_type => page_type})
22
- end
20
+ page_type_json_seed(json, page_type)
@@ -1,6 +1,6 @@
1
1
  <% if page.template.present? %>
2
2
  <% concat React::ServerRendering.render(
3
3
  'pageflow.react.ServerSidePage',
4
- %Q'{ "resolverSeed": #{@_pageflow_react_entry_seed ||= entry_json_seed(@entry)}, "pageId": #{page.perma_id}, "pageType": "#{page.template}" }',
4
+ %Q'{ "resolverSeed": #{@_pageflow_react_entry_seed ||= entry_json_seed(entry)}, "pageId": #{page.perma_id}, "pageType": "#{page.template}" }',
5
5
  true) %>
6
6
  <% end %>
@@ -0,0 +1,73 @@
1
+ module Pageflow
2
+ # @api private
3
+ module BuiltInPageType
4
+ def self.plain
5
+ Pageflow::React.create_page_type('background_image',
6
+ thumbnail_candidates: default_thumbnail_candidates,
7
+ file_types: [
8
+ BuiltInFileType.image,
9
+ BuiltInFileType.video
10
+ ])
11
+ end
12
+
13
+ def self.video
14
+ Pageflow::React.create_page_type('video',
15
+ thumbnail_candidates: video_thumbnail_candidates,
16
+ file_types: [
17
+ BuiltInFileType.image,
18
+ BuiltInFileType.video
19
+ ])
20
+ end
21
+
22
+ def self.audio
23
+ Pageflow::React.create_page_type('audio',
24
+ thumbnail_candidates: default_thumbnail_candidates,
25
+ file_types: [
26
+ BuiltInFileType.audio,
27
+ BuiltInFileType.image,
28
+ BuiltInFileType.video
29
+ ])
30
+ end
31
+
32
+ def self.video_thumbnail_candidates
33
+ [
34
+ {file_collection: 'image_files', attribute: 'thumbnail_image_id'},
35
+ {file_collection: 'image_files', attribute: 'poster_image_id'},
36
+ {file_collection: 'video_files', attribute: 'video_file_id'}
37
+ ]
38
+ end
39
+
40
+ def self.default_thumbnail_candidates
41
+ [
42
+ {
43
+ file_collection: 'image_files',
44
+ attribute: 'thumbnail_image_id'
45
+ },
46
+ {
47
+ file_collection: 'image_files',
48
+ attribute: 'background_image_id',
49
+ unless: {
50
+ attribute: 'background_type',
51
+ value: 'video'
52
+ }
53
+ },
54
+ {
55
+ file_collection: 'image_files',
56
+ attribute: 'poster_image_id',
57
+ if: {
58
+ attribute: 'background_type',
59
+ value: 'video'
60
+ }
61
+ },
62
+ {
63
+ file_collection: 'video_files',
64
+ attribute: 'video_file_id',
65
+ if: {
66
+ attribute: 'background_type',
67
+ value: 'video'
68
+ }
69
+ }
70
+ ]
71
+ end
72
+ end
73
+ end
@@ -1,80 +1,9 @@
1
1
  module Pageflow
2
2
  class BuiltInPageTypesPlugin < Plugin
3
3
  def configure(config)
4
- config.page_types.register(plain_page_type)
5
- config.page_types.register(video_page_type)
6
- config.page_types.register(audio_page_type)
7
- end
8
-
9
- private
10
-
11
- def plain_page_type
12
- Pageflow::React.create_page_type('background_image',
13
- thumbnail_candidates: default_thumbnail_candidates,
14
- file_types: [
15
- BuiltInFileType.image,
16
- BuiltInFileType.video
17
- ])
18
- end
19
-
20
- def video_page_type
21
- Pageflow::React.create_page_type('video',
22
- thumbnail_candidates: video_thumbnail_candidates,
23
- file_types: [
24
- BuiltInFileType.image,
25
- BuiltInFileType.video
26
- ])
27
- end
28
-
29
- def audio_page_type
30
- Pageflow::React.create_page_type('audio',
31
- thumbnail_candidates: default_thumbnail_candidates,
32
- file_types: [
33
- BuiltInFileType.audio,
34
- BuiltInFileType.image,
35
- BuiltInFileType.video
36
- ])
37
- end
38
-
39
- def video_thumbnail_candidates
40
- [
41
- {file_collection: 'image_files', attribute: 'thumbnail_image_id'},
42
- {file_collection: 'image_files', attribute: 'poster_image_id'},
43
- {file_collection: 'video_files', attribute: 'video_file_id'}
44
- ]
45
- end
46
-
47
- def default_thumbnail_candidates
48
- [
49
- {
50
- file_collection: 'image_files',
51
- attribute: 'thumbnail_image_id'
52
- },
53
- {
54
- file_collection: 'image_files',
55
- attribute: 'background_image_id',
56
- unless: {
57
- attribute: 'background_type',
58
- value: 'video'
59
- }
60
- },
61
- {
62
- file_collection: 'image_files',
63
- attribute: 'poster_image_id',
64
- if: {
65
- attribute: 'background_type',
66
- value: 'video'
67
- }
68
- },
69
- {
70
- file_collection: 'video_files',
71
- attribute: 'video_file_id',
72
- if: {
73
- attribute: 'background_type',
74
- value: 'video'
75
- }
76
- }
77
- ]
4
+ config.page_types.register(BuiltInPageType.plain)
5
+ config.page_types.register(BuiltInPageType.video)
6
+ config.page_types.register(BuiltInPageType.audio)
78
7
  end
79
8
  end
80
9
  end
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '13.5.0'.freeze
2
+ VERSION = '13.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pageflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.5.0
4
+ version: 13.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Codevise Solutions Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-05 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1964,6 +1964,7 @@ files:
1964
1964
  - lib/pageflow/admin/tab.rb
1965
1965
  - lib/pageflow/admin/tabs.rb
1966
1966
  - lib/pageflow/built_in_file_type.rb
1967
+ - lib/pageflow/built_in_page_type.rb
1967
1968
  - lib/pageflow/built_in_page_types_plugin.rb
1968
1969
  - lib/pageflow/built_in_widget_type.rb
1969
1970
  - lib/pageflow/built_in_widget_types_plugin.rb