pageflow 13.0.0.beta5 → 13.0.0.beta6

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.

Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +4 -0
  4. data/admins/pageflow/accounts.rb +1 -0
  5. data/app/assets/javascripts/pageflow/base.js +1 -0
  6. data/app/assets/javascripts/pageflow/cookie_notice.js +7 -0
  7. data/app/assets/javascripts/pageflow/dist/react.js +505 -74
  8. data/app/assets/javascripts/pageflow/editor/models/configuration.js +5 -5
  9. data/app/assets/javascripts/pageflow/editor/templates/background_positioning_sliders.jst.ejs +8 -0
  10. data/app/assets/javascripts/pageflow/editor/views/background_positioning_sliders_view.js +37 -23
  11. data/app/assets/javascripts/pageflow/editor/views/background_positioning_view.js +2 -2
  12. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/video.js +1 -1
  13. data/app/assets/javascripts/pageflow/editor/views/edit_widget_view.js +9 -0
  14. data/app/assets/javascripts/pageflow/editor/views/info_box_view.js +8 -0
  15. data/app/assets/javascripts/pageflow/editor/views/widget_types/cookie_notice_bar.js +15 -0
  16. data/app/assets/javascripts/pageflow/seed_entry_data.js +3 -3
  17. data/app/assets/javascripts/pageflow/slideshow/adjacent_preparer.js +11 -4
  18. data/app/assets/javascripts/pageflow/ui/views/configuration_editor_view.js +2 -2
  19. data/app/assets/javascripts/pageflow/visited.js +2 -0
  20. data/app/assets/stylesheets/pageflow/admin.scss +5 -22
  21. data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +21 -0
  22. data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +34 -10
  23. data/app/assets/stylesheets/pageflow/page_types/video.scss +1 -4
  24. data/app/assets/stylesheets/pageflow/page_types/video/mobile_poster.scss +15 -0
  25. data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -0
  26. data/app/assets/stylesheets/pageflow/themes/default/cookie_notice_bar.scss +57 -0
  27. data/app/assets/stylesheets/pageflow/themes/default/page.scss +1 -0
  28. data/app/assets/stylesheets/pageflow/themes/default/page/hyphenate.scss +24 -0
  29. data/app/assets/stylesheets/pageflow/themes/default/slideshow.scss +1 -0
  30. data/app/controllers/pageflow/admin/initial_passwords_controller.rb +8 -0
  31. data/app/helpers/pageflow/common_entry_seed_helper.rb +1 -0
  32. data/app/helpers/pageflow/entries_helper.rb +20 -2
  33. data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -1
  34. data/app/helpers/pageflow/public_i18n_helper.rb +6 -1
  35. data/app/models/pageflow/published_entry.rb +14 -1
  36. data/app/views/admin/accounts/_form.html.erb +1 -0
  37. data/app/views/pageflow/admin/initial_passwords/edit.html.erb +16 -0
  38. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -1
  39. data/app/views/pageflow/user_mailer/invitation.html.erb +2 -2
  40. data/app/views/pageflow/user_mailer/invitation.text.erb +1 -1
  41. data/config/locales/de.yml +11 -1
  42. data/config/locales/en.yml +10 -0
  43. data/config/routes.rb +6 -0
  44. data/db/migrate/20180528144334_add_privacy_link_url_to_themings.rb +5 -0
  45. data/lib/pageflow/built_in_widget_type.rb +4 -0
  46. data/lib/pageflow/built_in_widget_types_plugin.rb +1 -0
  47. data/lib/pageflow/version.rb +1 -1
  48. data/spec/factories/accounts.rb +7 -7
  49. data/spec/factories/audio_files.rb +11 -11
  50. data/spec/factories/chapters.rb +2 -2
  51. data/spec/factories/entries.rb +7 -7
  52. data/spec/factories/file_usages.rb +2 -2
  53. data/spec/factories/folders.rb +1 -1
  54. data/spec/factories/hosted_files.rb +8 -8
  55. data/spec/factories/image_files.rb +10 -10
  56. data/spec/factories/invited_user.rb +2 -2
  57. data/spec/factories/memberships.rb +3 -3
  58. data/spec/factories/pages.rb +4 -4
  59. data/spec/factories/revisions.rb +8 -8
  60. data/spec/factories/text_track_files.rb +9 -9
  61. data/spec/factories/themings.rb +1 -1
  62. data/spec/factories/users.rb +7 -7
  63. data/spec/factories/video_files.rb +12 -12
  64. data/spec/factories/widgets.rb +2 -2
  65. metadata +16 -6
