pageflow 14.5.2 → 15.0.0.beta1

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -39
  3. data/admins/pageflow/membership.rb +1 -5
  4. data/app/assets/javascripts/pageflow/dist/react-client.js +62 -179
  5. data/app/assets/javascripts/pageflow/dist/react-server.js +62 -179
  6. data/app/assets/javascripts/pageflow/editor/api/widget_type.js +1 -0
  7. data/app/assets/javascripts/pageflow/editor/base.js +2 -2
  8. data/app/assets/javascripts/pageflow/editor/collections/files_collection.js +4 -0
  9. data/app/assets/javascripts/pageflow/editor/collections/nested_files_collection.js +4 -0
  10. data/app/assets/javascripts/pageflow/editor/initializers/setup_audio.js +1 -1
  11. data/app/assets/javascripts/pageflow/editor/models/encoded_file.js +1 -1
  12. data/app/assets/javascripts/pageflow/editor/models/image_file.js +1 -1
  13. data/app/assets/javascripts/pageflow/editor/models/mixins/transient_references.js +7 -7
  14. data/app/assets/javascripts/pageflow/editor/models/preview_entry_data.js +2 -2
  15. data/app/assets/javascripts/pageflow/editor/models/{uploaded_file.js → reusable_file.js} +1 -1
  16. data/app/assets/javascripts/pageflow/editor/models/text_track_file.js +2 -2
  17. data/app/assets/javascripts/pageflow/editor/models/{hosted_file.js → uploadable_file.js} +1 -1
  18. data/app/assets/javascripts/pageflow/editor/views/widget_types/title_loading_spinner.js +0 -3
  19. data/app/assets/stylesheets/pageflow/mixins/pageflow.scss +1 -1
  20. data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -1
  21. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner/title.scss +50 -10
  22. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner.scss +0 -2
  23. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +0 -5
  24. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +0 -4
  25. data/app/controllers/pageflow/files_controller.rb +3 -3
  26. data/app/helpers/pageflow/audio_files_helper.rb +18 -16
  27. data/app/helpers/pageflow/background_image_helper.rb +22 -17
  28. data/app/helpers/pageflow/entry_json_seed_helper.rb +3 -3
  29. data/app/helpers/pageflow/file_thumbnails_helper.rb +1 -1
  30. data/app/helpers/pageflow/meta_tags_helper.rb +3 -3
  31. data/app/helpers/pageflow/pages_helper.rb +10 -1
  32. data/app/helpers/pageflow/revision_file_helper.rb +27 -0
  33. data/app/helpers/pageflow/social_share_helper.rb +5 -3
  34. data/app/helpers/pageflow/social_share_links_helper.rb +1 -1
  35. data/app/helpers/pageflow/video_files_helper.rb +18 -13
  36. data/app/jobs/pageflow/{process_file_job.rb → process_image_or_text_track_job.rb} +1 -1
  37. data/app/models/concerns/pageflow/{uploaded_file.rb → reusable_file.rb} +59 -5
  38. data/app/models/concerns/pageflow/{hosted_file.rb → uploadable_file.rb} +26 -15
  39. data/app/models/pageflow/audio_file.rb +2 -2
  40. data/app/models/pageflow/draft_entry.rb +1 -1
  41. data/app/models/pageflow/entry.rb +0 -8
  42. data/app/models/pageflow/file_usage.rb +3 -1
  43. data/app/models/pageflow/image_file.rb +31 -29
  44. data/app/models/pageflow/membership.rb +4 -3
  45. data/app/models/pageflow/page.rb +0 -8
  46. data/app/models/pageflow/positioned_file.rb +3 -2
  47. data/app/models/pageflow/published_entry.rb +9 -3
  48. data/app/models/pageflow/revision.rb +6 -12
  49. data/app/models/pageflow/text_track_file.rb +13 -12
  50. data/app/models/pageflow/thumbnail_file_resolver.rb +3 -3
  51. data/app/models/pageflow/used_file.rb +4 -0
  52. data/app/models/pageflow/video_file.rb +2 -2
  53. data/app/models/pageflow/widget.rb +6 -12
  54. data/app/state_machines/pageflow/{processed_file_state_machine.rb → image_and_text_track_processing_state_machine.rb} +3 -2
  55. data/app/state_machines/pageflow/{encoded_file_state_machine.rb → media_encoding_state_machine.rb} +27 -19
  56. data/app/views/pageflow/editor/files/_file.json.jbuilder +1 -1
  57. data/app/views/pageflow/entries/mobile_navigation/_page.html.erb +1 -1
  58. data/app/views/pageflow/entries/navigation/_page.html.erb +2 -2
  59. data/app/views/pageflow/entries/overview/_page.html.erb +1 -1
  60. data/app/views/pageflow/files/_file.json.jbuilder +1 -0
  61. data/app/views/pageflow/social_share/_page_meta_tags.html.erb +1 -1
  62. data/config/locales/de.yml +0 -24
  63. data/config/locales/en.yml +0 -24
  64. data/db/migrate/20190306161431_copy_file_attributes_of_failed_uploads.rb +4 -4
  65. data/db/migrate/20190523151140_add_perma_id_to_file_usages.rb +13 -0
  66. data/lib/pageflow/built_in_widget_type.rb +0 -7
  67. data/lib/pageflow/built_in_widget_types_plugin.rb +0 -6
  68. data/lib/pageflow/user_mixin.rb +0 -6
  69. data/lib/pageflow/version.rb +1 -1
  70. data/lib/pageflow/widget_types.rb +1 -9
  71. data/spec/factories/{hosted_files.rb → uploadable_files.rb} +3 -3
  72. metadata +16 -32
  73. data/app/assets/javascripts/pageflow/dist/editor.js +0 -11890
  74. data/app/assets/javascripts/pageflow/dist/frontend.js +0 -5800
  75. data/app/assets/javascripts/pageflow/dist/ui.js +0 -3114
  76. data/app/assets/javascripts/pageflow/editor/views/widget_types/media_loading_spinner.js +0 -18
  77. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner/media.scss +0 -56
