pageflow 16.0.0 → 16.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +86 -33
- data/README.md +6 -6
- data/Rakefile +1 -1
- data/admins/pageflow/entry.rb +0 -1
- data/admins/pageflow/sites.rb +3 -0
- data/app/assets/images/pageflow/admin/icons/published_with_noindex.svg +4 -0
- data/app/assets/javascripts/pageflow/dist/ui.js +299 -72
- data/app/assets/stylesheets/pageflow/admin/active_admin_patches.scss +1 -1
- data/app/assets/stylesheets/pageflow/admin/entries.scss +4 -0
- data/app/assets/stylesheets/pageflow/admin/permalink_input.scss +10 -0
- data/app/assets/stylesheets/pageflow/admin/publication_state_indicator.scss +4 -0
- data/app/assets/stylesheets/pageflow/editor/base.scss +0 -1
- data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +61 -7
- data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +12 -1
- data/app/assets/stylesheets/pageflow/editor/file_thumbnails.scss +4 -0
- data/app/assets/stylesheets/pageflow/editor/help.scss +3 -3
- data/app/assets/stylesheets/pageflow/editor/info_box.scss +7 -0
- data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +0 -5
- data/app/assets/stylesheets/pageflow/ui/forms.scss +4 -4
- data/app/assets/stylesheets/pageflow/{editor/wysihtml5.scss → ui/input/text_area_input.scss} +13 -1
- data/app/assets/stylesheets/pageflow/ui.scss +1 -0
- data/app/controllers/pageflow/chapters_controller.rb +2 -2
- data/app/controllers/pageflow/editor/entry_publications_controller.rb +5 -1
- data/app/controllers/pageflow/editor/file_import_controller.rb +1 -1
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +12 -2
- data/app/controllers/pageflow/feeds_controller.rb +18 -0
- data/app/controllers/pageflow/pages_controller.rb +2 -2
- data/app/controllers/pageflow/sitemaps_controller.rb +15 -0
- data/app/controllers/pageflow/storylines_controller.rb +2 -2
- data/app/helpers/pageflow/entries_helper.rb +4 -1
- data/app/helpers/pageflow/feeds_helper.rb +66 -0
- data/app/helpers/pageflow/meta_tags_helper.rb +2 -1
- data/app/helpers/pageflow/page_types_helper.rb +10 -10
- data/app/helpers/pageflow/revision_file_helper.rb +3 -3
- data/app/helpers/pageflow/social_share_helper.rb +2 -2
- data/app/inputs/pageflow_permalink_input.rb +15 -3
- data/app/models/concerns/pageflow/entry_publication_states.rb +9 -0
- data/app/models/concerns/pageflow/reusable_file.rb +3 -3
- data/app/models/concerns/pageflow/uploadable_file.rb +5 -0
- data/app/models/pageflow/account.rb +8 -0
- data/app/models/pageflow/audio_file_url_templates.rb +2 -1
- data/app/models/pageflow/draft_entry.rb +1 -1
- data/app/models/pageflow/entries_feed.rb +32 -0
- data/app/models/pageflow/entry.rb +7 -5
- data/app/models/pageflow/entry_at_revision.rb +2 -0
- data/app/models/pageflow/image_file.rb +34 -8
- data/app/models/pageflow/image_file_url_templates.rb +7 -1
- data/app/models/pageflow/membership.rb +3 -2
- data/app/models/pageflow/other_file.rb +5 -0
- data/app/models/pageflow/other_file_url_templates.rb +16 -0
- data/app/models/pageflow/published_entry.rb +6 -0
- data/app/models/pageflow/revision.rb +6 -0
- data/app/models/pageflow/site.rb +8 -0
- data/app/models/pageflow/sitemaps.rb +14 -0
- data/app/models/pageflow/used_file.rb +10 -2
- data/app/models/pageflow/video_file_url_templates.rb +3 -1
- data/app/models/pageflow/widget.rb +9 -1
- data/app/views/admin/entries/_permalink_inputs.html.erb +1 -2
- data/app/views/admin/sites/_attributes_table.html.arb +3 -0
- data/app/views/admin/sites/_fields.html.erb +6 -0
- data/app/views/components/pageflow/admin/extensible_attributes_table.rb +2 -2
- data/app/views/components/pageflow/admin/revisions_tab.rb +8 -0
- data/app/views/components/pageflow/admin/sites_tab.rb +3 -0
- data/app/views/pageflow/editor/config/_seeds.json.jbuilder +2 -0
- data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
- data/app/views/pageflow/editor/entry_publications/check.json.jbuilder +1 -0
- data/app/views/pageflow/feeds/index.atom.builder +20 -0
- data/app/views/pageflow/image_files/_image_file.json.jbuilder +1 -0
- data/app/views/pageflow/meta_tags/_entry.html.erb +1 -0
- data/app/views/pageflow/sitemaps/index.xml.builder +9 -0
- data/config/initializers/features.rb +3 -0
- data/config/initializers/paperclip.rb +8 -0
- data/config/locales/de.yml +77 -6
- data/config/locales/en.yml +79 -4
- data/config/routes.rb +3 -0
- data/config/spring.rb +1 -1
- data/db/migrate/20230120092923_create_other_files.rb +23 -0
- data/db/migrate/20230323115745_add_feeds_enabled_to_sites.rb +5 -0
- data/db/migrate/20230323154323_add_sitemap_enabled_to_sites.rb +5 -0
- data/db/migrate/20230331103823_add_title_to_sites.rb +5 -0
- data/db/migrate/20230405103612_add_custom_feed_url_to_sites.rb +5 -0
- data/db/migrate/20231024062501_add_output_presences_to_image_files.rb +5 -0
- data/db/migrate/20231128124523_add_noindex_to_revisions.rb +5 -0
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +710 -259
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +34 -5
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-client.js +1 -1
- data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/react-server.js +1 -1
- data/entry_types/paged/app/controllers/pageflow_paged/editor/entries_controller.rb +0 -2
- data/entry_types/paged/app/controllers/pageflow_paged/entries_controller.rb +2 -1
- data/entry_types/paged/app/views/pageflow_paged/entries/show.html.erb +1 -0
- data/entry_types/paged/config/initializers/features.rb +0 -1
- data/entry_types/paged/lib/pageflow_paged/engine.rb +13 -1
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/chapters_controller.rb +2 -2
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/content_elements_controller.rb +3 -4
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/editor/sections_controller.rb +13 -6
- data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +11 -3
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/cache_helper.rb +11 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/entry_json_seed_helper.rb +42 -0
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +8 -5
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +17 -12
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +9 -1
- data/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +1 -1
- data/entry_types/scrolled/app/models/pageflow_scrolled/chapter.rb +23 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +1 -1
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_seed.json.jbuilder +1 -5
- data/entry_types/scrolled/app/views/pageflow_scrolled/editor/sections/_section_with_content_elements.json.jbuilder +10 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +44 -41
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_consent_vendors.json.jbuilder +16 -0
- data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_entry.json.jbuilder +7 -0
- data/entry_types/scrolled/config/initializers/features.rb +5 -0
- data/entry_types/scrolled/config/locales/consent_widget.de.yml +4 -0
- data/entry_types/scrolled/config/locales/consent_widget.en.yml +4 -0
- data/entry_types/scrolled/config/locales/de.yml +225 -8
- data/entry_types/scrolled/config/locales/en.yml +239 -2
- data/entry_types/scrolled/config/routes.rb +4 -0
- data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +69 -44
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_packs.rb +2 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/additional_seed_data.rb +1 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/configuration.rb +96 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/content_element_consent_vendors.rb +38 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +13 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +30 -0
- data/entry_types/scrolled/lib/pageflow_scrolled/react_widget_type.rb +6 -1
- data/entry_types/scrolled/lib/pageflow_scrolled/web_app_manifest.rb +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +1 -1
- data/entry_types/scrolled/lib/tasks/pageflow_scrolled/storybook.rake +1 -2
- data/entry_types/scrolled/package/config/webpack.js +26 -0
- data/entry_types/scrolled/package/contentElements-editor.js +330 -32
- data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
- data/entry_types/scrolled/package/contentElements-frontend.js +920 -145
- data/entry_types/scrolled/package/editor.js +819 -239
- data/entry_types/scrolled/package/frontend/{EditableInlineText.module-14c7b097.js → EditableInlineText.module-6ee0e024.js} +1975 -1792
- data/entry_types/scrolled/package/frontend/PhonePlatformContext-b28d991a.js +32 -0
- data/entry_types/scrolled/package/frontend/ToggleFullscreenCornerButton-8242f213.js +107 -0
- data/entry_types/scrolled/package/frontend/Viewer-32cd1ac1.js +154 -0
- data/entry_types/scrolled/package/frontend/{Viewer-b6becc57.js → Viewer-6e4d14ed.js} +32 -161
- data/entry_types/scrolled/package/frontend/arrowRight-e42e6011.js +77 -0
- data/entry_types/scrolled/package/frontend/{components-b3160dd7.js → components-24363f97.js} +188 -47
- data/entry_types/scrolled/package/frontend/{PhonePlatformContext-f6093cc6.js → i18n-71c39823.js} +191 -111
- data/entry_types/scrolled/package/frontend/index-fc4b13e6.js +118 -0
- data/entry_types/scrolled/package/frontend/index.css +1 -1
- data/entry_types/scrolled/package/frontend/index.js +252 -76
- data/entry_types/scrolled/package/frontend/useContentElementEditorState-245f1986.js +52 -0
- data/entry_types/scrolled/package/package.json +6 -4
- data/entry_types/scrolled/package/testHelpers.js +11 -2
- data/entry_types/scrolled/package/values/colors.module.css +15 -0
- data/entry_types/scrolled/package/widgets/consentBar.css +1 -0
- data/entry_types/scrolled/package/widgets/consentBar.js +426 -0
- data/entry_types/scrolled/package/widgets/defaultNavigation.css +2 -2
- data/entry_types/scrolled/package/widgets/defaultNavigation.js +39 -4
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.css +1 -0
- data/entry_types/scrolled/package/widgets/iconInlineFileRights.js +49 -0
- data/entry_types/scrolled/package/widgets/textInlineFileRights.css +1 -0
- data/entry_types/scrolled/package/widgets/textInlineFileRights.js +37 -0
- data/lib/generators/pageflow/resque/resque_generator.rb +1 -1
- data/lib/generators/pageflow/resque/templates/resque.rake +1 -1
- data/lib/generators/pageflow/resque/templates/resque.rb +1 -1
- data/lib/generators/pageflow/routes/routes_generator.rb +1 -1
- data/lib/pageflow/ability_mixin.rb +5 -5
- data/lib/pageflow/active_admin_can_can_fix.rb +2 -2
- data/lib/pageflow/built_in_file_type.rb +7 -0
- data/lib/pageflow/configuration.rb +29 -1
- data/lib/pageflow/engine.rb +18 -40
- data/lib/pageflow/entry_export_import/revision_serialization.rb +1 -1
- data/lib/pageflow/file_type.rb +2 -2
- data/lib/pageflow/global_config_api.rb +2 -2
- data/lib/pageflow/nested_revision_component.rb +23 -5
- data/lib/pageflow/page_type.rb +1 -1
- data/lib/pageflow/paperclip_processors/webp.rb +63 -0
- data/lib/pageflow/rails_version.rb +19 -0
- data/lib/pageflow/seeds.rb +10 -7
- data/lib/pageflow/user_mixin.rb +1 -1
- data/lib/pageflow/version.rb +1 -1
- data/lib/pageflow/widget_types.rb +4 -0
- data/package/config/jest/index.js +3 -1
- data/package/config/webpack5.js +14 -0
- data/package/editor.js +410 -181
- data/package/frontend.js +34 -4
- data/package/testHelpers.js +1 -1
- data/package/ui.js +297 -71
- data/spec/factories/entries.rb +34 -3
- data/spec/factories/sites.rb +3 -0
- data/vendor/assets/javascripts/iscroll.js +4 -7
- metadata +118 -80
- data/app/helpers/pageflow/admin/permalinks_helper.rb +0 -15
- data/entry_types/scrolled/package/frontend/arrowRight-78a7cee4.js +0 -42
@@ -22,6 +22,7 @@ module Pageflow
|
|
22
22
|
:password_digest,
|
23
23
|
:to_model, :to_key, :to_param, :persisted?, :to_json,
|
24
24
|
:first_published_at, :published_until, :published?,
|
25
|
+
:last_published_with_noindex?,
|
25
26
|
:type_name,
|
26
27
|
to: :entry)
|
27
28
|
|
@@ -35,6 +36,7 @@ module Pageflow
|
|
35
36
|
:locale,
|
36
37
|
:author, :publisher, :keywords,
|
37
38
|
:published_at,
|
39
|
+
:noindex?,
|
38
40
|
:configuration,
|
39
41
|
to: :revision)
|
40
42
|
|
@@ -2,6 +2,9 @@ module Pageflow
|
|
2
2
|
class ImageFile < ApplicationRecord
|
3
3
|
include UploadableFile
|
4
4
|
include ImageAndTextTrackProcessingStateMachine
|
5
|
+
include OutputSource
|
6
|
+
|
7
|
+
before_post_process :set_output_presences
|
5
8
|
|
6
9
|
# used in paperclip initializer to interpolate the storage path
|
7
10
|
# needs to be "processed_attachments" for images for legacy reasons
|
@@ -9,7 +12,7 @@ module Pageflow
|
|
9
12
|
'processed_attachments'
|
10
13
|
end
|
11
14
|
|
12
|
-
|
15
|
+
before_attachment_on_s3_post_process :save_image_dimensions
|
13
16
|
|
14
17
|
def thumbnail_url(*args)
|
15
18
|
unless ready?
|
@@ -35,24 +38,24 @@ module Pageflow
|
|
35
38
|
panorama_format = File.extname(attachment.original_filename) == '.png' ? :PNG : :JPG
|
36
39
|
|
37
40
|
Pageflow
|
38
|
-
.config.thumbnail_styles
|
41
|
+
.config.thumbnail_styles.transform_values { |options| options.merge(style_defaults) }
|
39
42
|
.merge(
|
40
43
|
print: {geometry: '300x300>',
|
41
|
-
|
44
|
+
**style_defaults,
|
42
45
|
convert_options: '-quality 10 -interlace Plane'},
|
43
46
|
medium: {geometry: '1024x1024>',
|
44
|
-
|
47
|
+
**style_defaults,
|
45
48
|
convert_options: '-quality 70 -interlace Plane'},
|
46
49
|
large: {geometry: '1920x1920>',
|
47
|
-
|
50
|
+
**style_defaults,
|
48
51
|
convert_options: '-quality 70 -interlace Plane'},
|
49
52
|
ultra: {geometry: '3840x3840>',
|
50
|
-
|
53
|
+
**style_defaults,
|
51
54
|
convert_options: '-quality 90 -interlace Plane'},
|
52
|
-
panorama_medium: {geometry:
|
55
|
+
panorama_medium: {geometry: ImageFile.scale_down_to_cover(1024, 1024),
|
53
56
|
format: panorama_format,
|
54
57
|
convert_options: '-quality 90 -interlace Plane'},
|
55
|
-
panorama_large: {geometry:
|
58
|
+
panorama_large: {geometry: ImageFile.scale_down_to_cover(1920, 1080),
|
56
59
|
format: panorama_format,
|
57
60
|
convert_options: '-quality 90 -interlace Plane'}
|
58
61
|
)
|
@@ -63,6 +66,17 @@ module Pageflow
|
|
63
66
|
end
|
64
67
|
# <- UploadableFile-overrides
|
65
68
|
|
69
|
+
def self.scale_down_to_cover(width, height)
|
70
|
+
lambda do |image_file|
|
71
|
+
if image_file.width.present? && image_file.height.present? &&
|
72
|
+
(image_file.width <= width || image_file.height <= height)
|
73
|
+
'100%'
|
74
|
+
else
|
75
|
+
"#{width}x#{height}^"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
66
80
|
private
|
67
81
|
|
68
82
|
def save_image_dimensions
|
@@ -71,5 +85,17 @@ module Pageflow
|
|
71
85
|
self.height = geo.height
|
72
86
|
rescue Paperclip::Errors::NotIdentifiedByImageMagickError
|
73
87
|
end
|
88
|
+
|
89
|
+
def style_defaults
|
90
|
+
if output_present?(:webp)
|
91
|
+
{format: :webp, processors: [:pageflow_webp]}
|
92
|
+
else
|
93
|
+
{format: :JPG}
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def set_output_presences
|
98
|
+
self.output_presences = {webp: true} if entry&.feature_state('webp_images')
|
99
|
+
end
|
74
100
|
end
|
75
101
|
end
|
@@ -2,12 +2,18 @@ module Pageflow
|
|
2
2
|
class ImageFileUrlTemplates
|
3
3
|
def call
|
4
4
|
styles.each_with_object({}) do |style, result|
|
5
|
-
result[style] =
|
5
|
+
result[style] = replace_extension_with_placeholder(
|
6
|
+
UrlTemplate.from_attachment(example_file.attachment, style)
|
7
|
+
)
|
6
8
|
end
|
7
9
|
end
|
8
10
|
|
9
11
|
private
|
10
12
|
|
13
|
+
def replace_extension_with_placeholder(url)
|
14
|
+
url.gsub(/.JPG$/, '.:processed_extension')
|
15
|
+
end
|
16
|
+
|
11
17
|
def styles
|
12
18
|
example_file.attachment_styles(example_file.attachment).keys + [:original]
|
13
19
|
end
|
@@ -38,8 +38,9 @@ module Pageflow
|
|
38
38
|
private
|
39
39
|
|
40
40
|
def account_membership_exists
|
41
|
-
|
42
|
-
|
41
|
+
return if user.blank? || user.accounts.include?(entity.account)
|
42
|
+
|
43
|
+
errors.add(:base, 'Entry Membership misses presupposed Membership on account of entry')
|
43
44
|
end
|
44
45
|
|
45
46
|
def on_entry?
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# @api private
|
3
|
+
class OtherFileUrlTemplates
|
4
|
+
def call
|
5
|
+
{
|
6
|
+
original: UrlTemplate.from_attachment(example_file.attachment, :original)
|
7
|
+
}
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def example_file
|
13
|
+
@example_file ||= OtherFile.new(id: 0, file_name: ':basename.:extension')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -65,6 +65,8 @@ module Pageflow
|
|
65
65
|
scope(:with_password_protection, -> { where('password_protected IS TRUE') })
|
66
66
|
scope(:without_password_protection, -> { where('password_protected IS NOT TRUE') })
|
67
67
|
|
68
|
+
scope(:without_noindex, -> { where('noindex IS NOT TRUE') })
|
69
|
+
|
68
70
|
scope :editable, -> { where('frozen_at IS NULL') }
|
69
71
|
scope :frozen, -> { where('frozen_at IS NOT NULL') }
|
70
72
|
|
@@ -204,6 +206,10 @@ module Pageflow
|
|
204
206
|
.merge(read_attribute(:configuration) || {})
|
205
207
|
end
|
206
208
|
|
209
|
+
def self.ransackable_attributes(_auth_object = nil)
|
210
|
+
%w[published_at]
|
211
|
+
end
|
212
|
+
|
207
213
|
private
|
208
214
|
|
209
215
|
def files(model)
|
data/app/models/pageflow/site.rb
CHANGED
@@ -55,5 +55,13 @@ module Pageflow
|
|
55
55
|
def theme_name
|
56
56
|
first_paged_entry_template.theme_name
|
57
57
|
end
|
58
|
+
|
59
|
+
def self.ransackable_attributes(_auth_object = nil)
|
60
|
+
%w[name]
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.ransackable_associations(_auth_object = nil)
|
64
|
+
%w[account]
|
65
|
+
end
|
58
66
|
end
|
59
67
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Pageflow
|
2
|
+
# @api private
|
3
|
+
module Sitemaps
|
4
|
+
def self.entries_for(site:)
|
5
|
+
PublishedEntry.wrap_all(
|
6
|
+
site
|
7
|
+
.entries
|
8
|
+
.published_without_password_protection
|
9
|
+
.published_without_noindex
|
10
|
+
.order('first_published_at DESC')
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -10,9 +10,9 @@ module Pageflow
|
|
10
10
|
@usage.configuration
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
13
|
+
def update!(attributes)
|
14
14
|
super(attributes.except(:configuration))
|
15
|
-
@usage.
|
15
|
+
@usage.update!(attributes.slice(:configuration))
|
16
16
|
end
|
17
17
|
|
18
18
|
def usage_id
|
@@ -23,6 +23,14 @@ module Pageflow
|
|
23
23
|
@usage.perma_id
|
24
24
|
end
|
25
25
|
|
26
|
+
def cache_key
|
27
|
+
[@file.cache_key, @usage.cache_key].join('-')
|
28
|
+
end
|
29
|
+
|
30
|
+
def cache_key_with_version
|
31
|
+
[@file.cache_key_with_version, @usage.cache_key_with_version].join('-')
|
32
|
+
end
|
33
|
+
|
26
34
|
# Not delegated by default. Required to allow using instances in
|
27
35
|
# Active Record conditions.
|
28
36
|
|
@@ -2,6 +2,8 @@ module Pageflow
|
|
2
2
|
class VideoFileUrlTemplates
|
3
3
|
def call
|
4
4
|
{
|
5
|
+
original: url_template(:attachment, :original),
|
6
|
+
|
5
7
|
high: url_template(:mp4_high),
|
6
8
|
medium: url_template(:mp4_medium),
|
7
9
|
fullhd: url_template(:mp4_fullhd),
|
@@ -26,7 +28,7 @@ module Pageflow
|
|
26
28
|
|
27
29
|
def example_file
|
28
30
|
@example_file ||= VideoFile.new(id: 0).tap do |video_file|
|
29
|
-
video_file.file_name = ':basename
|
31
|
+
video_file.file_name = ':basename.:extension'
|
30
32
|
video_file.output_presences = {':pageflow_hls_qualities' => true}
|
31
33
|
video_file.poster_file_name = video_file.zencoder_poster.original_filename
|
32
34
|
end
|
@@ -72,7 +72,15 @@ module Pageflow
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def from_db_by_role
|
75
|
-
Widget.all
|
75
|
+
reject_unknown_widget_types(Widget.all)
|
76
|
+
.index_by(&:role)
|
77
|
+
end
|
78
|
+
|
79
|
+
def reject_unknown_widget_types(widgets)
|
80
|
+
widgets.select do |widget|
|
81
|
+
widget.type_name.blank? ||
|
82
|
+
config.widget_types.type_name?(widget.type_name)
|
83
|
+
end
|
76
84
|
end
|
77
85
|
|
78
86
|
def defaults_by_role
|
@@ -1,9 +1,12 @@
|
|
1
1
|
extensible_attributes_table_for(site,
|
2
2
|
Pageflow.config_for(site.account)
|
3
3
|
.admin_attributes_table_rows.for(:site)) do
|
4
|
+
row :title
|
4
5
|
row :host, class: 'host'
|
5
6
|
row :account, class: 'account' do
|
6
7
|
link_to(site.account.name,
|
7
8
|
admin_account_path(site.account, tab: 'sites'))
|
8
9
|
end
|
10
|
+
row :feeds_enabled
|
11
|
+
row :sitemap_enabled
|
9
12
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%= f.inputs do %>
|
2
|
+
<%= f.input :title, hint: t('pageflow.admin.sites.title_hint') %>
|
2
3
|
<%= f.input :cname, hint: t('pageflow.admin.sites.cname_hint') %>
|
3
4
|
<%= f.input :additional_cnames, hint: t('pageflow.admin.sites.additional_cnames_hint') %>
|
4
5
|
<%= f.input :home_url, hint: t('pageflow.admin.sites.home_url_hint') %>
|
@@ -11,6 +12,11 @@
|
|
11
12
|
<%= f.input :copyright_link_url %>
|
12
13
|
<%= f.input :privacy_link_url %>
|
13
14
|
|
15
|
+
<%= f.input :feeds_enabled, hint: t('pageflow.admin.sites.feeds_hint',
|
16
|
+
site_host: @site&.persisted? ? @site.host : '<host>') %>
|
17
|
+
<%= f.input :sitemap_enabled, hint: t('pageflow.admin.sites.sitemap_hint',
|
18
|
+
site_host: @site&.persisted? ? @site.host : '<host>') %>
|
19
|
+
|
14
20
|
<% account_config.admin_form_inputs.find_all_for(:site).each do |form_input| %>
|
15
21
|
<%= form_input.build(f) %>
|
16
22
|
<% end %>
|
@@ -78,8 +78,8 @@ module Pageflow
|
|
78
78
|
#
|
79
79
|
# This is also the reason we can not use SimpleDelegator here
|
80
80
|
# and also delegate_missing in Rails 5 would not work.
|
81
|
-
def method_missing(method, *args, &block)
|
82
|
-
@context.public_send(method, *args, &block)
|
81
|
+
def method_missing(method, *args, **kwargs, &block)
|
82
|
+
@context.public_send(method, *args, **kwargs, &block)
|
83
83
|
end
|
84
84
|
# rubocop:enable Style/MethodMissing
|
85
85
|
end
|
@@ -39,6 +39,14 @@ module Pageflow
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
if revision.noindex?
|
43
|
+
span(class: 'publication_state_indicator published_with_noindex') do
|
44
|
+
span(class: 'tooltip_bubble') do
|
45
|
+
t('pageflow.admin.entries.noindex')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
42
50
|
if revision.password_protected?
|
43
51
|
span(class: 'publication_state_indicator published_with_password_protection') do
|
44
52
|
span(class: 'tooltip_bubble') do
|
@@ -1,8 +1,10 @@
|
|
1
1
|
json.key_format!(camelize: :lower)
|
2
2
|
json.call(Pageflow.config,
|
3
3
|
:confirm_encoding_jobs,
|
4
|
+
:default_published_until_duration_in_months,
|
4
5
|
:available_locales,
|
5
6
|
:available_public_locales,
|
7
|
+
:available_file_licenses,
|
6
8
|
:available_text_track_kinds,
|
7
9
|
:available_share_providers)
|
8
10
|
json.file_types Pageflow.config_for(entry).file_types do |file_type|
|
@@ -6,6 +6,7 @@ json.default_file_rights entry.account.default_file_rights
|
|
6
6
|
json.published(entry.published?)
|
7
7
|
json.publishable(can?(:publish, entry.to_model))
|
8
8
|
json.password_protected(entry.password_digest.present?)
|
9
|
+
json.last_published_with_noindex(entry.last_published_with_noindex?)
|
9
10
|
|
10
11
|
json.metadata do
|
11
12
|
json.(entry,
|
@@ -6,6 +6,7 @@ json.entry do
|
|
6
6
|
json.(@entry_publication.entry, :published_until)
|
7
7
|
json.published(@entry_publication.entry.published?)
|
8
8
|
json.password_protected(@entry_publication.entry.password_digest.present?)
|
9
|
+
json.last_published_with_noindex(@entry_publication.entry.last_published_with_noindex?)
|
9
10
|
end
|
10
11
|
json.exhausted_html(render_html_partial('pageflow/editor/quotas/published_entries_exhausted',
|
11
12
|
entry: @entry_publication.entry,
|
@@ -0,0 +1,20 @@
|
|
1
|
+
atom_feed language: @feed.locale,
|
2
|
+
root_url: @feed.root_url,
|
3
|
+
url: @feed.custom_url do |feed|
|
4
|
+
feed.title(@feed.title)
|
5
|
+
feed.updated(@feed.updated_at&.utc)
|
6
|
+
|
7
|
+
@feed.entries.each do |entry|
|
8
|
+
feed.entry(entry,
|
9
|
+
url: social_share_entry_url(entry),
|
10
|
+
published: entry.first_published_at.utc,
|
11
|
+
updated: entry.published_at.utc) do |feed_entry|
|
12
|
+
feed_entry.title(entry.title)
|
13
|
+
feed_entry.content(feed_entry_content(entry), type: 'html')
|
14
|
+
|
15
|
+
feed_entry.author do |author|
|
16
|
+
author.name(entry.author)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -2,3 +2,4 @@
|
|
2
2
|
<% if keywords.present? %><meta name="keywords" content="<%= keywords %>"><% end %>
|
3
3
|
<% if author.present? %><meta name="author" content="<%= author %>"><% end %>
|
4
4
|
<% if publisher.present? %><meta name="publisher" content="<%= publisher %>"><% end %>
|
5
|
+
<% if noindex %><meta name="robots" content="noindex"><% end %>
|
@@ -1,4 +1,7 @@
|
|
1
1
|
Pageflow.configure do |config|
|
2
|
+
config.features.register('webp_images')
|
2
3
|
config.features.register('highdef_video_encoding')
|
4
|
+
config.features.register('force_fullhd_video_quality')
|
5
|
+
config.features.register('large_player_pool')
|
3
6
|
config.features.register('selectable_themes')
|
4
7
|
end
|
@@ -1,3 +1,8 @@
|
|
1
|
+
require 'pageflow/paperclip_processors/vtt'
|
2
|
+
require 'pageflow/paperclip_processors/audio_waveform'
|
3
|
+
require 'pageflow/paperclip_processors/webp'
|
4
|
+
require 'pageflow/paperclip_processors/noop'
|
5
|
+
|
1
6
|
Paperclip.interpolates(:pageflow_s3_root) do |_attachment, _style|
|
2
7
|
Pageflow.config.paperclip_s3_root
|
3
8
|
end
|
@@ -29,6 +34,9 @@ Paperclip.interpolates(:pageflow_hls_qualities) do |attachment, _style|
|
|
29
34
|
end
|
30
35
|
|
31
36
|
Paperclip.configure do |config|
|
37
|
+
config.register_processor(:pageflow_webp,
|
38
|
+
Pageflow::PaperclipProcessors::Webp)
|
39
|
+
|
32
40
|
config.register_processor(:pageflow_vtt,
|
33
41
|
Pageflow::PaperclipProcessors::Vtt)
|
34
42
|
|