pageflow 12.0.4 → 12.1.0

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

Potentially problematic release.


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

Files changed (217) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +158 -374
  3. data/README.md +24 -3
  4. data/Rakefile +2 -2
  5. data/admins/pageflow/accounts.rb +30 -4
  6. data/admins/pageflow/entry.rb +59 -9
  7. data/admins/pageflow/membership.rb +57 -6
  8. data/admins/pageflow/user.rb +25 -4
  9. data/app/assets/images/pageflow/themes/default/preview.png +0 -0
  10. data/app/assets/images/pageflow/themes/default/preview_thumbnail.png +0 -0
  11. data/app/assets/javascripts/pageflow/admin/entries.js +5 -3
  12. data/app/assets/javascripts/pageflow/admin/users.js +33 -0
  13. data/app/assets/javascripts/pageflow/admin.js +4 -1
  14. data/app/assets/javascripts/pageflow/audio_context.js +28 -0
  15. data/app/assets/javascripts/pageflow/audio_player/get_media_element_method.js +5 -0
  16. data/app/assets/javascripts/pageflow/audio_player.js +2 -0
  17. data/app/assets/javascripts/pageflow/base.js +4 -22
  18. data/app/assets/javascripts/pageflow/dist/react.js +323 -242
  19. data/app/assets/javascripts/pageflow/editor/api/widget_type.js +23 -0
  20. data/app/assets/javascripts/pageflow/editor/api/widget_types.js +53 -0
  21. data/app/assets/javascripts/pageflow/editor/api.js +9 -1
  22. data/app/assets/javascripts/pageflow/editor/base.js +0 -1
  23. data/app/assets/javascripts/pageflow/editor/collections/pages_collection.js +1 -0
  24. data/app/assets/javascripts/pageflow/editor/collections/subset_collection.js +21 -1
  25. data/app/assets/javascripts/pageflow/editor/collections/themes_collection.js +13 -0
  26. data/app/assets/javascripts/pageflow/editor/collections/widgets_collection.js +23 -8
  27. data/app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js +7 -1
  28. data/app/assets/javascripts/pageflow/editor/initializers/setup_collections.js +10 -3
  29. data/app/assets/javascripts/pageflow/editor/initializers/setup_widget_types.js +5 -1
  30. data/app/assets/javascripts/pageflow/editor/initializers/stylesheet_reloading.js +8 -3
  31. data/app/assets/javascripts/pageflow/editor/models/edit_lock_container.js +1 -1
  32. data/app/assets/javascripts/pageflow/editor/models/entry.js +7 -4
  33. data/app/assets/javascripts/pageflow/editor/models/entry_configuration.js +1 -1
  34. data/app/assets/javascripts/pageflow/editor/models/file_stage.js +1 -0
  35. data/app/assets/javascripts/pageflow/editor/models/page.js +3 -1
  36. data/app/assets/javascripts/pageflow/editor/models/preview_entry_data.js +2 -2
  37. data/app/assets/javascripts/pageflow/editor/models/theme.js +25 -0
  38. data/app/assets/javascripts/pageflow/editor/models/theming.js +1 -19
  39. data/app/assets/javascripts/pageflow/editor/models/widget.js +22 -1
  40. data/app/assets/javascripts/pageflow/editor/models/widget_configuration.js +5 -0
  41. data/app/assets/javascripts/pageflow/editor/routers/sidebar_router.js +1 -0
  42. data/app/assets/javascripts/pageflow/editor/templates/change_theme_dialog.jst.ejs +23 -0
  43. data/app/assets/javascripts/pageflow/editor/templates/edit_widget.jst.ejs +1 -2
  44. data/app/assets/javascripts/pageflow/editor/templates/inputs/reference.jst.ejs +2 -2
  45. data/app/assets/javascripts/pageflow/editor/templates/static_thumbnail.jst.ejs +1 -0
  46. data/app/assets/javascripts/pageflow/editor/templates/theme_item.jst.ejs +5 -0
  47. data/app/assets/javascripts/pageflow/editor/templates/widget_item.jst.ejs +3 -0
  48. data/app/assets/javascripts/pageflow/editor/utils/stylesheet.js +23 -0
  49. data/app/assets/javascripts/pageflow/editor/views/change_theme_dialog_view.js +76 -0
  50. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/options.js +4 -2
  51. data/app/assets/javascripts/pageflow/editor/views/edit_meta_data_view.js +17 -4
  52. data/app/assets/javascripts/pageflow/editor/views/edit_widget_view.js +11 -21
  53. data/app/assets/javascripts/pageflow/editor/views/edit_widgets_view.js +1 -3
  54. data/app/assets/javascripts/pageflow/editor/views/file_meta_data_item_value_view.js +10 -1
  55. data/app/assets/javascripts/pageflow/editor/views/inputs/reference_input_view.js +36 -4
  56. data/app/assets/javascripts/pageflow/editor/views/inputs/theme_input_view.js +26 -0
  57. data/app/assets/javascripts/pageflow/editor/views/model_thumbnail_view.js +28 -14
  58. data/app/assets/javascripts/pageflow/editor/views/static_thumbnail_view.js +20 -0
  59. data/app/assets/javascripts/pageflow/editor/views/theme_item_view.js +41 -0
  60. data/app/assets/javascripts/pageflow/editor/views/widget_item_view.js +49 -0
  61. data/app/assets/javascripts/pageflow/history.js +7 -1
  62. data/app/assets/javascripts/pageflow/media_player/volume_fading/interval.js +65 -0
  63. data/app/assets/javascripts/pageflow/media_player/volume_fading/noop.js +5 -0
  64. data/app/assets/javascripts/pageflow/media_player/volume_fading/web_audio.js +109 -0
  65. data/app/assets/javascripts/pageflow/media_player/volume_fading.js +14 -65
  66. data/app/assets/javascripts/pageflow/slideshow/dom_order_scroll_navigator.js +5 -2
  67. data/app/assets/javascripts/pageflow/slideshow.js +19 -8
  68. data/app/assets/javascripts/pageflow/ui/views/configuration_editor_view.js +4 -0
  69. data/app/assets/javascripts/pageflow/ui/views/inputs/text_area_input_view.js +10 -5
  70. data/app/assets/javascripts/pageflow/ui/views/inputs/text_input_view.js +4 -48
  71. data/app/assets/javascripts/pageflow/ui/views/mixins/input_with_placeholder_text.js +58 -0
  72. data/app/assets/javascripts/pageflow/vendor.js +16 -0
  73. data/app/assets/javascripts/pageflow/video_player/get_media_element_method.js +6 -0
  74. data/app/assets/javascripts/pageflow/video_player.js +2 -0
  75. data/app/assets/stylesheets/pageflow/admin/entries.scss +1 -1
  76. data/app/assets/stylesheets/pageflow/admin/quotas.scss +1 -1
  77. data/app/assets/stylesheets/pageflow/admin.scss +2 -0
  78. data/app/assets/stylesheets/pageflow/base.scss +0 -1
  79. data/app/assets/stylesheets/pageflow/editor/base.scss +2 -0
  80. data/app/assets/stylesheets/pageflow/editor/change_theme.scss +114 -0
  81. data/app/assets/stylesheets/pageflow/editor/static_thumbnails.scss +4 -0
  82. data/app/assets/stylesheets/pageflow/editor/widgets.scss +26 -2
  83. data/app/assets/stylesheets/pageflow/page.scss +1 -14
  84. data/app/assets/stylesheets/pageflow/themes/default/indicators.scss +12 -0
  85. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner.scss +11 -0
  86. data/app/assets/stylesheets/pageflow/themes/default/logo/alignment.scss +27 -0
  87. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +20 -2
  88. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +4 -1
  89. data/app/assets/stylesheets/pageflow/themes/default/page/line_lengths.scss +113 -0
  90. data/app/assets/stylesheets/pageflow/themes/default/page.scss +1 -0
  91. data/app/controllers/pageflow/editor/widgets_controller.rb +15 -1
  92. data/app/controllers/pageflow/entries_controller.rb +1 -1
  93. data/app/helpers/pageflow/admin/entries_helper.rb +0 -9
  94. data/app/helpers/pageflow/admin/memberships_helper.rb +43 -123
  95. data/app/helpers/pageflow/admin/users_helper.rb +15 -0
  96. data/app/helpers/pageflow/entries_helper.rb +3 -1
  97. data/app/helpers/pageflow/entry_json_seed_helper.rb +9 -3
  98. data/app/helpers/pageflow/public_i18n_helper.rb +2 -2
  99. data/app/helpers/pageflow/quota_helper.rb +2 -2
  100. data/app/helpers/pageflow/social_share_helper.rb +3 -2
  101. data/app/helpers/pageflow/themes_helper.rb +11 -3
  102. data/app/helpers/pageflow/widgets_helper.rb +10 -2
  103. data/app/jobs/pageflow/prune_auto_snapshots_job.rb +9 -0
  104. data/app/mailers/pageflow/user_mailer.rb +11 -1
  105. data/app/models/concerns/pageflow/feature_target.rb +1 -1
  106. data/app/models/concerns/pageflow/hosted_file.rb +9 -0
  107. data/app/models/concerns/pageflow/output_source.rb +2 -1
  108. data/app/models/concerns/pageflow/serialization_blacklist.rb +19 -0
  109. data/app/models/concerns/pageflow/serialized_configuration.rb +17 -0
  110. data/app/models/concerns/pageflow/theme_referencer.rb +23 -0
  111. data/app/models/pageflow/account.rb +6 -1
  112. data/app/models/pageflow/account_member_query.rb +6 -12
  113. data/app/models/pageflow/account_role_query.rb +68 -0
  114. data/app/models/pageflow/application_query.rb +13 -0
  115. data/app/models/pageflow/application_record.rb +5 -0
  116. data/app/models/pageflow/audio_file.rb +1 -1
  117. data/app/models/pageflow/auto_snapshot_pruning.rb +26 -0
  118. data/app/models/pageflow/chapter.rb +4 -8
  119. data/app/models/pageflow/draft_entry.rb +2 -1
  120. data/app/models/pageflow/edit_lock.rb +11 -5
  121. data/app/models/pageflow/encoding_confirmation.rb +2 -1
  122. data/app/models/pageflow/entry.rb +13 -2
  123. data/app/models/pageflow/entry_publication.rb +2 -0
  124. data/app/models/pageflow/entry_role_query.rb +24 -9
  125. data/app/models/pageflow/entry_title_or_account_name_query.rb +33 -0
  126. data/app/models/pageflow/file_usage.rb +3 -7
  127. data/app/models/pageflow/folder.rb +1 -1
  128. data/app/models/pageflow/home_button.rb +1 -1
  129. data/app/models/pageflow/image_file.rb +22 -4
  130. data/app/models/pageflow/invitation_form.rb +10 -4
  131. data/app/models/pageflow/managed_user_query.rb +44 -0
  132. data/app/models/pageflow/membership.rb +1 -1
  133. data/app/models/pageflow/overview_button.rb +3 -4
  134. data/app/models/pageflow/page.rb +3 -7
  135. data/app/models/pageflow/potential_memberships.rb +112 -0
  136. data/app/models/pageflow/published_entry.rb +2 -1
  137. data/app/models/pageflow/revision.rb +13 -4
  138. data/app/models/pageflow/storyline.rb +3 -4
  139. data/app/models/pageflow/text_track_file.rb +1 -1
  140. data/app/models/pageflow/theming.rb +15 -10
  141. data/app/models/pageflow/url_template.rb +8 -2
  142. data/app/models/pageflow/user_name_query.rb +30 -0
  143. data/app/models/pageflow/video_file.rb +5 -1
  144. data/app/models/pageflow/widget.rb +3 -1
  145. data/app/models/pageflow/zencoder_attachment.rb +16 -5
  146. data/app/policies/pageflow/account_policy.rb +31 -61
  147. data/app/policies/pageflow/application_policy.rb +6 -0
  148. data/app/policies/pageflow/entry_policy.rb +11 -3
  149. data/app/policies/pageflow/membership_policy.rb +1 -2
  150. data/app/policies/pageflow/user_policy.rb +20 -1
  151. data/app/views/admin/accounts/_form.html.erb +4 -4
  152. data/app/views/admin/accounts/_theming_defaults_inline_help.html.erb +5 -0
  153. data/app/views/admin/memberships/_form.html.erb +9 -14
  154. data/app/views/admin/memberships/_role_hint.html.arb +1 -1
  155. data/app/views/admin/users/invitation.html.erb +18 -9
  156. data/app/views/admin/users/me.html.erb +2 -2
  157. data/app/views/admin/users/quota_state.html.erb +1 -0
  158. data/app/views/components/pageflow/admin/add_membership_button.rb +81 -0
  159. data/app/views/components/pageflow/admin/members_tab.rb +6 -4
  160. data/app/views/components/pageflow/admin/revisions_tab.rb +16 -4
  161. data/app/views/components/pageflow/admin/user_accounts_tab.rb +8 -2
  162. data/app/views/components/pageflow/admin/user_entries_tab.rb +6 -2
  163. data/app/views/components/pageflow/admin/users_tab.rb +9 -5
  164. data/app/views/layouts/pageflow/application.html.erb +2 -1
  165. data/app/views/pageflow/admin/users/_quota_exhausted.html.erb +1 -0
  166. data/app/views/pageflow/admin/users/_quota_state.html.erb +7 -0
  167. data/app/views/pageflow/config/_editor_seeds.json.jbuilder +2 -0
  168. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  169. data/app/views/pageflow/editor/entries/seed.json.erb +3 -1
  170. data/app/views/pageflow/editor/image_files/_image_file.json.jbuilder +1 -1
  171. data/app/views/pageflow/editor/themings/_theming.json.jbuilder +0 -7
  172. data/app/views/pageflow/editor/widgets/_widget.json.jbuilder +1 -1
  173. data/app/views/pageflow/entries/_entry.html.erb +5 -5
  174. data/app/views/pageflow/entries/edit.html.erb +1 -1
  175. data/app/views/pageflow/entries/show.html.erb +1 -1
  176. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +1 -0
  177. data/app/views/pageflow/themes/_theme.json.jbuilder +13 -0
  178. data/config/initializers/admin_resource_tabs.rb +19 -6
  179. data/config/initializers/features.rb +1 -0
  180. data/config/locales/de.yml +26 -3
  181. data/config/locales/en.yml +26 -3
  182. data/db/migrate/20170201074328_add_configuration_to_widgets.rb +5 -0
  183. data/db/migrate/20170222124848_update_video_file_output_presences.rb +1 -1
  184. data/db/migrate/20170315130000_add_theme_name_to_revisions.rb +12 -0
  185. data/db/migrate/20170912165050_reset_copied_snapshot_type.rb +24 -0
  186. data/lib/generators/pageflow/routes/routes_generator.rb +11 -1
  187. data/lib/generators/pageflow/seeds/seeds_generator.rb +5 -0
  188. data/lib/generators/pageflow/seeds/templates/seeds.rb +5 -3
  189. data/lib/generators/pageflow/theme/templates/preview.png +0 -0
  190. data/lib/generators/pageflow/theme/templates/preview_thumbnail.png +0 -0
  191. data/lib/generators/pageflow/theme/theme_generator.rb +3 -0
  192. data/lib/pageflow/ability_mixin.rb +27 -6
  193. data/lib/pageflow/active_admin_can_can_fix.rb +34 -0
  194. data/lib/pageflow/configuration/permissions.rb +27 -0
  195. data/lib/pageflow/configuration.rb +28 -0
  196. data/lib/pageflow/engine.rb +25 -19
  197. data/lib/pageflow/images/palette.png +0 -0
  198. data/lib/pageflow/seeds.rb +1 -1
  199. data/lib/pageflow/theme.rb +8 -0
  200. data/lib/pageflow/version.rb +1 -1
  201. data/lib/pageflow/widget_type.rb +13 -0
  202. data/lib/pageflow/zencoder_video_output_definition.rb +16 -16
  203. data/lib/tasks/pageflow_tasks.rake +14 -0
  204. data/spec/factories/entries.rb +4 -0
  205. data/spec/factories/revisions.rb +10 -0
  206. data/spec/factories/users.rb +6 -0
  207. data/spec/factories/video_files.rb +4 -0
  208. data/vendor/assets/javascripts/audio5.min.js +3 -0
  209. metadata +78 -15
  210. data/app/assets/javascripts/pageflow/editor/models/mixins/widget_subject.js +0 -37
  211. data/app/assets/javascripts/pageflow/editor/utils/reload_stylesheet.js +0 -9
  212. data/app/assets/stylesheets/pageflow/text_variants.scss +0 -24
  213. data/app/views/admin/accounts/_widgets_inline_help.html.erb +0 -5
  214. data/app/views/admin/memberships/_entity_account_input.html.erb +0 -5
  215. data/app/views/admin/memberships/_entity_entry_input.html.erb +0 -5
  216. data/app/views/admin/users/_quota_exhausted.html.erb +0 -1
  217. data/app/views/components/pageflow/admin/add_membership_button_if_needed.rb +0 -62