@@ -1,7 +1,35 @@
1
1
  module Pageflow
2
2
  class ImageFile < ApplicationRecord
3
- include HostedFile
4
- include ProcessedFileStateMachine
3
+ include UploadableFile
4
+ include ImageAndTextTrackProcessingStateMachine
5
+
6
+ # used in paperclip initializer to interpolate the storage path
7
+ # needs to be "processed_attachments" for images for legacy reasons
8
+ def attachments_path_name
9
+ 'processed_attachments'
10
+ end
11
+
12
+ after_attachment_on_s3_post_process :save_image_dimensions
13
+
14
+ def thumbnail_url(*args)
15
+ unless ready?
16
+ return Pageflow::PaperclipInterpolations::Support.pageflow_placeholder(attachment, *args)
17
+ end
18
+ attachment.url(*args)
19
+ end
20
+
21
+ def original_url
22
+ attachment.url if ready?
23
+ end
24
+
25
+ def panorama_url
26
+ attachment.url(:panorama_large) if ready?
27
+ end
28
+
29
+ # UploadableFile-overrides ->
30
+ def attachment_default_url
31
+ ':pageflow_placeholder'
32
+ end
5
33
 
6
34
  def attachment_styles(attachment)
7
35
  panorama_format = File.extname(attachment.original_filename) == '.png' ? :PNG : :JPG
@@ -30,36 +58,10 @@ module Pageflow
30
58
  )
31
59
  end
32
60
 
33
- def attachment_default_url
34
- ':pageflow_placeholder'
35
- end
36
-
37
- # used in paperclip initializer to interpolate the storage path
38
- # needs to be "processed_attachments" for images for legacy reasons
39
- def attachments_path_name
40
- 'processed_attachments'
41
- end
42
-
43
- after_attachment_on_s3_post_process :save_image_dimensions
44
-
45
- def thumbnail_url(*args)
46
- unless ready?
47
- return Pageflow::PaperclipInterpolations::Support.pageflow_placeholder(attachment, *args)
48
- end
49
- attachment.url(*args)
50
- end
51
-
52
61
  def url
53
62
  attachment.url(:large) if ready?
54
63
  end
55
-
56
- def original_url
57
- attachment.url if ready?
58
- end
59
-
60
- def panorama_url
61
- attachment.url(:panorama_large) if ready?
62
- end
64
+ # <- UploadableFile-overrides
63
65
 