@@ -1,19 +1,19 @@
1
1
  FactoryBot.define do
2
2
  factory :account, class: Pageflow::Account do
3
- name 'Account Name'
3
+ name { 'Account Name' }
4
4
 
5
5
  after(:build) do |account|
6
6
  account.default_theming ||= build(:theming, account: account)
7
7
  end
8
8
 
9
9
  transient do
10
- with_member nil
11
- with_previewer nil
12
- with_editor nil
13
- with_publisher nil
14
- with_manager nil
10
+ with_member { nil }
11
+ with_previewer { nil }
12
+ with_editor { nil }
13
+ with_publisher { nil }
14
+ with_manager { nil }
15
15
 
16
- with_feature nil
16
+ with_feature { nil }
17
17
  end
18
18
 
19
19
  after(:create) do |account, evaluator|
@@ -4,10 +4,10 @@ module Pageflow
4
4
  entry
5
5
  uploader { create(:user) }
6
6
 
7
- attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'et.ogg'))
7
+ attachment_on_s3 { File.open(Engine.root.join('spec', 'fixtures', 'et.ogg')) }
8
8
 
9
9
  transient do
10
- used_in nil
10
+ used_in { nil }
11
11
  end
12
12
 
13
13
  before(:create) do |file, evaluator|
@@ -19,27 +19,27 @@ module Pageflow
19
19
  end
20
20
 
21
21
  trait :on_filesystem do
22
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'et.ogg'))
23
- attachment_on_s3 nil
24
- state 'not_uploaded_to_s3'
22
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'et.ogg')) }
23
+ attachment_on_s3 { nil }
24
+ state { 'not_uploaded_to_s3' }
25
25
  end
26
26
 
27
27
  trait :uploading_to_s3_failed do
28
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'et.ogg'))
29
- attachment_on_s3 nil
30
- state 'uploading_to_s3_failed'
28
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'et.ogg')) }
29
+ attachment_on_s3 { nil }
30
+ state { 'uploading_to_s3_failed' }
31
31
  end
32
32
 
33
33
  trait :waiting_for_confirmation do
34
- state 'waiting_for_confirmation'
34
+ state { 'waiting_for_confirmation' }
35
35
  end
36
36
 
37
37
  trait :encoding_failed do
38
- state 'encoding_failed'
38
+ state { 'encoding_failed' }
39
39
  end
40
40
 
41
41
  trait :encoded do
42
- state 'encoded'
42
+ state { 'encoded' }
43
43
  end
44
44
  end
45
45
  end
@@ -4,7 +4,7 @@ module Pageflow
4
4
  storyline
5
5
 
6
6
  transient do
7
- in_main_storyline_of nil
7
+ in_main_storyline_of { nil }
8
8
  end
9
9
 
10
10
  before(:create) do |chapter, evaluator|
@@ -16,7 +16,7 @@ module Pageflow
16
16
  end
17
17
 
18
18
  factory :valid_chapter, :class => Chapter do
19
- title "Introduction"
19
+ title { 'Introduction' }
20
20
  end
21
21
  end
22
22
  end
@@ -14,12 +14,12 @@ module Pageflow
14
14
  end
15
15
 
16
16
  transient do
17
- with_previewer nil
18
- with_editor nil
19
- with_publisher nil
20
- with_manager nil
17
+ with_previewer { nil }
18
+ with_editor { nil }
19
+ with_publisher { nil }
20
+ with_manager { nil }
21
21
 
