pageflow 12.6.0 → 13.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +78 -16
- data/README.md +8 -1
- data/Rakefile +0 -4
- data/admins/pageflow/accounts.rb +6 -9
- data/admins/pageflow/entry.rb +1 -1
- data/admins/pageflow/folder.rb +1 -1
- data/admins/pageflow/user.rb +4 -4
- data/app/assets/javascripts/pageflow/asset_urls.js.erb +1 -1
- data/app/assets/javascripts/pageflow/audio/multi_player.js +0 -4
- data/app/assets/javascripts/pageflow/audio_player.js +1 -1
- data/app/assets/javascripts/pageflow/base.js +0 -2
- data/app/assets/javascripts/pageflow/browser/agent.js +78 -92
- data/app/assets/javascripts/pageflow/browser/autoplay_support.js +2 -2
- data/app/assets/javascripts/pageflow/browser/video.js +1 -6
- data/app/assets/javascripts/pageflow/dist/react.js +1100 -2209
- data/app/assets/javascripts/pageflow/editor/models/configuration.js +5 -5
- data/app/assets/javascripts/pageflow/editor/templates/background_positioning_sliders.jst.ejs +0 -8
- data/app/assets/javascripts/pageflow/editor/views/background_positioning_sliders_view.js +23 -37
- data/app/assets/javascripts/pageflow/editor/views/background_positioning_view.js +2 -2
- data/app/assets/javascripts/pageflow/editor/views/configuration_editors/video.js +1 -1
- data/app/assets/javascripts/pageflow/editor/views/edit_widget_view.js +0 -9
- data/app/assets/javascripts/pageflow/jquery_utils.js +0 -10
- data/app/assets/javascripts/pageflow/media_player.js +3 -7
- data/app/assets/javascripts/pageflow/media_player/catch_play_promise.js +23 -0
- data/app/assets/javascripts/pageflow/media_player/volume_binding.js +1 -2
- data/app/assets/javascripts/pageflow/media_player/volume_fading/web_audio.js +24 -73
- data/app/assets/javascripts/pageflow/ready.js +1 -2
- data/app/assets/javascripts/pageflow/seed_entry_data.js +3 -3
- data/app/assets/javascripts/pageflow/slideshow.js +9 -17
- data/app/assets/javascripts/pageflow/slideshow/adjacent_pages.js +4 -9
- data/app/assets/javascripts/pageflow/slideshow/{successor_preparer.js → adjacent_preparer.js} +11 -14
- data/app/assets/javascripts/pageflow/slideshow/atmo.js +12 -23
- data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +2 -2
- data/app/assets/javascripts/pageflow/slideshow/progressive_preload.js +42 -0
- data/app/assets/javascripts/pageflow/ui/views/configuration_editor_view.js +2 -2
- data/app/assets/javascripts/pageflow/video_player/filter_sources.js +2 -16
- data/app/assets/javascripts/pageflow/video_player/lazy.js +1 -1
- data/app/assets/javascripts/pageflow/visited.js +0 -2
- data/app/assets/javascripts/pageflow/widgets.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/multimedia_alert.js +1 -2
- data/app/assets/javascripts/pageflow/widgets/navigation.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/navigation_mobile.js +0 -1
- data/app/assets/javascripts/pageflow/widgets/overview.js +1 -3
- data/app/assets/stylesheets/pageflow/admin.scss +2 -0
- data/app/assets/stylesheets/pageflow/admin/status_tags.scss +13 -0
- data/app/assets/stylesheets/pageflow/editor/background_positioning.scss +10 -34
- data/app/assets/stylesheets/pageflow/navigation_bar.scss +4 -0
- data/app/assets/stylesheets/pageflow/page_types/video.scss +4 -1
- data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +0 -5
- data/app/assets/stylesheets/pageflow/themes/default/base.scss +0 -2
- data/app/assets/stylesheets/pageflow/themes/default/overview/icons/icon_font.scss +1 -4
- data/app/assets/stylesheets/pageflow/themes/default/page.scss +0 -19
- data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +0 -4
- data/app/assets/stylesheets/pageflow/themes/default/slideshow.scss +0 -1
- data/app/controllers/concerns/pageflow/edit_locking.rb +2 -2
- data/app/controllers/concerns/pageflow/public_https_mode.rb +1 -5
- data/app/controllers/concerns/pageflow/quota_verification.rb +1 -1
- data/app/controllers/pageflow/application_controller.rb +2 -2
- data/app/controllers/pageflow/chapters_controller.rb +2 -2
- data/app/controllers/pageflow/edit_locks_controller.rb +1 -1
- data/app/controllers/pageflow/editor/encoding_confirmations_controller.rb +1 -1
- data/app/controllers/pageflow/editor/entries_controller.rb +1 -1
- data/app/controllers/pageflow/editor/entry_publications_controller.rb +1 -1
- data/app/controllers/pageflow/editor/files_controller.rb +1 -1
- data/app/controllers/pageflow/entries_controller.rb +5 -11
- data/app/controllers/pageflow/files_controller.rb +1 -1
- data/app/controllers/pageflow/pages_controller.rb +2 -2
- data/app/controllers/pageflow/revisions_controller.rb +1 -1
- data/app/controllers/pageflow/storylines_controller.rb +2 -3
- data/app/helpers/pageflow/common_entry_seed_helper.rb +0 -1
- data/app/helpers/pageflow/entries_helper.rb +6 -31
- data/app/helpers/pageflow/entry_json_seed_helper.rb +1 -1
- data/app/helpers/pageflow/public_i18n_helper.rb +1 -6
- data/app/jobs/pageflow/application_job.rb +6 -0
- data/app/jobs/pageflow/poll_meta_data_from_zencoder_job.rb +2 -4
- data/app/jobs/pageflow/poll_zencoder_job.rb +8 -8
- data/app/jobs/pageflow/process_file_job.rb +4 -4
- data/app/jobs/pageflow/prune_auto_snapshots_job.rb +3 -3
- data/app/jobs/pageflow/request_meta_data_from_zencoder_job.rb +4 -4
- data/app/jobs/pageflow/submit_file_to_zencoder_job.rb +4 -4
- data/app/jobs/pageflow/upload_file_to_s3_job.rb +5 -5
- data/app/mailers/pageflow/user_mailer.rb +1 -15
- data/app/models/concerns/pageflow/uploaded_file.rb +3 -3
- data/app/models/pageflow/audio_file.rb +1 -1
- data/app/models/pageflow/chapter.rb +1 -1
- data/app/models/pageflow/entry.rb +1 -1
- data/app/models/pageflow/invited_user.rb +1 -1
- data/app/models/pageflow/membership.rb +4 -2
- data/app/models/pageflow/page.rb +1 -1
- data/app/models/pageflow/published_entry.rb +3 -4
- data/app/models/pageflow/revision.rb +5 -3
- data/app/models/pageflow/storyline.rb +5 -1
- data/app/models/pageflow/theming.rb +1 -2
- data/app/models/pageflow/used_file.rb +12 -0
- data/app/models/pageflow/video_file.rb +1 -1
- data/app/views/admin/accounts/_form.html.erb +0 -8
- data/app/views/admin/accounts/_theming_details.html.arb +0 -3
- data/app/views/pageflow/entries/_mobile_navigation.html.erb +3 -2
- data/app/views/pageflow/entries/navigation/_page.html.erb +1 -3
- data/app/views/pageflow/entries/overview/_page.html.erb +1 -1
- data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -1
- data/app/views/pageflow/user_mailer/invitation.html.erb +2 -2
- data/app/views/pageflow/user_mailer/invitation.text.erb +1 -1
- data/config/locales/de.yml +6 -16
- data/config/locales/en.yml +8 -18
- data/config/routes.rb +0 -6
- data/db/migrate/20140418225525_setup_schema.rb +295 -203
- data/db/migrate/20140418240000_add_attributes_to_users.rb +3 -6
- data/lib/generators/pageflow/resque/resque_generator.rb +6 -3
- data/lib/pageflow.rb +1 -1
- data/lib/pageflow/ability_mixin.rb +0 -1
- data/lib/pageflow/active_admin_patches/views/attributes_table.rb +1 -1
- data/lib/pageflow/active_admin_patches/views/table_for.rb +1 -1
- data/lib/pageflow/built_in_widget_type.rb +0 -8
- data/lib/pageflow/built_in_widget_types_plugin.rb +0 -2
- data/lib/pageflow/configuration.rb +0 -10
- data/lib/pageflow/engine.rb +5 -9
- data/lib/pageflow/user_mixin.rb +5 -0
- data/lib/pageflow/version.rb +1 -1
- data/lib/tasks/pageflow_tasks.rake +1 -11
- data/spec/factories/accounts.rb +1 -1
- data/spec/factories/audio_files.rb +1 -1
- data/spec/factories/chapters.rb +1 -3
- data/spec/factories/edit_locks.rb +2 -4
- data/spec/factories/entries.rb +1 -1
- data/spec/factories/feature_targets.rb +1 -1
- data/spec/factories/file_usages.rb +1 -1
- data/spec/factories/folders.rb +1 -1
- data/spec/factories/hosted_files.rb +6 -6
- data/spec/factories/image_files.rb +1 -1
- data/spec/factories/invited_user.rb +1 -1
- data/spec/factories/memberships.rb +1 -1
- data/spec/factories/pages.rb +1 -1
- data/spec/factories/revisions.rb +1 -1
- data/spec/factories/storylines.rb +1 -1
- data/spec/factories/text_track_files.rb +1 -1
- data/spec/factories/themings.rb +1 -1
- data/spec/factories/users.rb +1 -1
- data/spec/factories/video_files.rb +1 -1
- data/spec/factories/widgets.rb +1 -1
- data/vendor/assets/javascripts/audio5.min.js +129 -280
- metadata +103 -219
- data/app/assets/audios/pageflow/unmute.mp3 +0 -0
- data/app/assets/javascripts/pageflow/background_media.js +0 -22
- data/app/assets/javascripts/pageflow/cookie_notice.js +0 -7
- data/app/assets/javascripts/pageflow/editor/views/info_box_view.js +0 -8
- data/app/assets/javascripts/pageflow/editor/views/widget_types/cookie_notice_bar.js +0 -15
- data/app/assets/javascripts/pageflow/media_player/handle_failed_play.js +0 -34
- data/app/assets/javascripts/pageflow/slideshow/adjacent_preloader.js +0 -26
- data/app/assets/stylesheets/pageflow/page_types/video/mobile_poster.scss +0 -15
- data/app/assets/stylesheets/pageflow/themes/default/background_media_unmute_button.scss +0 -77
- data/app/assets/stylesheets/pageflow/themes/default/cookie_notice_bar.scss +0 -57
- data/app/assets/stylesheets/pageflow/themes/default/page/hyphenate.scss +0 -24
- data/app/controllers/pageflow/admin/initial_passwords_controller.rb +0 -8
- data/app/views/pageflow/admin/initial_passwords/edit.html.erb +0 -16
- data/app/views/pageflow/entries/mobile_navigation/_page.html.erb +0 -5
- data/db/migrate/20140624135420_create_themings.rb +0 -15
- data/db/migrate/20140624135421_create_themings_for_existing_accounts.rb +0 -26
- data/db/migrate/20140624135422_change_theme_references_to_theming_references.rb +0 -45
- data/db/migrate/20140624135423_remove_attributes_from_themes.rb +0 -10
- data/db/migrate/20140624135424_create_accounts_themes_join_table.rb +0 -8
- data/db/migrate/20140624135425_move_cname_from_account_to_theming.rb +0 -21
- data/db/migrate/20140625184800_drop_themes.rb +0 -14
- data/db/migrate/20140704110631_add_confirmed_by_to_encoded_files.rb +0 -6
- data/db/migrate/20140819081454_add_home_url_attributes_to_themings_and_revisions.rb +0 -9
- data/db/migrate/20141027102310_create_widgets.rb +0 -11
- data/db/migrate/20141028125408_add_emphasize_chapter_beginning_to_revisions.rb +0 -5
- data/db/migrate/20141119164526_add_emphasize_new_pages_to_revisions.rb +0 -5
- data/db/migrate/20141119174032_add_sharing_image_to_revisions.rb +0 -7
- data/db/migrate/20141128150305_add_locale_to_users.rb +0 -5
- data/db/migrate/20141208161030_add_locale_to_revisions.rb +0 -5
- data/db/migrate/20141211110226_add_configuration_to_chapters.rb +0 -5
- data/db/migrate/20150115175116_add_features_configuration_to_accounts.rb +0 -5
- data/db/migrate/20150115175207_add_features_configuration_to_entries.rb +0 -5
- data/db/migrate/20150603091823_add_password_attributes_to_revisions.rb +0 -6
- data/db/migrate/20150825133449_update_audio_loop_pages_to_use_atmo.rb +0 -24
- data/db/migrate/20150826125417_create_pageflow_storylines.rb +0 -12
- data/db/migrate/20150826125744_add_storyline_id_to_chapters.rb +0 -6
- data/db/migrate/20150826125745_insert_main_storylines.rb +0 -28
- data/db/migrate/20150830105831_remove_revision_id_from_chapters.rb +0 -5
- data/db/migrate/20150830110006_remove_entry_id_from_chapters.rb +0 -5
- data/db/migrate/20151022080518_add_first_published_at_to_entries.rb +0 -14
- data/db/migrate/20160131222203_add_cache_counters.rb +0 -23
- data/db/migrate/20160201130118_add_additional_cnames_to_themings.rb +0 -5
- data/db/migrate/20160216130336_add_meta_fields_to_revision.rb +0 -7
- data/db/migrate/20160225075853_add_overview_button_enabled_to_revisions.rb +0 -5
- data/db/migrate/20160304072911_rename_membership_entry_and_make_polymorphic.rb +0 -19
- data/db/migrate/20160304151327_add_role_to_membership.rb +0 -19
- data/db/migrate/20160310080213_add_edited_at_to_entries.rb +0 -9
- data/db/migrate/20160425192648_add_index_for_revision_publication_timestamps.rb +0 -5
- data/db/migrate/20160504093145_replace_role_and_account_on_user.rb +0 -42
- data/db/migrate/20160531152500_update_users_count.rb +0 -27
- data/db/migrate/20160617123557_add_meta_fields_to_theming.rb +0 -7
- data/db/migrate/20160707125400_add_output_presences_to_video_files.rb +0 -5
- data/db/migrate/20160715105408_add_share_url_to_revisions.rb +0 -5
- data/db/migrate/20160824115000_add_parent_file_to_video_files.rb +0 -8
- data/db/migrate/20160824115100_add_parent_file_to_audio_files.rb +0 -8
- data/db/migrate/20160824115200_add_parent_file_to_image_files.rb +0 -8
- data/db/migrate/20160929102700_add_configuration_to_files.rb +0 -7
- data/db/migrate/20161007144500_add_text_track_files.rb +0 -31
- data/db/migrate/20161216175734_move_configuration_from_file_to_file_usage.rb +0 -27
- data/db/migrate/20161230144429_add_processed_attachment_to_text_track_files.rb +0 -8
- data/db/migrate/20170201074328_add_configuration_to_widgets.rb +0 -5
- data/db/migrate/20170222124848_update_video_file_output_presences.rb +0 -12
- data/db/migrate/20170315130000_add_theme_name_to_revisions.rb +0 -12
- data/db/migrate/20170421112300_turn_background_video_pages_into_background_image_pages.rb +0 -22
- data/db/migrate/20170912165050_reset_copied_snapshot_type.rb +0 -24
- data/db/migrate/20170913105048_fix_hls_output_presences_for_legacy_video_files.rb +0 -12
- data/db/migrate/20180528144334_add_privacy_link_url_to_themings.rb +0 -5
- data/db/migrate/20190109085744_add_default_locale_to_themings.rb +0 -6
- data/lib/generators/pageflow/resque/templates/devise_async.rb +0 -6
- data/lib/generators/pageflow/resque/templates/resque_logger.rb +0 -16
- data/lib/generators/pageflow/resque/templates/resque_mailer.rb +0 -4
- data/lib/pageflow/primary_domain_entry_redirect.rb +0 -25
@@ -1,9 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
2
|
class PollMetaDataFromZencoderJob < PollZencoderJob
|
3
|
-
|
4
|
-
|
5
|
-
def self.perform_with_result(file, options)
|
6
|
-
super(file, :skip_thumbnail => true)
|
3
|
+
def perform_with_result(file, _options)
|
4
|
+
super(file, skip_thumbnail: true)
|
7
5
|
end
|
8
6
|
end
|
9
7
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class PollZencoderJob
|
3
|
-
|
2
|
+
class PollZencoderJob < ApplicationJob
|
3
|
+
queue_as :resizing
|
4
4
|
|
5
|
-
|
5
|
+
include StateMachineJob
|
6
6
|
|
7
|
-
def
|
7
|
+
def perform_with_result(file, options, api = ZencoderApi.instance)
|
8
8
|
options ||= {}
|
9
9
|
|
10
|
-
|
10
|
+
catch(:halt) do
|
11
11
|
poll_zencoder(file, api)
|
12
12
|
fetch_input_details(file, api)
|
13
13
|
fetch_thumbnail(file) unless options[:skip_thumbnail]
|
@@ -20,7 +20,7 @@ module Pageflow
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
def
|
23
|
+
def poll_zencoder(file, api)
|
24
24
|
info = api.get_info(file.job_id)
|
25
25
|
|
26
26
|
file.encoding_progress = info[:finished] ? 100 : info[:progress];
|
@@ -39,7 +39,7 @@ module Pageflow
|
|
39
39
|
raise
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def fetch_thumbnail(file)
|
43
43
|
return unless file.respond_to?(:thumbnail)
|
44
44
|
file.thumbnail = URI.parse(file.zencoder_thumbnail.url(default_protocol: 'http'))
|
45
45
|
file.poster = URI.parse(file.zencoder_poster.url(default_protocol: 'http'))
|
@@ -47,7 +47,7 @@ module Pageflow
|
|
47
47
|
throw(:halt, :pending)
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
50
|
+
def fetch_input_details(file, api)
|
51
51
|
file.meta_data_attributes = api.get_details(file.job_id)
|
52
52
|
rescue ZencoderApi::RecoverableError => e
|
53
53
|
file.encoding_error_message = e.message
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class ProcessFileJob
|
3
|
-
|
2
|
+
class ProcessFileJob < ApplicationJob
|
3
|
+
queue_as :resizing
|
4
4
|
|
5
|
-
|
5
|
+
include StateMachineJob
|
6
6
|
|
7
|
-
def
|
7
|
+
def perform_with_result(file, _options)
|
8
8
|
file.processed_attachment = file.unprocessed_attachment
|
9
9
|
file.save!
|
10
10
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class PruneAutoSnapshotsJob
|
3
|
-
|
2
|
+
class PruneAutoSnapshotsJob < ApplicationJob
|
3
|
+
queue_as :prune
|
4
4
|
|
5
|
-
def
|
5
|
+
def perform(entry_id, options)
|
6
6
|
AutoSnapshotPruning.prune(Entry.find(entry_id), options.symbolize_keys)
|
7
7
|
end
|
8
8
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class RequestMetaDataFromZencoderJob
|
3
|
-
|
2
|
+
class RequestMetaDataFromZencoderJob < ApplicationJob
|
3
|
+
queue_as :default
|
4
4
|
|
5
|
-
|
5
|
+
include StateMachineJob
|
6
6
|
|
7
|
-
def
|
7
|
+
def perform_with_result(file, _options, api = ZencoderApi.instance)
|
8
8
|
file.job_id = api.create_job(ZencoderMetaDataOutputDefinition.new(file))
|
9
9
|
file.save!
|
10
10
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class SubmitFileToZencoderJob
|
3
|
-
|
2
|
+
class SubmitFileToZencoderJob < ApplicationJob
|
3
|
+
queue_as :default
|
4
4
|
|
5
|
-
|
5
|
+
include StateMachineJob
|
6
6
|
|
7
|
-
def
|
7
|
+
def perform_with_result(file, _options, api = ZencoderApi.instance)
|
8
8
|
file.job_id = api.create_job(file.output_definition)
|
9
9
|
file.save!
|
10
10
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module Pageflow
|
2
|
-
class UploadFileToS3Job
|
3
|
-
|
2
|
+
class UploadFileToS3Job < ApplicationJob
|
3
|
+
queue_as :slow
|
4
4
|
|
5
|
-
|
5
|
+
include StateMachineJob
|
6
6
|
|
7
|
-
def
|
7
|
+
def perform_with_result(file, _options = {})
|
8
8
|
if file && file.attachment_on_filesystem.file?
|
9
|
-
if File.
|
9
|
+
if File.exist?(file.attachment_on_filesystem.path)
|
10
10
|
file.attachment_on_s3 = file.attachment_on_filesystem
|
11
11
|
file.save!
|
12
12
|
|
@@ -1,21 +1,7 @@
|
|
1
1
|
module Pageflow
|
2
2
|
class UserMailer < ActionMailer::Base
|
3
|
-
include Resque::Mailer
|
4
|
-
|
5
3
|
def invitation(options)
|
6
|
-
|
7
|
-
#
|
8
|
-
# - Hash with string keys (<= 2.4.0)
|
9
|
-
# - Hash with symbol keys (2.4.1)
|
10
|
-
# - Hash with both string and symbol keys (2.4.2)
|
11
|
-
# - HashWithIndifferentAccess (2.4.3)
|
12
|
-
#
|
13
|
-
# Symbolize keys to support 2.4.1, but do not use bang version
|
14
|
-
# (i.e. `smbolize_keys!`) since that is not supported by
|
15
|
-
# HashWithIndifferentAccess.
|
16
|
-
options = options.symbolize_keys
|
17
|
-
|
18
|
-
@user = User.find(options[:user_id])
|
4
|
+
@user = options[:user]
|
19
5
|
@password_token = options[:password_token]
|
20
6
|
|
21
7
|
I18n.with_locale(@user.locale) do
|
@@ -3,9 +3,9 @@ module Pageflow
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
belongs_to :uploader, :
|
7
|
-
belongs_to :entry
|
8
|
-
belongs_to :parent_file, polymorphic: true, foreign_type: :parent_file_model_type
|
6
|
+
belongs_to :uploader, class_name: 'User', optional: true
|
7
|
+
belongs_to :entry, optional: true
|
8
|
+
belongs_to :parent_file, polymorphic: true, foreign_type: :parent_file_model_type, optional: true
|
9
9
|
|
10
10
|
has_many :usages, :as => :file, :class_name => 'Pageflow::FileUsage', :dependent => :destroy
|
11
11
|
has_many :using_revisions, :through => :usages, :source => :revision
|
@@ -3,7 +3,7 @@ module Pageflow
|
|
3
3
|
include HostedFile
|
4
4
|
include EncodedFileStateMachine
|
5
5
|
|
6
|
-
belongs_to :confirmed_by, :
|
6
|
+
belongs_to :confirmed_by, class_name: 'User', optional: true
|
7
7
|
|
8
8
|
def attachment_s3_url
|
9
9
|
"s3://#{File.join(attachment_on_s3.bucket_name, attachment_on_s3.path)}"
|
@@ -3,7 +3,7 @@ module Pageflow
|
|
3
3
|
include SerializedConfiguration
|
4
4
|
|
5
5
|
belongs_to :storyline, touch: true
|
6
|
-
has_many :pages, -> { order('position ASC') }, dependent: :destroy
|
6
|
+
has_many :pages, -> { order('position ASC') }, dependent: :destroy, inverse_of: :chapter
|
7
7
|
|
8
8
|
delegate :entry, to: :storyline
|
9
9
|
|
@@ -11,7 +11,7 @@ module Pageflow
|
|
11
11
|
friendly_id :slug_candidates, :use => [:finders, :slugged]
|
12
12
|
|
13
13
|
belongs_to :account, counter_cache: true
|
14
|
-
belongs_to :folder
|
14
|
+
belongs_to :folder, optional: true
|
15
15
|
belongs_to :theming
|
16
16
|
|
17
17
|
has_many :revisions, -> { order('frozen_at DESC') }
|
@@ -4,10 +4,12 @@ module Pageflow
|
|
4
4
|
belongs_to :entity, polymorphic: true
|
5
5
|
belongs_to :entry,
|
6
6
|
-> { where(pageflow_memberships: {entity_type: 'Pageflow::Entry'}) },
|
7
|
-
foreign_key: 'entity_id'
|
7
|
+
foreign_key: 'entity_id',
|
8
|
+
optional: true
|
8
9
|
belongs_to :account,
|
9
10
|
-> { where(pageflow_memberships: {entity_type: 'Pageflow::Account'}) },
|
10
|
-
foreign_key: 'entity_id'
|
11
|
+
foreign_key: 'entity_id',
|
12
|
+
optional: true
|
11
13
|
|
12
14
|
validates :user, :entity, :role, presence: true
|
13
15
|
validates :user_id, uniqueness: {scope: [:entity_type, :entity_id]}
|
data/app/models/pageflow/page.rb
CHANGED
@@ -42,7 +42,7 @@ module Pageflow
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def stylesheet_cache_key
|
45
|
-
revision.
|
45
|
+
revision.cache_key_with_version
|
46
46
|
end
|
47
47
|
|
48
48
|
def thumbnail_url(*args)
|
@@ -59,9 +59,8 @@ module Pageflow
|
|
59
59
|
PublishedEntry.new(scope.published.find(id))
|
60
60
|
end
|
61
61
|
|
62
|
-
def
|
63
|
-
"#{
|
64
|
-
"#{entry.cache_key}-#{revision.cache_key}-#{theming.cache_key}"
|
62
|
+
def cache_version
|
63
|
+
"#{entry.cache_version}-#{revision.cache_version}-#{theming.cache_version}"
|
65
64
|
end
|
66
65
|
|
67
66
|
def home_button
|
@@ -9,8 +9,8 @@ module Pageflow
|
|
9
9
|
include ThemeReferencer
|
10
10
|
|
11
11
|
belongs_to :entry, touch: :edited_at
|
12
|
-
belongs_to :creator, :
|
13
|
-
belongs_to :restored_from, :
|
12
|
+
belongs_to :creator, class_name: 'User', optional: true
|
13
|
+
belongs_to :restored_from, class_name: 'Pageflow::Revision', optional: true
|
14
14
|
|
15
15
|
has_many :widgets, as: :subject, dependent: :destroy
|
16
16
|
|
@@ -44,7 +44,9 @@ module Pageflow
|
|
44
44
|
scope :auto_snapshots, -> { where(snapshot_type: 'auto') }
|
45
45
|
|
46
46
|
validates :entry, :presence => true
|
47
|
-
|
47
|
+
|
48
|
+
# Workaround for https://github.com/rails/rails/issues/33445
|
49
|
+
validates_with ActiveModel::Validations::PresenceValidator, attributes: [:creator], if: :published?
|
48
50
|
|
49
51
|
validate :published_until_unchanged, :if => :published_until_was_in_past?
|
50
52
|
validate :published_until_blank, :if => :published_at_blank?
|
@@ -5,7 +5,11 @@ module Pageflow
|
|
5
5
|
|
6
6
|
belongs_to :revision, touch: true
|
7
7
|
|
8
|
-
has_many
|
8
|
+
has_many(:chapters,
|
9
|
+
-> { order('pageflow_chapters.position ASC') },
|
10
|
+
dependent: :destroy,
|
11
|
+
inverse_of: :storyline)
|
12
|
+
|
9
13
|
has_many :pages, through: :chapters
|
10
14
|
|
11
15
|
delegate :entry, to: :revision
|
@@ -37,8 +37,7 @@ module Pageflow
|
|
37
37
|
publisher: default_publisher.presence || Pageflow.config.default_publisher_meta_tag,
|
38
38
|
keywords: default_keywords.presence || Pageflow.config.default_keywords_meta_tag,
|
39
39
|
theme_name: theme_name,
|
40
|
-
home_button_enabled: home_button_enabled_by_default
|
41
|
-
locale: default_locale
|
40
|
+
home_button_enabled: home_button_enabled_by_default
|
42
41
|
)
|
43
42
|
end
|
44
43
|
|
@@ -2,6 +2,7 @@ module Pageflow
|
|
2
2
|
class UsedFile < SimpleDelegator
|
3
3
|
def initialize(file, usage = nil)
|
4
4
|
super(file)
|
5
|
+
@file = file
|
5
6
|
@usage = usage || file.usages.first
|
6
7
|
end
|
7
8
|
|
@@ -17,5 +18,16 @@ module Pageflow
|
|
17
18
|
def usage_id
|
18
19
|
@usage.id
|
19
20
|
end
|
21
|
+
|
22
|
+
# Not delegated by default. Required to allow using instances in
|
23
|
+
# Active Record conditions.
|
24
|
+
|
25
|
+
def is_a?(klass)
|
26
|
+
@file.is_a?(klass)
|
27
|
+
end
|
28
|
+
|
29
|
+
def class
|
30
|
+
@file.class
|
31
|
+
end
|
20
32
|
end
|
21
33
|
end
|
@@ -4,7 +4,7 @@ module Pageflow
|
|
4
4
|
include EncodedFileStateMachine
|
5
5
|
include OutputSource
|
6
6
|
|
7
|
-
belongs_to :confirmed_by, :
|
7
|
+
belongs_to :confirmed_by, class_name: 'User', optional: true
|
8
8
|
|
9
9
|
has_attached_file(:poster, Pageflow.config.paperclip_s3_default_options
|
10
10
|
.merge(default_url: ':pageflow_placeholder',
|
@@ -18,13 +18,6 @@
|
|
18
18
|
<% end %>
|
19
19
|
|
20
20
|
<%= f.inputs do %>
|
21
|
-
<%= theming.input :default_locale,
|
22
|
-
as: :select,
|
23
|
-
include_blank: false,
|
24
|
-
collection: Pageflow.config.available_public_locales.map{ |locale|
|
25
|
-
[t('pageflow.public._language', locale: locale), locale.to_s]
|
26
|
-
},
|
27
|
-
hint: t('pageflow.admin.themings.default_locale_hint') %>
|
28
21
|
<%= theming.input :default_author,
|
29
22
|
hint: t('pageflow.admin.themings.default_author_hint'),
|
30
23
|
placeholder: Pageflow.config.default_author_meta_tag %>
|
@@ -41,7 +34,6 @@
|
|
41
34
|
<%= theming.input :imprint_link_url %>
|
42
35
|
<%= theming.input :copyright_link_label %>
|
43
36
|
<%= theming.input :copyright_link_url %>
|
44
|
-
<%= theming.input :privacy_link_url %>
|
45
37
|
|
46
38
|
<% account_config.admin_form_inputs.find_all_for(:theming).each do |form_input| %>
|
47
39
|
<%= form_input.build(theming) %>
|
@@ -5,9 +5,6 @@ extensible_attributes_table_for(account.default_theming,
|
|
5
5
|
row :theme, class: 'theme' do
|
6
6
|
account.default_theming.theme.name
|
7
7
|
end
|
8
|
-
row :default_locale, class: 'default_locale' do
|
9
|
-
t('pageflow.public._language', locale: account.default_theming.default_locale)
|
10
|
-
end
|
11
8
|
row :default_author, class: 'default_author'
|
12
9
|
row :default_publisher, class: 'default_publisher'
|
13
10
|
row :default_keywords, class: 'default_keywords'
|
@@ -7,8 +7,9 @@
|
|
7
7
|
<span class="heading-1"><%= t('pageflow.public.overview') %></span>
|
8
8
|
<div class="wrapper">
|
9
9
|
<ul class="pages">
|
10
|
-
<%= render :partial => 'pageflow/entries/
|
11
|
-
:collection => entry_mobile_navigation_pages(entry)
|
10
|
+
<%= render :partial => 'pageflow/entries/navigation/page',
|
11
|
+
:collection => entry_mobile_navigation_pages(entry),
|
12
|
+
:locals => {:image_style => :thumbnail_overview_mobile, :image_width => nil} %>
|
12
13
|
</ul>
|
13
14
|
</div>
|
14
15
|
</div>
|
@@ -4,8 +4,6 @@
|
|
4
4
|
<% end %>
|
5
5
|
<div class="navigation_site_detail">
|
6
6
|
<%= page.title %>
|
7
|
-
<div class="thumbnail is_<%= page.template %>">
|
8
|
-
<%= image_tag('', data: {src: asset_path(page.thumbnail_url(:navigation_thumbnail_large))}) %>
|
9
|
-
</div>
|
7
|
+
<div class="thumbnail is_<%= page.template %>" style="background-image: url('<%= asset_path(page.thumbnail_url(:navigation_thumbnail_large)) %>')"></div>
|
10
8
|
</div>
|
11
9
|
</li>
|
@@ -4,6 +4,6 @@
|
|
4
4
|
<%= overview_page_description(page) %>
|
5
5
|
</p>
|
6
6
|
</div>
|
7
|
-
<%= image_tag(
|
7
|
+
<%= image_tag("#{page.thumbnail_url(:thumbnail_overview_desktop)}") %>
|
8
8
|
<div class="pictogram"></div>
|
9
9
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
<p><%= t('.instruction') %></p>
|
4
4
|
|
5
|
-
<p><%= link_to
|
6
|
-
|
5
|
+
<p><%= link_to main_app.edit_user_password_url(@user, reset_password_token: @password_token),
|
6
|
+
main_app.edit_user_password_url(@user, reset_password_token: @password_token) %></p>
|
7
7
|
|
8
8
|
<p><%= t('.ending') %></p>
|
9
9
|
|