64
66
  private
65
67
 
@@ -11,7 +11,7 @@ module Pageflow
11
11
  foreign_key: 'entity_id',
12
12
  optional: true
13
13
 
14
- validates :entity, :role, presence: true
14
+ validates :user, :entity, :role, presence: true
15
15
  validates :user_id, uniqueness: {scope: [:entity_type, :entity_id]}
16
16
  validate :account_membership_exists, if: :on_entry?
17
17
  validates :role,
@@ -38,8 +38,9 @@ module Pageflow
38
38
  private
39
39
 
40
40
  def account_membership_exists
41
- errors[:base] << 'Entry Membership misses presupposed Membership on account of entry' if
42
- user.present? && !user.accounts.include?(entity.account)
41
+ unless user.accounts.include?(entity.account)
42
+ errors[:base] << 'Entry Membership misses presupposed Membership on account of entry'
43
+ end
43
44
  end
44
45
 
45
46
  def on_entry?
@@ -16,14 +16,6 @@ module Pageflow
16
16
  configuration['title'].presence || configuration['additional_title']
17
17
  end
18
18
 
19
- def thumbnail_url(*args)
20
- thumbnail_file.thumbnail_url(*args)
21
- end
22
-
23
- def thumbnail_file
24
- ThumbnailFileResolver.new(page_type.thumbnail_candidates, configuration).find
25
- end
26
-
27
19
  def page_type
28
20
  Pageflow.config.page_types.find_by_name!(template)
29
21
  end
@@ -2,7 +2,7 @@ module Pageflow
2
2
  class PositionedFile
3
3
  attr_reader :file, :position_x, :position_y
4
4
 
5
- delegate :thumbnail_url, to: :file
5
+ delegate :thumbnail_url, :perma_id, to: :file
6
6
 
7
7
  def initialize(file, position_x = nil, position_y = nil)
8
8
  @file = file
@@ -13,7 +13,8 @@ module Pageflow
13
13
  def ==(other)
14
14
  super(other) ||
15
15
  other == file ||
16
- (other.is_a?(PositionedFile) && other.file == file)
16
+ (other.is_a?(PositionedFile) && other.file == file) ||
17
+ (other.class == file.class && other.id == file.id)
17
18
  end
18
19
 
19
20
  def to_model
@@ -16,7 +16,7 @@ module Pageflow
16
16
 