22
- with_feature nil
22
+ with_feature { nil }
23
23
  end
24
24
 
25
25
  after(:create) do |entry, evaluator|
@@ -48,7 +48,7 @@ module Pageflow
48
48
 
49
49
  trait :published do
50
50
  transient do
51
- published_revision_attributes({})
51
+ published_revision_attributes { {} }
52
52
  end
53
53
 
54
54
  after(:create) do |entry, evaluator|
@@ -63,7 +63,7 @@ module Pageflow
63
63
  end
64
64
 
65
65
  trait :with_highdef_video_encoding do
66
- feature_states('highdef_video_encoding' => true)
66
+ feature_states { {'highdef_video_encoding' => true} }
67
67
  end
68
68
  end
69
69
  end
@@ -1,8 +1,8 @@
1
1
  module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :file_usage, :class => FileUsage do
4
- revision nil
5
- file nil
4
+ revision { nil }
5
+ file { nil }
6
6
  end
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :folder, :class => Folder do
4
- name "some folder"
4
+ name { 'some folder' }
5
5
  account
6
6
  end
7
7
  end
@@ -7,20 +7,20 @@ module Pageflow
7
7
  FactoryBot.define do
8
8
  factory :hosted_file, class: TestHostedFile do
9
9
  trait :on_filesystem do
10
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
11
- attachment_on_s3 nil
12
- state 'not_uploaded_to_s3'
10
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'image.png')) }
11
+ attachment_on_s3 { nil }
12
+ state { 'not_uploaded_to_s3' }
13
13
  end
14
14
 
15
15
  trait :uploading_to_s3_failed do
16
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
17
- attachment_on_s3 nil
18
- state 'uploading_to_s3_failed'
16
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'image.png')) }
17
+ attachment_on_s3 { nil }
18
+ state { 'uploading_to_s3_failed' }
19
19
  end
20
20
 
21
21
  trait :uploaded_to_s3 do
22
- attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'image.png'))
23
- state 'uploaded_to_s3'
22
+ attachment_on_s3 { File.open(Engine.root.join('spec', 'fixtures', 'image.png')) }
23
+ state { 'uploaded_to_s3' }
24
24
  end
25
25
 
26
26
  trait :with_overridden_keep_on_filesystem do
@@ -4,11 +4,11 @@ module Pageflow
4
4
  entry
5
5
  uploader { create(:user) }
6
6
 
7
- attachment File.open(Engine.root.join('spec', 'fixtures', 'image.jpg'))
8
- state 'processed'
7
+ attachment { File.open(Engine.root.join('spec', 'fixtures', 'image.jpg')) }
8
+ state { 'processed' }
9
9
 
10
10
  transient do
11
- used_in nil
11
+ used_in { nil }
12
12
  end
13
13
 
14
14
  before(:create) do |file, evaluator|
@@ -20,19 +20,19 @@ module Pageflow
20
20
  end
21
21
 
22
22
  trait :processed do
23
- processed_attachment File.open(Engine.root.join('spec', 'fixtures', 'image.jpg'))
23
+ processed_attachment { File.open(Engine.root.join('spec', 'fixtures', 'image.jpg')) }
24
24
  end
25
25
 
26
26
  trait :unprocessed do
27
- unprocessed_attachment File.open(Engine.root.join('spec', 'fixtures', 'image.jpg'))
28
- processed_attachment nil
29
- state 'not_processed'
27
+ unprocessed_attachment { File.open(Engine.root.join('spec', 'fixtures', 'image.jpg')) }
28
+ processed_attachment { nil }
29
+ state { 'not_processed' }
30
30
  end
31
31
 
32
32
  trait :failed do
33
- unprocessed_attachment File.open(Engine.root.join('spec', 'fixtures', 'image.jpg'))
34
- processed_attachment nil
35
- state 'processing_failed'
33
+ unprocessed_attachment { File.open(Engine.root.join('spec', 'fixtures', 'image.jpg')) }
34
+ processed_attachment { nil }
35
+ state { 'processing_failed' }
36
36
  end