@@ -1,24 +0,0 @@
1
- .text_position_right {
2
- &.page .contentText > * {
3
- margin-left: auto;
4
- }
5
-
6
- &.page {
7
- h1, h2 span.subtitle, h2 span.tagline, h3, p {
8
- margin-left: auto;
9
- }
10
- h2 .title {
11
- margin-left: auto;
12
- max-width: 500px;
13
- }
14
- }
15
-
16
- .page_header {
17
- margin-left: auto;
18
- width: 100%;
19
-
20
- @include mobile {
21
- width: 100%;
22
- }
23
- }
24
- }
@@ -1,5 +0,0 @@
1
- <li class="inline_help_item">
2
- <p>
3
- <%= t('pageflow.admin.accounts.widgets_inline_help') %>
4
- </p>
5
- </li>
@@ -1,5 +0,0 @@
1
- <%= f.input :entity,
2
- label: I18n.t('activerecord.attributes.pageflow/membership.account'),
3
- collection: membership_accounts_collection(parent, resource),
4
- include_blank: false,
5
- input_html: { disabled: !f.object.new_record? || parent_type == :account } %>
@@ -1,5 +0,0 @@
1
- <%= f.input :entity,
2
- label: I18n.t('activerecord.attributes.pageflow/membership.entry'),
3
- input_html: { disabled: !f.object.new_record? || parent_type == :entry },
4
- collection: membership_entries_collection(parent, resource),
5
- include_blank: false %>
@@ -1 +0,0 @@
1
- <p>Replace by creating <code>app/views/admin/users/_quota_exhausted.html.erb</code></p>
@@ -1,62 +0,0 @@
1
- module Pageflow
2
- module Admin
3
- class AddMembershipButtonIfNeeded < ViewComponent
4
- builder_method :add_membership_button_if_needed
5
-
6
- def build(user, parent, entity_type)
7
- if parent.is_a?(User)
8
- button_label = I18n.t("pageflow.admin.#{entity_type}.add")
9
- path = new_admin_user_membership_path(parent, entity_type: entity_type.to_sym)
10
- data_tooltip = I18n.t("pageflow.admin.#{entity_type}.none_addable_tooltip")
11
- rel = "add_#{entity_type}_membership"
12
- elsif parent.is_a?(Entry)
13
- path = new_admin_entry_membership_path(parent, entity_type: entity_type.to_sym)
14
- else
15
- path = new_admin_account_membership_path(parent, entity_type: entity_type.to_sym)
16
- end
17
-
18
- unless parent.is_a?(User)
19
- button_label = I18n.t('pageflow.admin.users.add')
20
- data_tooltip = I18n.t('pageflow.admin.user.none_addable_tooltip')
21
- rel = 'add_member'
22
- end
23
-
24
- if membership_possible_for(user, parent, entity_type)
25
- para do
26
- link_to(button_label, path, class: 'button', data: {rel: rel})
27
- end
28
- else
29
- para(content_tag('a',
30
- button_label,
31
- class: 'button disabled',
32
- data: {rel: rel}),
33
- 'data-tooltip' => data_tooltip)
34
- end
35
- end
36
-
37
- private
38
-
39
- def membership_possible_for(user, parent, entity_type)
40
- entity_type == 'entry' && entry_membership_possible_for_creator_and(user, parent) ||
41
- entity_type == 'account' && account_membership_possible_for_creator_and(user, parent)
42
- end
43
-
44
- def entry_membership_possible_for_creator_and(user, parent)
45
- Pageflow::EntryPolicy::Scope.new(user, Pageflow::Entry).member_addable &&
46
- ((parent.is_a?(User) &&
47
- !membership_entries_collection(parent, Pageflow::Membership.new(user: parent))
48
- .blank?) ||
49
- (parent.is_a?(Entry) &&
50
- !membership_users_collection(parent, Membership.new(entity: parent)).blank?))
51
- end
52
-
53
- def account_membership_possible_for_creator_and(user, parent)
54
- Pageflow::AccountPolicy::Scope.new(user, Pageflow::Account).member_addable &&
55
- ((parent.is_a?(User) &&
56
- !membership_accounts_collection(user, Pageflow::Membership.new(user: user)).blank?) ||
57
- (parent.is_a?(Account) &&
58
- !membership_users_collection(parent, Membership.new(entity: parent)).blank?))
59
- end
60
- end
61
- end
62
- end