17
17
  delegate(:widgets,
18
18
  :storylines, :main_storyline_chapters, :chapters, :pages,
19
- :find_files, :find_file,
19
+ :find_files, :find_file, :find_file_by_perma_id,
20
20
  :image_files, :video_files, :audio_files,
21
21
  :summary, :credits, :manual_start,
22
22
  :emphasize_chapter_beginning,
@@ -54,10 +54,16 @@ module Pageflow
54
54
 
55
55
  def thumbnail_file
56
56
  share_image_file ||
57
- pages.first.try(:thumbnail_file) ||
57
+ page_thumbnail_file(pages.first) ||
58
58
  PositionedFile.null
59
59
  end
60
60
 
61
+ def page_thumbnail_file(page)
62
+ return unless page.present?
63
+ ThumbnailFileResolver.new(self, page.page_type.thumbnail_candidates, page.configuration)
64
+ .find_thumbnail
65
+ end
66
+
61
67
  def self.find(id, scope = Entry)
62
68
  PublishedEntry.new(scope.published.find(id))
63
69
  end
@@ -98,7 +104,7 @@ module Pageflow
98
104
  end
99
105
 
100
106
  def share_image_file
101
- PositionedFile.wrap(ImageFile.find_by_id(share_image_id), share_image_x, share_image_y)
107
+ PositionedFile.wrap(find_file_by_perma_id(ImageFile, share_image_id), share_image_x, share_image_y)
102
108
  end
103
109
  end
104
110
  end
@@ -93,20 +93,14 @@ module Pageflow
93
93
  UsedFile.new(file)
94
94
  end
95
95
 
96
- def share_providers
97
- self[:share_providers] || entry.theming.default_share_providers
98
- end
99
-
100
- def author
101
- read_attribute(:author) || Pageflow.config.default_author_meta_tag
102
- end
103
-
104
- def publisher
105
- read_attribute(:publisher) || Pageflow.config.default_publisher_meta_tag
96
+ def find_file_by_perma_id(model, perma_id)
97
+ file = files(model).find_by(pageflow_file_usages: {file_perma_id: perma_id})
98
+ return unless file
99
+ UsedFile.new(file)
106
100
  end
107
101
 
108
- def keywords
109
- read_attribute(:keywords) || Pageflow.config.default_keywords_meta_tag
102
+ def share_providers
103
+ self[:share_providers] || entry.theming.default_share_providers
110
104
  end
111
105
 
112
106
  def active_share_providers
@@ -1,8 +1,19 @@
1
1
  module Pageflow
2
2
  class TextTrackFile < ApplicationRecord
3
- include HostedFile
4
- include ProcessedFileStateMachine
3
+ include UploadableFile
4
+ include ImageAndTextTrackProcessingStateMachine
5
5
 
6
+ # used in paperclip initializer to interpolate the storage path
7
+ # needs to be "processed_attachments" for text tracks for legacy reasons
8
+ def attachments_path_name
9
+ 'processed_attachments'
10
+ end
11
+
12
+ def meta_data_attributes=(attributes)
13
+ self.attributes = attributes.symbolize_keys.slice(:label, :kind, :srclang)
14
+ end
15
+
16
+ # UploadableFile-overrides ->
6
17
  def attachment_styles(_attachment)
7
18
  {
8
19
  vtt: {
@@ -14,15 +25,5 @@ module Pageflow
14
25
  }
15
26
  }
16
27
  end
17
-
18
- # used in paperclip initializer to interpolate the storage path
19
- # needs to be "processed_attachments" for text tracks for legacy reasons
20
- def attachments_path_name
21
- 'processed_attachments'
22
- end
23
-
24
- def meta_data_attributes=(attributes)
25
- self.attributes = attributes.symbolize_keys.slice(:label, :kind, :srclang)
26
- end
27
28
  end
28
29
  end
@@ -1,6 +1,6 @@
1
1
  module Pageflow
2
- class ThumbnailFileResolver < Struct.new(:candidates, :configuration)
3
- def find
2
+ class ThumbnailFileResolver < Struct.new(:entry, :candidates, :configuration)
3
+ def find_thumbnail
4
4
  candidates.detect do |candidate|
5
5
  condition = candidate[:unless] || candidate[:if]
6
6
  next if condition && !condition_met?(condition, candidate[:unless])
@@ -35,7 +35,7 @@ module Pageflow
35
35
  end
36
36
 
37
37
  def find_file_by_candidate(candidate)
38
- file_model(candidate).find_by_id(record_id(candidate))
38
+ entry.find_file_by_perma_id(file_model(candidate), record_id(candidate))
39
39
  end
40
40
 
41
41
  def file_model(candidate)
@@ -19,6 +19,10 @@ module Pageflow
19
19
  @usage.id
20
20
  end
21
21
 
22
+ def perma_id
23
+ @usage.perma_id
24
+ end
25
+
22
26
  # Not delegated by default. Required to allow using instances in
23
27
  # Active Record conditions.
24
28
 
@@ -1,7 +1,7 @@
1
1
  module Pageflow
2
2
  class VideoFile < ApplicationRecord
3
- include HostedFile
4
- include EncodedFileStateMachine
3
+ include UploadableFile
4
+ include MediaEncodingStateMachine
5
5
  include OutputSource
6
6
 
7
7
  belongs_to :confirmed_by, class_name: 'User', optional: true
@@ -61,14 +61,10 @@ module Pageflow
61
61
  private
62
62
 
63
63
  def all
64
- initial_widgets = placeholders_by_role.merge(defaults_by_role)
65
- initial_widgets.merge(from_db_by_role) { |_role_key, old_val, new_val|
66
- if old_val.configuration.present?
67
- new_val.configuration = {} if new_val.configuration.nil?
68
- new_val.configuration = old_val.configuration.merge(new_val.configuration)
69
- end
70
- new_val
71
- }.values
64
+ placeholders_by_role
65
+ .merge(defaults_by_role)
66
+ .merge(from_db_by_role)
67
+ .values
72
68
  end
73
69
 
74
70
  def from_db_by_role
@@ -77,15 +73,13 @@ module Pageflow
77
73
 
78
74
  def defaults_by_role
79
75
  config.widget_types.defaults_by_role.each_with_object({}) do |(role, widget_type), result|
80
- result[role] = Widget.new(role: role, type_name: widget_type.name,
81
- subject: nil,
82
- configuration:
83
- config.widget_types.default_configuration(role))
76
+ result[role] = Widget.new(role: role, type_name: widget_type.name, subject: nil)
84
77
  end
85
78
  end
86
79
 
87
80
  def placeholders_by_role
88
81
  return {} unless options[:include_placeholders]
82
+
89
83
  config.widget_types.roles.each_with_object({}) do |role, result|
90
84
  result[role] = Widget.new(role: role, type_name: nil, subject: nil)
91
85
  end
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
- module ProcessedFileStateMachine
2
+ module ImageAndTextTrackProcessingStateMachine
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
@@ -15,7 +15,7 @@ module Pageflow
15
15
  transition 'processing_failed' => 'processing'
16
16
  end
17
17
 
18
- job ProcessFileJob do
18
+ job ProcessImageOrTextTrackJob do
19
19
  on_enter 'processing'
20
20
  result :ok => 'processed'
21
21
  result :error => 'processing_failed'
@@ -23,6 +23,7 @@ module Pageflow
23
23
  end
24
24
  end
25
25
 
26
+ # UploadableFile-overrides
26
27
  def retry!
27
28
  process!
28
29
  end
@@ -1,5 +1,5 @@
1
1
  module Pageflow
2
- module EncodedFileStateMachine
2
+ module MediaEncodingStateMachine
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
@@ -15,13 +15,16 @@ module Pageflow
15
15
  state 'encoding_failed'
16
16
 
17
17
  event :process do
18
- transition any => 'waiting_for_meta_data', :if => lambda { Pageflow.config.confirm_encoding_jobs }
18
+ transition any => 'waiting_for_meta_data',
19
+ if: -> { Pageflow.config.confirm_encoding_jobs }
19
20
  transition any => 'waiting_for_encoding'
20
21
  end
21
22
 
22
- event :retry do
23
- transition 'encoding_failed' => 'waiting_for_confirmation', :if => lambda { Pageflow.config.confirm_encoding_jobs }
24
- transition 'encoded' => 'waiting_for_confirmation', :if => lambda { Pageflow.config.confirm_encoding_jobs }
23
+ event :retry_encoding do
24
+ transition 'encoding_failed' => 'waiting_for_confirmation',
25
+ if: -> { Pageflow.config.confirm_encoding_jobs }
26
+ transition 'encoded' => 'waiting_for_confirmation',
27
+ if: -> { Pageflow.config.confirm_encoding_jobs }
25
28
 
26
29
  transition 'encoding_failed' => 'waiting_for_encoding'
27
30
  transition 'encoded' => 'waiting_for_encoding'
@@ -29,15 +32,15 @@ module Pageflow
29
32
 
30
33
  job RequestMetaDataFromZencoderJob do
31
34
  on_enter 'waiting_for_meta_data'
32
- result :ok => 'fetching_meta_data'
33
- result :error => 'fetching_meta_data_failed'
35
+ result ok: 'fetching_meta_data'
36
+ result error: 'fetching_meta_data_failed'
34
37
  end
35
38
 
36
39
  job PollMetaDataFromZencoderJob do
37
40
  on_enter 'fetching_meta_data'
38
- result :pending, :retry_after => 2.seconds
39
- result :ok => 'waiting_for_confirmation'
40
- result :error => 'fetching_meta_data_failed'
41
+ result :pending, retry_after: 2.seconds
42
+ result ok: 'waiting_for_confirmation'
43
+ result error: 'fetching_meta_data_failed'
41
44
  end
42
45
 
43
46
  event :confirm_encoding do
@@ -45,34 +48,35 @@ module Pageflow
45
48
  end
46
49
 
47
50
  after_transition 'waiting_for_confirmation' => 'waiting_for_encoding' do |file|
48
- Pageflow.config.hooks.invoke(:file_encoding_confirmed, :file => file)
51
+ Pageflow.config.hooks.invoke(:file_encoding_confirmed, file: file)
49
52
  end
50
53
 
51
54
  job SubmitFileToZencoderJob do
52
55
  on_enter 'waiting_for_encoding'
53
- result :ok => 'encoding'
54
- result :error => 'encoding_failed'
56
+ result ok: 'encoding'
57
+ result error: 'encoding_failed'
55
58
  end
56
59
 
57
60
  job PollZencoderJob do
58
61
  on_enter 'encoding'
59
- result :pending, :retry_after => 2.seconds
60
- result :ok => 'encoded'
61
- result :error => 'encoding_failed'
62
+ result :pending, retry_after: 2.seconds
63
+ result ok: 'encoded'
64
+ result error: 'encoding_failed'
62
65
  end
63
66
 
64
67
  after_transition any => 'encoded' do |file|
65
- Pageflow.config.hooks.invoke(:file_encoded, :file => file)
68
+ Pageflow.config.hooks.invoke(:file_encoded, file: file)
66
69
  end
67
70
 
68
71
  after_transition any => 'encoding_failed' do |file|
69
- Pageflow.config.hooks.invoke(:file_encoding_failed, :file => file)
72
+ Pageflow.config.hooks.invoke(:file_encoding_failed, file: file)
70
73
  end
71
74
  end
72
75
  end
73
76
 
77
+ # UploadableFile-overrides
74
78
  def retryable?
75
- can_retry? && !encoded?
79
+ can_retry_encoding? && !encoded?
76
80
  end
77
81
 
78
82
  def ready?
@@ -84,5 +88,9 @@ module Pageflow
84
88
  fetching_meta_data_failed? ||
85
89
  encoding_failed?
86
90
  end
91
+
92
+ def retry!
93
+ retry_encoding!
94
+ end
87
95
  end
88
96
  end
@@ -12,7 +12,7 @@ if file.can_upload?
12
12
  end
13
13
 
14
14
  json.retryable(file.retryable?)
15
- json.file_name(file.attachment.original_filename)
15
+ json.file_name(file.file_name)
16
16
 
17
17
  if file.url.present?
18
18
  json.url(file.url)
@@ -1,6 +1,6 @@
1
1
  <li class="<%= page_navigation_css_class(page) %>">
2
2
  <%= link_to "##{page.perma_id}", data: {link: page.id, chapter_id: page.chapter_id} do %>
3
- <%= image_tag('', data: {src: asset_path(page.thumbnail_url(:thumbnail_overview_mobile))}) %>
3
+ <%= image_tag('', data: {src: asset_path(page_thumbnail_url(page, :thumbnail_overview_mobile))}) %>
4
4
  <%= page.title %>
5
5
  <% end %>
6
6
  </li>
@@ -1,12 +1,12 @@
1
1
  <li class="<%= page_navigation_css_class(page) %>">
2
2
  <%= link_to "##{page.perma_id}", :data => {:link => page.id, :chapter_id => page.chapter_id} do %>
3
- <%= image_tag('', data: {src: asset_path(page.thumbnail_url(:navigation_thumbnail_small))}, width: 85, height: 47) %>
3
+ <%= image_tag('', data: {src: asset_path(page_thumbnail_url(page, :navigation_thumbnail_small))}, width: 85, height: 47) %>
4
4
  <%= page.title %>
5
5
  <% end %>
6
6
  <div class="navigation_site_detail">
7
7
  <%= page.title %>
8
8
  <div class="thumbnail is_<%= page.template %>">
9
- <%= image_tag('', data: {src: asset_path(page.thumbnail_url(:navigation_thumbnail_large))}) %>
9
+ <%= image_tag('', data: {src: asset_path(page_thumbnail_url(page, :navigation_thumbnail_large))}) %>
10
10
  </div>
11
11
  </div>
12
12
  </li>
@@ -4,6 +4,6 @@
4
4
  <%= overview_page_description(page) %>
5
5
  </p>
6
6
  </div>
7
- <%= image_tag('', data: {src: asset_path(page.thumbnail_url(:thumbnail_overview_desktop))}) %>
7
+ <%= image_tag('', data: {src: asset_path(page_thumbnail_url(page, :thumbnail_overview_desktop))}) %>
8
8
  <div class="pictogram"></div>
9
9
  <% end %>
@@ -1,5 +1,6 @@
1
1
  json.call(file,
2
2
  :id,
3
+ :perma_id,
3
4
  :basename,
4
5
  :rights,
5
6
  :configuration,
@@ -1,6 +1,6 @@
1
1
  <%= tag :link, rel: "canonical", href: social_share_page_url(entry, page) %>
2
2
 
3
- <%= tag :meta, property: "og:image", content: social_share_normalize_protocol(page.thumbnail_url(:medium)) %>
3
+ <%= tag :meta, property: "og:image", content: social_share_normalize_protocol(page_thumbnail_url(page, :medium)) %>
4
4
 
5
5
  <%= tag :meta, property: "og:title", content: social_share_page_title(page) %>
6
6
  <%= tag :meta, property: "og:description", name: "description", content: social_share_page_description(entry, page) %>
@@ -282,10 +282,6 @@ de:
282
282
  dimensions: Maße
283
283
  duration: Länge
284
284
  format: Format
285
- pageflow/widget:
286
- blur_strength: Unschärfe
287
- invert: Farben invertieren
288
- remove_logo: Logo entfernen
289
285
  user:
290
286
  account: Konto
291
287
  admin: System-Administrator
@@ -355,10 +351,6 @@ de:
355
351
  attributes:
356
352
  folder:
357
353
  must_be_same_account: Ordner muss zu gleichem Konto gehören wie Beitrag
358
- pageflow/membership:
359
- attributes:
360
- user:
361
- required: Benutzer muss ausgewählt sein
362
354
  models:
363
355
  account:
364
356
  one: Konto
@@ -1128,8 +1120,6 @@ de:
1128
1120
  audio_files: Audios
1129
1121
  image_files: Bilder
1130
1122
  video_files: Videos
1131
- media_loading_spinner:
1132
- widget_type_info_box_text: Dies ist eine Vorschau der Lade-Ansicht von 'Bild'. Die Animation wird ausgeführt, während die Seite geladen wird.
1133
1123
  nested_files:
1134
1124
  text_track_files:
1135
1125
  delete:
@@ -1402,19 +1392,7 @@ de:
1402
1392
  without_parent_page: Ohne übergeordnete Seite
1403
1393
  widgets:
1404
1394
  attributes:
1405
- media_loading_spinner:
1406
- blur_strength:
1407
- inline_help: Steuern Sie die Unschärfe des Hintergrundbilds.
1408
- label: Unschärfe
1409
- custom_background_image_id:
1410
- inline_help: Standardmäßig wird das Hintergrundbild der ersten Seite verwendet.
1411
- label: Hintegrundbild
1412
- remove_logo:
1413
- label: Logo entfernen
1414
1395
  title_loading_spinner:
1415
- blur_strength:
1416
- inline_help: Steuern Sie die Unschärfe des Hintergrundbilds.
1417
- label: Unschärfe
1418
1396
  custom_background_image_id:
1419
1397
  inline_help: Standardmäßig wird das Hintergrundbild der ersten Seite verwendet.
1420
1398
  label: Hintegrundbild
@@ -1755,8 +1733,6 @@ de:
1755
1733
  tr: Türkisch
1756
1734
  unknown: "(Unbekannt)"
1757
1735
  zh: Chinesisch
1758
- media_loading_spinner:
1759
- widget_type_name: Media
1760
1736
  page_transitions:
1761
1737
  crossfade: Überblenden
1762
1738
  cut: Harter Schnitt
@@ -282,10 +282,6 @@ en:
282
282
  dimensions: Dimensions
283
283
  duration: Duration
284
284
  format: Format
285
- pageflow/widget:
286
- blur_strength: Blurriness
287
- invert: Invert Color
288
- remove_logo: Remove Logo
289
285
  user:
290
286
  account: Account
291
287
  admin: System administrator
@@ -355,10 +351,6 @@ en:
355
351
  attributes:
356
352
  folder:
357
353
  must_be_same_account: Folder must belong to same account as story
358
- pageflow/membership:
359
- attributes:
360
- user:
361
- required: User must be selected
362
354
  models:
363
355
  account:
364
356
  one: Account
@@ -1128,8 +1120,6 @@ en:
1128
1120
  audio_files: Audios
1129
1121
  image_files: Images
1130
1122
  video_files: Videos
1131
- media_loading_spinner:
1132
- widget_type_info_box_text: This is a preview of the 'Image' loading view. The animation runs while the page is loading.
1133
1123
  nested_files:
1134
1124
  text_track_files:
1135
1125
  delete:
@@ -1402,19 +1392,7 @@ en:
1402
1392
  without_parent_page: Without parent page
1403
1393
  widgets:
1404
1394
  attributes:
1405
- media_loading_spinner:
1406
- blur_strength:
1407
- inline_help: Control the bluriness of background image.
1408
- label: Blur Strength
1409
- custom_background_image_id:
1410
- inline_help: By default, the background image of the first page is used.
1411
- label: Background Image
1412
- remove_logo:
1413
- label: Remove logo
1414
1395
  title_loading_spinner:
1415
- blur_strength:
1416
- inline_help: Control the bluriness of background image.
1417
- label: Blur Strength
1418
1396
  custom_background_image_id:
1419
1397
  inline_help: By default the background image of the first page is used.
1420
1398
  label: Background image
@@ -1727,8 +1705,6 @@ en:
1727
1705
  tr: Turkish
1728
1706
  unknown: "(Unknown)"
1729
1707
  zh: Chinese
1730
- media_loading_spinner:
1731
- widget_type_name: Media
1732
1708
  page_transitions:
1733
1709
  crossfade: Crossfade
1734
1710
  cut: Cut
@@ -1,7 +1,7 @@
1
1
  class CopyFileAttributesOfFailedUploads < ActiveRecord::Migration[5.2]
2
2
  def up
3
- %w(audio text_track video).each do |hosted_file_type|
4
- execute("UPDATE pageflow_#{hosted_file_type}_files hf
3
+ %w(audio text_track video).each do |uploadable_file_type|
4
+ execute("UPDATE pageflow_#{uploadable_file_type}_files hf
5
5
  SET hf.attachment_on_s3_file_name = hf.attachment_on_filesystem_file_name,
6
6
  hf.attachment_on_s3_content_type = hf.attachment_on_filesystem_content_type,
7
7
  hf.attachment_on_s3_file_size = hf.attachment_on_filesystem_file_size,
@@ -12,8 +12,8 @@ class CopyFileAttributesOfFailedUploads < ActiveRecord::Migration[5.2]
12
12
  end
13
13
 
14
14
  def down
15
- %w(audio text_track video).each do |hosted_file_type|
16
- execute("UPDATE pageflow_#{hosted_file_type}_files hf
15
+ %w(audio text_track video).each do |uploadable_file_type|
16
+ execute("UPDATE pageflow_#{uploadable_file_type}_files hf
17
17
  SET hf.attachment_on_s3_file_name = NULL,
18
18
  hf.attachment_on_s3_content_type = NULL,
19
19
  hf.attachment_on_s3_file_size = NULL,
@@ -0,0 +1,13 @@
1
+ class AddPermaIdToFileUsages < ActiveRecord::Migration[5.2]
2
+ def up
3
+ add_column :pageflow_file_usages, :file_perma_id, :integer, after: 'file_id'
4
+ add_index :pageflow_file_usages,
5
+ [:revision_id, :file_type, :file_perma_id],
6
+ name: 'index_pageflow_file_usages_on_revision_and_file'
7
+ execute('UPDATE pageflow_file_usages SET file_perma_id = file_id;')
8
+ end
9
+
10
+ def down
11
+ remove_column :pageflow_file_usages, :file_perma_id
12
+ end
13
+ end
@@ -61,12 +61,5 @@ module Pageflow
61
61
  insert_point: :before_entry,
62
62
  server_rendering: true)
63
63
  end
64
-
65
- def self.media_loading_spinner
66
- Pageflow::React.create_widget_type('media_loading_spinner',
67
- 'loading_spinner',
68
- insert_point: :before_entry,
69
- server_rendering: true)
70
- end
71
64
  end
72
65
  end