37
37
 
38
38
  trait :encoded do
@@ -2,8 +2,8 @@ module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :invited_user, class: InvitedUser do
4
4
  email
5
- first_name 'Edison'
6
- last_name 'Editor'
5
+ first_name { 'Edison' }
6
+ last_name { 'Editor' }
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ module Pageflow
3
3
  factory :membership, class: Membership do
4
4
  user
5
5
  association :entity, factory: :entry
6
- role :previewer
6
+ role { :previewer }
7
7
  before(:create) do |membership|
8
8
  if membership.entity_type != 'Pageflow::Account' &&
9
9
  !membership.user.accounts.include?(membership.entity.account) &&
@@ -19,7 +19,7 @@ module Pageflow
19
19
  factory :entry_membership, class: Membership do
20
20
  user
21
21
  association :entity, factory: :entry
22
- role :previewer
22
+ role { :previewer }
23
23
  before(:create) do |membership|
24
24
  if !membership.user.accounts.include?(membership.entity.account) &&
25
25
  !membership.entity.account.nil?
@@ -34,7 +34,7 @@ module Pageflow
34
34
  factory :account_membership, class: Membership do
35
35
  user
36
36
  association :entity, factory: :account
37
- role :member
37
+ role { :member }
38
38
  end
39
39
  end
40
40
  end
@@ -2,13 +2,13 @@ module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :page, :class => Page do
4
4
  chapter
5
- template "background_image"
6
- configuration({})
5
+ template { 'background_image' }
6
+ configuration { {} }
7
7
  end
8
8
 
9
9
  factory :valid_page, :class => Page do
10
- template "background_image"
11
- configuration({})
10
+ template { 'background_image' }
11
+ configuration { {} }
12
12
  end
13
13
  end
14
14
  end
@@ -20,30 +20,30 @@ module Pageflow
20
20
 
21
21
  trait :user_snapshot do
22
22
  frozen
23
- snapshot_type 'user'
23
+ snapshot_type { 'user' }
24
24
  end
25
25
 
26
26
  trait :auto_snapshot do
27
27
  frozen
28
- snapshot_type 'auto'
28
+ snapshot_type { 'auto' }
29
29
  end
30
30
 
31
31
  trait :with_home_button do
32
- home_button_enabled true
33
- home_url 'http://example.com'
32
+ home_button_enabled { true }
33
+ home_url { 'http://example.com' }
34
34
  end
35
35
 
36
36
  trait :without_home_button do
37
- home_button_enabled false
38
- home_url 'http://example.com'
37
+ home_button_enabled { false }
38
+ home_url { 'http://example.com' }
39
39
  end
40
40
 
41
41
  trait :with_overview_button do
42
- overview_button_enabled true
42
+ overview_button_enabled { true }
43
43
  end
44
44
 
45
45
  trait :without_overview_button do
46
- overview_button_enabled false
46
+ overview_button_enabled { false }
47
47
  end
48
48
  end
49
49
  end
@@ -5,10 +5,10 @@ module Pageflow
5
5
  uploader { create(:user) }
6
6
  parent_file { nil }
7
7
 
8
- attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'sample.vtt'))
8
+ attachment_on_s3 { File.open(Engine.root.join('spec', 'fixtures', 'sample.vtt')) }
9
9
 
10
10
  transient do
11
- used_in nil
11
+ used_in { nil }
12
12
  end
13
13
 
14
14
  before(:create) do |file, evaluator|
@@ -21,19 +21,19 @@ module Pageflow
21
21
  end
22
22
 
23
23
  trait :from_srt_file do
24
- attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'sample.srt'))
24
+ attachment_on_s3 { File.open(Engine.root.join('spec', 'fixtures', 'sample.srt')) }
25
25
  end
26
26
 
27
27
  trait :on_filesystem do
28
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'et.ogg'))
29
- attachment_on_s3 nil
30
- state 'not_uploaded_to_s3'
28
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'et.ogg')) }
29
+ attachment_on_s3 { nil }
30
+ state { 'not_uploaded_to_s3' }
31
31
  end
32
32
 
33
33
  trait :uploading_to_s3_failed do
34
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'et.ogg'))
35
- attachment_on_s3 nil
36
- state 'uploading_to_s3_failed'
34
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'et.ogg')) }
35
+ attachment_on_s3 { nil }
36
+ state { 'uploading_to_s3_failed' }
37
37
  end
38
38
  end
39
39
  end
@@ -2,7 +2,7 @@ module Pageflow
2
2
  FactoryBot.define do
3
3
  factory :theming, :class => Pageflow::Theming do
4
4
  account
5
- theme_name 'default'
5
+ theme_name { 'default' }
6
6
  end
7
7
  end
8
8
  end
@@ -6,14 +6,14 @@ module Pageflow
6
6
 
7
7
  factory :user do
8
8
  transient do
9
- on nil
9
+ on { nil }
10
10
  end
11
11
 
12
12
  email
13
- first_name 'John'
14
- last_name 'Doe'
13
+ first_name { 'John' }
14
+ last_name { 'Doe' }
15
15
 
16
- password '@qwert12345'
16
+ password { '@qwert12345' }
17
17
  password_confirmation { password }
18
18
 
19
19
  trait :member do
@@ -47,7 +47,7 @@ module Pageflow
47
47
  end
48
48
 
49
49
  trait :admin do
50
- admin true
50
+ admin { true }
51
51
  after(:create) do |user, evaluator|
52
52
  create(:membership,
53
53
  user: user,
@@ -63,8 +63,8 @@ module Pageflow
63
63
 
64
64
  factory :valid_user, class: User do
65
65
  email
66
- first_name 'Edison'
67
- last_name 'Editor'
66
+ first_name { 'Edison' }
67
+ last_name { 'Editor' }
68
68
  end
69
69
  end
70
70
  end
@@ -4,12 +4,12 @@ module Pageflow
4
4
  entry
5
5
  uploader { create(:user) }
6
6
 
7
- attachment_on_s3 File.open(Engine.root.join('spec', 'fixtures', 'video.mp4'))
8
- state 'encoded'
7
+ attachment_on_s3 { File.open(Engine.root.join('spec', 'fixtures', 'video.mp4')) }
8
+ state { 'encoded' }
9
9
 
10
10
  transient do
11
- used_in nil
12
- with_configuration nil
11
+ used_in { nil }
12
+ with_configuration { nil }
13
13
  end
14
14
 
15
15
  before(:create) do |file, evaluator|
@@ -26,23 +26,23 @@ module Pageflow
26
26
  end
27
27
 
28
28
  trait :on_filesystem do
29
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'video.mp4'))
30
- attachment_on_s3 nil
31
- state 'not_uploaded_to_s3'
29
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'video.mp4')) }
30
+ attachment_on_s3 { nil }
31
+ state { 'not_uploaded_to_s3' }
32
32
  end
33
33
 
34
34
  trait :uploading_to_s3_failed do
35
- attachment_on_filesystem File.open(Engine.root.join('spec', 'fixtures', 'video.mp4'))
36
- attachment_on_s3 nil
37
- state 'uploading_to_s3_failed'
35
+ attachment_on_filesystem { File.open(Engine.root.join('spec', 'fixtures', 'video.mp4')) }
36
+ attachment_on_s3 { nil }
37
+ state { 'uploading_to_s3_failed' }
38
38
  end
39
39
 
40
40
  trait :waiting_for_confirmation do
41
- state 'waiting_for_confirmation'
41
+ state { 'waiting_for_confirmation' }
42
42
  end
43
43
 
44
44
  trait :encoding_failed do
45
- state 'encoding_failed'
45
+ state { 'encoding_failed' }
46
46
  end
47
47
 
48
48
  trait :encoded do