pageflow 0.11.4 → 12.0.0.rc1

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 (416) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +224 -1207
  3. data/README.md +7 -3
  4. data/Rakefile +2 -0
  5. data/admins/pageflow/accounts.rb +27 -8
  6. data/admins/pageflow/entry.rb +130 -47
  7. data/admins/pageflow/folder.rb +28 -17
  8. data/admins/pageflow/membership.rb +58 -6
  9. data/admins/pageflow/user.rb +105 -98
  10. data/app/assets/fonts/pageflow/fontawesome-webfont.eot +0 -0
  11. data/app/assets/fonts/pageflow/fontawesome-webfont.svg +644 -463
  12. data/app/assets/fonts/pageflow/fontawesome-webfont.ttf +0 -0
  13. data/app/assets/fonts/pageflow/fontawesome-webfont.woff +0 -0
  14. data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.eot +0 -0
  15. data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.svg +2864 -696
  16. data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.ttf +0 -0
  17. data/app/assets/fonts/pageflow/sourcesanspro-bold-webfont.woff +0 -0
  18. data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.eot +0 -0
  19. data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.svg +2572 -613
  20. data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.ttf +0 -0
  21. data/app/assets/fonts/pageflow/sourcesanspro-light-webfont.woff +0 -0
  22. data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.eot +0 -0
  23. data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.svg +2977 -779
  24. data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.ttf +0 -0
  25. data/app/assets/fonts/pageflow/sourcesanspro-regular-webfont.woff +0 -0
  26. data/app/assets/javascripts/pageflow/admin/entries.js +21 -3
  27. data/app/assets/javascripts/pageflow/audio.js +30 -15
  28. data/app/assets/javascripts/pageflow/audio/multi_player.js +12 -1
  29. data/app/assets/javascripts/pageflow/audio_player.js +15 -1
  30. data/app/assets/javascripts/pageflow/audio_player/rewind_method.js +3 -1
  31. data/app/assets/javascripts/pageflow/base.js +4 -1
  32. data/app/assets/javascripts/pageflow/browser.js +3 -0
  33. data/app/assets/javascripts/pageflow/browser/autoplay_support.js +3 -0
  34. data/app/assets/javascripts/pageflow/browser/facebook.js +1 -2
  35. data/app/assets/javascripts/pageflow/browser/ios_platform.js +5 -0
  36. data/app/assets/javascripts/pageflow/browser/video.js +4 -0
  37. data/app/assets/javascripts/pageflow/components.js +7 -0
  38. data/app/assets/javascripts/pageflow/cookies.js +1 -4
  39. data/app/assets/javascripts/pageflow/dist/react.js +4724 -5808
  40. data/app/assets/javascripts/pageflow/editor/api.js +201 -161
  41. data/app/assets/javascripts/pageflow/editor/api/errors.js +80 -0
  42. data/app/assets/javascripts/pageflow/editor/api/failure.js +9 -0
  43. data/app/assets/javascripts/pageflow/editor/api/failures.js +25 -2
  44. data/app/assets/javascripts/pageflow/editor/api/file_type.js +42 -3
  45. data/app/assets/javascripts/pageflow/editor/api/file_types.js +75 -46
  46. data/app/assets/javascripts/pageflow/editor/base.js +8 -0
  47. data/app/assets/javascripts/pageflow/editor/collections/file_types_collection.js +37 -0
  48. data/app/assets/javascripts/pageflow/editor/collections/files_collection.js +32 -1
  49. data/app/assets/javascripts/pageflow/editor/collections/mixins/ordered_collection.js +1 -1
  50. data/app/assets/javascripts/pageflow/editor/collections/multi_collection.js +4 -6
  51. data/app/assets/javascripts/pageflow/editor/collections/nested_files_collection.js +27 -0
  52. data/app/assets/javascripts/pageflow/editor/collections/pages_collection.js +21 -1
  53. data/app/assets/javascripts/pageflow/editor/collections/subset_collection.js +8 -2
  54. data/app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js +3 -2
  55. data/app/assets/javascripts/pageflow/editor/initializers/error_listener.js +10 -5
  56. data/app/assets/javascripts/pageflow/editor/initializers/routing.js +3 -1
  57. data/app/assets/javascripts/pageflow/editor/initializers/setup_collections.js +3 -0
  58. data/app/assets/javascripts/pageflow/editor/initializers/setup_file_types.js +136 -6
  59. data/app/assets/javascripts/pageflow/editor/initializers/setup_file_uploader.js +10 -0
  60. data/app/assets/javascripts/pageflow/editor/initializers/setup_hotkeys.js +5 -7
  61. data/app/assets/javascripts/pageflow/editor/initializers/stylesheet_reloading.js +1 -1
  62. data/app/assets/javascripts/pageflow/editor/models/configuration.js +1 -0
  63. data/app/assets/javascripts/pageflow/editor/models/entry.js +34 -26
  64. data/app/assets/javascripts/pageflow/editor/models/file_configuration.js +10 -0
  65. data/app/assets/javascripts/pageflow/editor/models/file_reuse.js +23 -0
  66. data/app/assets/javascripts/pageflow/editor/models/file_uploader.js +69 -0
  67. data/app/assets/javascripts/pageflow/editor/models/mixins/retryable.js +1 -1
  68. data/app/assets/javascripts/pageflow/editor/models/page.js +13 -0
  69. data/app/assets/javascripts/pageflow/editor/models/text_track_file.js +48 -0
  70. data/app/assets/javascripts/pageflow/editor/models/uploaded_file.js +62 -11
  71. data/app/assets/javascripts/pageflow/editor/routers/sidebar_router.js +1 -0
  72. data/app/assets/javascripts/pageflow/editor/templates/confirm_upload.jst.ejs +18 -0
  73. data/app/assets/javascripts/pageflow/editor/templates/delete_row_table_cell.jst.ejs +1 -0
  74. data/app/assets/javascripts/pageflow/editor/templates/drop_down_button.jst.ejs +0 -2
  75. data/app/assets/javascripts/pageflow/editor/templates/drop_down_button_item.jst.ejs +1 -0
  76. data/app/assets/javascripts/pageflow/editor/templates/edit_entry.jst.ejs +3 -1
  77. data/app/assets/javascripts/pageflow/editor/templates/edit_file.jst.ejs +0 -0
  78. data/app/assets/javascripts/pageflow/editor/templates/file_item.jst.ejs +1 -6
  79. data/app/assets/javascripts/pageflow/editor/templates/file_meta_data_item_value_view.jst.ejs +3 -0
  80. data/app/assets/javascripts/pageflow/editor/templates/file_settings_dialog.jst.ejs +10 -0
  81. data/app/assets/javascripts/pageflow/editor/templates/files_blank_slate.jst.ejs +1 -1
  82. data/app/assets/javascripts/pageflow/editor/templates/filtered_files.jst.ejs +10 -0
  83. data/app/assets/javascripts/pageflow/{ui → editor}/templates/inputs/file_input.jst.ejs +1 -1
  84. data/app/assets/javascripts/pageflow/editor/templates/inputs/reference.jst.ejs +2 -2
  85. data/app/assets/javascripts/pageflow/editor/templates/nested_files.jst.ejs +1 -0
  86. data/app/assets/javascripts/pageflow/editor/templates/table_cell.jst.ejs +0 -0
  87. data/app/assets/javascripts/pageflow/editor/templates/text_tracks.jst.ejs +13 -0
  88. data/app/assets/javascripts/pageflow/editor/templates/uploadable_files.jst.ejs +1 -0
  89. data/app/assets/javascripts/pageflow/editor/utils/form_data_utils.js +19 -0
  90. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/audio.js +5 -2
  91. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/background_image.js +3 -2
  92. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/background.js +35 -0
  93. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/groups/options.js +7 -9
  94. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/video.js +6 -5
  95. data/app/assets/javascripts/pageflow/editor/views/confirm_upload_view.js +69 -0
  96. data/app/assets/javascripts/pageflow/editor/views/confirmable_file_item_view.js +1 -1
  97. data/app/assets/javascripts/pageflow/editor/views/drop_down_button_item_list_view.js +9 -0
  98. data/app/assets/javascripts/pageflow/editor/views/drop_down_button_item_view.js +14 -1
  99. data/app/assets/javascripts/pageflow/editor/views/drop_down_button_view.js +51 -20
  100. data/app/assets/javascripts/pageflow/editor/views/edit_entry_view.js +21 -2
  101. data/app/assets/javascripts/pageflow/editor/views/edit_file_view.js +52 -0
  102. data/app/assets/javascripts/pageflow/editor/views/edit_storyline_view.js +1 -1
  103. data/app/assets/javascripts/pageflow/editor/views/entry_preview_view.js +15 -7
  104. data/app/assets/javascripts/pageflow/editor/views/file_item_view.js +33 -22
  105. data/app/assets/javascripts/pageflow/editor/views/file_meta_data_item_value_view.js +49 -0
  106. data/app/assets/javascripts/pageflow/editor/views/file_meta_data_item_view.js +16 -5
  107. data/app/assets/javascripts/pageflow/editor/views/file_settings_dialog_view.js +31 -0
  108. data/app/assets/javascripts/pageflow/editor/views/files_explorer_view.js +6 -7
  109. data/app/assets/javascripts/pageflow/editor/views/files_view.js +13 -14
  110. data/app/assets/javascripts/pageflow/editor/views/filtered_files_view.js +75 -0
  111. data/app/assets/javascripts/pageflow/editor/views/help_view.js +3 -0
  112. data/app/assets/javascripts/pageflow/editor/views/inputs/file_input_view.js +217 -0
  113. data/app/assets/javascripts/pageflow/editor/views/inputs/page_link_input_view.js +6 -0
  114. data/app/assets/javascripts/pageflow/editor/views/inputs/reference_input_view.js +13 -2
  115. data/app/assets/javascripts/pageflow/editor/views/list_view.js +24 -14
  116. data/app/assets/javascripts/pageflow/editor/views/model_thumbnail_view.js +4 -1
  117. data/app/assets/javascripts/pageflow/editor/views/nested_files_view.js +94 -0
  118. data/app/assets/javascripts/pageflow/editor/views/page_preview_view.js +7 -2
  119. data/app/assets/javascripts/pageflow/editor/views/text_file_meta_data_item_value_view.js +25 -0
  120. data/app/assets/javascripts/pageflow/editor/views/text_tracks_file_meta_data_item_value_view.js +12 -0
  121. data/app/assets/javascripts/pageflow/editor/views/text_tracks_view.js +65 -0
  122. data/app/assets/javascripts/pageflow/editor/views/uploadable_files_view.js +56 -0
  123. data/app/assets/javascripts/pageflow/editor/views/uploader_view.js +13 -10
  124. data/app/assets/javascripts/pageflow/features.js +8 -12
  125. data/app/assets/javascripts/pageflow/focus_outline.js +2 -0
  126. data/app/assets/javascripts/pageflow/media_player/volume_binding.js +2 -0
  127. data/app/assets/javascripts/pageflow/media_player/volume_fading.js +6 -0
  128. data/app/assets/javascripts/pageflow/page_type.js +0 -1
  129. data/app/assets/javascripts/pageflow/phone_landscape_fullscreen.js +34 -0
  130. data/app/assets/javascripts/pageflow/react.js +4 -0
  131. data/app/assets/javascripts/pageflow/ready.js +3 -0
  132. data/app/assets/javascripts/pageflow/seed_entry_data.js +4 -1
  133. data/app/assets/javascripts/pageflow/slideshow.js +1 -0
  134. data/app/assets/javascripts/pageflow/slideshow/adjacent_preparer.js +7 -5
  135. data/app/assets/javascripts/pageflow/slideshow/atmo.js +3 -3
  136. data/app/assets/javascripts/pageflow/slideshow/hidden_text_indicator_widget.js +4 -2
  137. data/app/assets/javascripts/pageflow/slideshow/hide_text.js +8 -4
  138. data/app/assets/javascripts/pageflow/slideshow/lazy_page_widget.js +5 -0
  139. data/app/assets/javascripts/pageflow/slideshow/scroller_widget.js +11 -18
  140. data/app/assets/javascripts/pageflow/ui.js +6 -0
  141. data/app/assets/javascripts/pageflow/ui/templates/inputs/url_display.jst.ejs +7 -0
  142. data/app/assets/javascripts/pageflow/ui/templates/table.jst.ejs +7 -0
  143. data/app/assets/javascripts/pageflow/ui/templates/table_blank_slate.jst.ejs +3 -0
  144. data/app/assets/javascripts/pageflow/ui/utils/i18n_utils.js +97 -2
  145. data/app/assets/javascripts/pageflow/ui/views/collection_view.js +8 -1
  146. data/app/assets/javascripts/pageflow/ui/views/inputs/check_box_input_view.js +12 -1
  147. data/app/assets/javascripts/pageflow/ui/views/inputs/proxy_url_input_view.js +51 -5
  148. data/app/assets/javascripts/pageflow/ui/views/inputs/select_input_view.js +80 -2
  149. data/app/assets/javascripts/pageflow/ui/views/inputs/slider_input_view.js +8 -1
  150. data/app/assets/javascripts/pageflow/ui/views/inputs/text_area_input_view.js +17 -1
  151. data/app/assets/javascripts/pageflow/ui/views/inputs/text_input_view.js +47 -4
  152. data/app/assets/javascripts/pageflow/ui/views/inputs/url_display_view.js +42 -0
  153. data/app/assets/javascripts/pageflow/ui/views/inputs/url_input_view.js +20 -2
  154. data/app/assets/javascripts/pageflow/ui/views/mixins/input_view.js +74 -46
  155. data/app/assets/javascripts/pageflow/ui/views/table_cells/delete_row_table_cell_view.js +63 -0
  156. data/app/assets/javascripts/pageflow/ui/views/table_cells/enum_table_cell_view.js +26 -0
  157. data/app/assets/javascripts/pageflow/ui/views/table_cells/icon_table_cell_view.js +40 -0
  158. data/app/assets/javascripts/pageflow/ui/views/table_cells/presence_table_cell_view.js +31 -0
  159. data/app/assets/javascripts/pageflow/ui/views/table_cells/table_cell_view.js +101 -0
  160. data/app/assets/javascripts/pageflow/ui/views/table_cells/table_header_cell_view.js +10 -0
  161. data/app/assets/javascripts/pageflow/ui/views/table_cells/text_table_cell_view.js +46 -0
  162. data/app/assets/javascripts/pageflow/ui/views/table_row_view.js +47 -0
  163. data/app/assets/javascripts/pageflow/ui/views/table_view.js +47 -0
  164. data/app/assets/javascripts/pageflow/video_player.js +9 -5
  165. data/app/assets/javascripts/pageflow/video_player/buffer_underrun_waiting.js +15 -13
  166. data/app/assets/javascripts/pageflow/video_player/cue_settings_methods.js +33 -0
  167. data/app/assets/javascripts/pageflow/video_player/dash.js +3 -0
  168. data/app/assets/javascripts/pageflow/video_player/filter_sources.js +1 -1
  169. data/app/assets/javascripts/pageflow/video_player/lazy.js +3 -9
  170. data/app/assets/javascripts/pageflow/video_player/prebuffering.js +11 -2
  171. data/app/assets/javascripts/pageflow/video_player/use_slim_controls_during_phone_playback.js +16 -0
  172. data/app/assets/javascripts/pageflow/videojs.js +6 -0
  173. data/app/assets/javascripts/pageflow/widgets.js +41 -7
  174. data/app/assets/stylesheets/pageflow/admin.scss +7 -4
  175. data/app/assets/stylesheets/pageflow/admin/{entries/user_badge_list.scss → badge_list.scss} +6 -9
  176. data/app/assets/stylesheets/pageflow/admin/embed_code.scss +13 -0
  177. data/app/assets/stylesheets/pageflow/admin/entries.scss +1 -2
  178. data/app/assets/stylesheets/pageflow/admin/hint.scss +20 -0
  179. data/app/assets/stylesheets/pageflow/admin/tooltip_bubble.scss +34 -0
  180. data/app/assets/stylesheets/pageflow/editor/base.scss +4 -4
  181. data/app/assets/stylesheets/pageflow/editor/confirm_upload.scss +66 -0
  182. data/app/assets/stylesheets/pageflow/editor/dialogs.scss +9 -1
  183. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +56 -20
  184. data/app/assets/stylesheets/pageflow/editor/file_meta_data.scss +26 -6
  185. data/app/assets/stylesheets/pageflow/editor/file_settings_dialog.scss +32 -0
  186. data/app/assets/stylesheets/pageflow/editor/files.scss +5 -0
  187. data/app/assets/stylesheets/pageflow/editor/filtered_files.scss +25 -0
  188. data/app/assets/stylesheets/pageflow/editor/inputs.scss +2 -1
  189. data/app/assets/stylesheets/pageflow/editor/inputs/file_input.scss +65 -0
  190. data/app/assets/stylesheets/pageflow/editor/inputs/reference.scss +2 -2
  191. data/app/assets/stylesheets/pageflow/editor/text_tracks.scss +39 -0
  192. data/app/assets/stylesheets/pageflow/entries.scss +1 -0
  193. data/app/assets/stylesheets/pageflow/mixins/buttons.scss +77 -5
  194. data/app/assets/stylesheets/pageflow/mixins/icons/fontawesome.scss +3 -1
  195. data/app/assets/stylesheets/pageflow/page_types.scss +0 -4
  196. data/app/assets/stylesheets/pageflow/page_types/video.scss +5 -1
  197. data/app/assets/stylesheets/pageflow/page_types/video/content_hiding.scss +1 -0
  198. data/app/assets/stylesheets/pageflow/themes/default/base.scss +1 -0
  199. data/app/assets/stylesheets/pageflow/themes/default/built_in_page_types.scss +0 -2
  200. data/app/assets/stylesheets/pageflow/themes/default/definitions.scss +1 -0
  201. data/app/assets/stylesheets/pageflow/themes/default/loading_spinner.scss +31 -12
  202. data/app/assets/stylesheets/pageflow/themes/default/logo.scss +9 -1
  203. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/background_image.scss +8 -2
  204. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +21 -0
  205. data/app/assets/stylesheets/pageflow/themes/default/mixins/cue_margins.scss +43 -0
  206. data/app/assets/stylesheets/pageflow/themes/default/mixins/indicator_typography.scss +7 -3
  207. data/app/assets/stylesheets/pageflow/themes/default/page.scss +20 -2
  208. data/app/assets/stylesheets/pageflow/themes/default/player_controls.scss +4 -0
  209. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic.scss +4 -0
  210. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/container.scss +8 -6
  211. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +18 -3
  212. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/cue_margins.scss +1 -0
  213. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/icons/custom.scss +14 -0
  214. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/icons/icon_font.scss +4 -0
  215. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/icons/sprite.scss +4 -0
  216. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +2 -2
  217. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/menu_bar.scss +5 -0
  218. data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +121 -0
  219. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim.scss +2 -0
  220. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/container.scss +2 -0
  221. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +74 -12
  222. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/cue_margins.scss +3 -0
  223. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +31 -5
  224. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/menu_bar.scss +13 -0
  225. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +116 -0
  226. data/app/assets/stylesheets/pageflow/themes/default/player_controls/vjs_mapping.scss +13 -3
  227. data/app/assets/stylesheets/pageflow/themes/default/player_controls/widget_margins.scss +8 -3
  228. data/app/assets/stylesheets/pageflow/themes/default/text_track_cues.scss +25 -0
  229. data/app/assets/stylesheets/pageflow/themes/default/variables/widgets.scss +2 -2
  230. data/app/assets/stylesheets/pageflow/themes/default/video_player/vjs_base.scss +122 -79
  231. data/app/assets/stylesheets/pageflow/themes/default/video_wrapper.scss +16 -7
  232. data/app/assets/stylesheets/pageflow/ui.scss +5 -1
  233. data/app/assets/stylesheets/pageflow/ui/forms.scss +5 -58
  234. data/app/assets/stylesheets/pageflow/ui/table_cells/delete_row_table_cell.scss +7 -0
  235. data/app/assets/stylesheets/pageflow/ui/table_cells/icon_table_cell.scss +16 -0
  236. data/app/assets/stylesheets/pageflow/ui/table_cells/presence_table_cell.scss +8 -0
  237. data/app/assets/stylesheets/pageflow/ui/table_view.scss +33 -0
  238. data/app/assets/stylesheets/pageflow/ui/tooltip.scss +1 -1
  239. data/app/controllers/pageflow/editor/encoding_confirmations_controller.rb +3 -3
  240. data/app/controllers/pageflow/editor/entry_publications_controller.rb +3 -3
  241. data/app/controllers/pageflow/editor/files_controller.rb +72 -14
  242. data/app/controllers/pageflow/editor/widgets_controller.rb +1 -1
  243. data/app/controllers/pageflow/entries_controller.rb +12 -2
  244. data/app/controllers/pageflow/files_controller.rb +1 -1
  245. data/app/helpers/pageflow/admin/entries_helper.rb +17 -0
  246. data/app/helpers/pageflow/admin/form_helper.rb +1 -1
  247. data/app/helpers/pageflow/admin/memberships_helper.rb +117 -13
  248. data/app/helpers/pageflow/common_entry_seed_helper.rb +36 -5
  249. data/app/helpers/pageflow/embed_code_helper.rb +32 -0
  250. data/app/helpers/pageflow/entries_helper.rb +1 -1
  251. data/app/helpers/pageflow/entry_json_seed_helper.rb +6 -16
  252. data/app/helpers/pageflow/files_helper.rb +5 -2
  253. data/app/helpers/pageflow/folders_helper.rb +26 -2
  254. data/app/helpers/pageflow/page_background_asset_helper.rb +8 -0
  255. data/app/helpers/pageflow/quota_helper.rb +1 -1
  256. data/app/helpers/pageflow/video_files_helper.rb +0 -5
  257. data/app/jobs/pageflow/poll_zencoder_job.rb +1 -1
  258. data/app/jobs/pageflow/process_file_job.rb +18 -0
  259. data/app/mailers/pageflow/user_mailer.rb +4 -2
  260. data/app/models/concerns/pageflow/hosted_file.rb +9 -0
  261. data/app/models/concerns/pageflow/output_source.rb +60 -0
  262. data/app/models/concerns/pageflow/uploaded_file.rb +33 -5
  263. data/app/models/pageflow/account.rb +3 -1
  264. data/app/models/pageflow/audio_file_url_templates.rb +21 -0
  265. data/app/models/pageflow/draft_entry.rb +19 -9
  266. data/app/models/pageflow/entry.rb +2 -1
  267. data/app/models/pageflow/entry_duplicate.rb +2 -2
  268. data/app/models/pageflow/entry_role_query.rb +81 -0
  269. data/app/models/pageflow/file_reuse.rb +25 -0
  270. data/app/models/pageflow/file_usage.rb +7 -1
  271. data/app/models/pageflow/image_file.rb +7 -1
  272. data/app/models/pageflow/image_file_url_templates.rb +19 -0
  273. data/app/models/pageflow/invited_user.rb +2 -0
  274. data/app/models/pageflow/membership.rb +46 -3
  275. data/app/models/pageflow/published_entry.rb +2 -2
  276. data/app/models/pageflow/revision.rb +16 -5
  277. data/app/models/pageflow/roles.rb +36 -0
  278. data/app/models/pageflow/text_track_file.rb +45 -0
  279. data/app/models/pageflow/text_track_file_url_templates.rb +16 -0
  280. data/app/models/pageflow/thumbnail_file_resolver.rb +22 -2
  281. data/app/models/pageflow/url_template.rb +13 -0
  282. data/app/models/pageflow/used_file.rb +21 -0
  283. data/app/models/pageflow/video_file.rb +72 -27
  284. data/app/models/pageflow/video_file_url_templates.rb +34 -0
  285. data/app/policies/pageflow/account_policy.rb +145 -0
  286. data/app/policies/pageflow/admin/admin_only_tab_policy.rb +16 -0
  287. data/app/policies/pageflow/admin/entry_tab_policy.rb +25 -0
  288. data/app/policies/pageflow/application_policy.rb +11 -0
  289. data/app/policies/pageflow/entry_policy.rb +138 -0
  290. data/app/policies/pageflow/file_policy.rb +42 -0
  291. data/app/policies/pageflow/folder_policy.rb +54 -0
  292. data/app/policies/pageflow/membership_policy.rb +105 -0
  293. data/app/policies/pageflow/theming_policy.rb +57 -0
  294. data/app/policies/pageflow/user_policy.rb +69 -0
  295. data/app/state_machines/pageflow/encoded_file_state_machine.rb +4 -0
  296. data/app/state_machines/pageflow/image_file_state_machine.rb +5 -1
  297. data/app/views/admin/entries/_attributes_table.html.arb +21 -2
  298. data/app/views/admin/entries/_links.html.arb +1 -1
  299. data/app/views/admin/memberships/_entity_account_input.html.erb +5 -0
  300. data/app/views/admin/memberships/_entity_entry_input.html.erb +5 -0
  301. data/app/views/admin/memberships/_form.html.erb +16 -5
  302. data/app/views/admin/memberships/_role_hint.html.arb +2 -0
  303. data/app/views/admin/users/_form.html.erb +29 -20
  304. data/app/views/components/pageflow/admin/add_membership_button_if_needed.rb +62 -0
  305. data/app/views/components/pageflow/admin/embed_code_field.rb +15 -0
  306. data/app/views/components/pageflow/admin/entry_user_badge_list.rb +15 -7
  307. data/app/views/components/pageflow/admin/grouped_folder_list.rb +20 -16
  308. data/app/views/components/pageflow/admin/members_tab.rb +22 -11
  309. data/app/views/components/pageflow/admin/membership_role_with_tooltip.rb +21 -0
  310. data/app/views/components/pageflow/admin/tabs_view.rb +13 -13
  311. data/app/views/components/pageflow/admin/user_account_badge_list.rb +43 -0
  312. data/app/views/components/pageflow/admin/user_accounts_tab.rb +46 -0
  313. data/app/views/components/pageflow/admin/user_entries_tab.rb +50 -0
  314. data/app/views/components/pageflow/admin/users_tab.rb +32 -4
  315. data/app/views/layouts/pageflow/application.html.erb +3 -2
  316. data/app/views/pageflow/config/_editor_seeds.json.jbuilder +15 -2
  317. data/app/views/pageflow/editor/entries/_entry.json.jbuilder +1 -0
  318. data/app/views/pageflow/editor/files/_file.json.jbuilder +10 -2
  319. data/app/views/pageflow/entries/show.css.erb +4 -11
  320. data/app/views/pageflow/entries/show.json.jbuilder +1 -1
  321. data/app/views/pageflow/entry_json_seed/_entry.json.jbuilder +19 -0
  322. data/app/views/pageflow/file_types/_thumbnails.css.erb +1 -1
  323. data/app/views/pageflow/files/_file.json.jbuilder +12 -0
  324. data/app/views/pageflow/page_background_asset/_element.html.erb +3 -0
  325. data/app/views/pageflow/page_types/_page_type.json.jbuilder +7 -0
  326. data/app/views/pageflow/react/_widget.html.erb +1 -0
  327. data/app/views/pageflow/react/page.html.erb +6 -0
  328. data/app/views/pageflow/video_files/_video_file.json.jbuilder +2 -0
  329. data/config/initializers/admin_resource_tabs.rb +8 -1
  330. data/config/initializers/features.rb +1 -4
  331. data/config/initializers/help_entries.rb +2 -1
  332. data/config/initializers/paperclip.rb +4 -0
  333. data/config/initializers/zencoder.rb +5 -2
  334. data/config/locales/de.yml +370 -108
  335. data/config/locales/en.yml +333 -83
  336. data/config/routes.rb +18 -10
  337. data/db/migrate/20150825133449_update_audio_loop_pages_to_use_atmo.rb +24 -0
  338. data/db/migrate/20160304072911_rename_membership_entry_and_make_polymorphic.rb +19 -0
  339. data/db/migrate/20160304151327_add_role_to_membership.rb +19 -0
  340. data/db/migrate/20160504093145_replace_role_and_account_on_user.rb +42 -0
  341. data/db/migrate/20160531152500_update_users_count.rb +27 -0
  342. data/db/migrate/20160707125400_add_output_presences_to_video_files.rb +5 -0
  343. data/db/migrate/20160824115000_add_parent_file_to_video_files.rb +8 -0
  344. data/db/migrate/20160824115100_add_parent_file_to_audio_files.rb +8 -0
  345. data/db/migrate/20160824115200_add_parent_file_to_image_files.rb +8 -0
  346. data/db/migrate/20160929102700_add_configuration_to_files.rb +7 -0
  347. data/db/migrate/20161007144500_add_text_track_files.rb +31 -0
  348. data/db/migrate/20161216175734_move_configuration_from_file_to_file_usage.rb +27 -0
  349. data/db/migrate/20161230144429_add_processed_attachment_to_text_track_files.rb +8 -0
  350. data/db/migrate/20170222124848_update_video_file_output_presences.rb +12 -0
  351. data/db/migrate/20170421112300_turn_background_video_pages_into_background_image_pages.rb +22 -0
  352. data/lib/generators/pageflow/assets/assets_generator.rb +2 -0
  353. data/lib/generators/pageflow/assets/templates/components.js +4 -0
  354. data/lib/generators/pageflow/initializer/templates/pageflow.rb +23 -20
  355. data/lib/generators/pageflow/seeds/templates/seeds.rb +81 -15
  356. data/lib/pageflow.rb +8 -0
  357. data/lib/pageflow/ability_mixin.rb +196 -62
  358. data/lib/pageflow/admin/tab.rb +21 -0
  359. data/lib/pageflow/admin/tabs.rb +31 -6
  360. data/lib/pageflow/built_in_file_type.rb +39 -0
  361. data/lib/pageflow/built_in_page_types_plugin.rb +80 -0
  362. data/lib/pageflow/configuration.rb +13 -1
  363. data/lib/pageflow/engine.rb +6 -1
  364. data/lib/pageflow/file_type.rb +60 -15
  365. data/lib/pageflow/file_types.rb +20 -2
  366. data/lib/pageflow/page_type.rb +53 -4
  367. data/lib/pageflow/page_types.rb +4 -0
  368. data/lib/pageflow/paperclip_processors/vtt.rb +35 -0
  369. data/lib/pageflow/react.rb +11 -0
  370. data/lib/pageflow/react/page_type.rb +26 -0
  371. data/lib/pageflow/react/widget_type.rb +20 -0
  372. data/lib/pageflow/seeds.rb +59 -15
  373. data/lib/pageflow/user_mixin.rb +18 -25
  374. data/lib/pageflow/version.rb +1 -1
  375. data/lib/pageflow/zencoder_api.rb +18 -4
  376. data/lib/pageflow/zencoder_video_output_definition.rb +375 -127
  377. data/lib/tasks/pageflow_tasks.rake +7 -0
  378. data/spec/factories/accounts.rb +36 -3
  379. data/spec/factories/entries.rb +22 -4
  380. data/spec/factories/invited_user.rb +3 -4
  381. data/spec/factories/memberships.rb +34 -2
  382. data/spec/factories/text_track_files.rb +40 -0
  383. data/spec/factories/users.rb +32 -7
  384. data/spec/factories/video_files.rb +7 -1
  385. data/spec/fixtures/sample.srt +12 -0
  386. data/spec/fixtures/sample.vtt +40 -0
  387. data/vendor/assets/javascripts/dash.all.min.js +14 -0
  388. data/vendor/assets/javascripts/polyfills/bind.js +17 -11
  389. data/vendor/assets/javascripts/videojs-dash.js +302 -0
  390. data/vendor/assets/javascripts/videojs.js +26804 -0
  391. metadata +187 -49
  392. data/app/assets/images/pageflow/themes/default/page_type_pictograms/audio_loop/sprite.png +0 -0
  393. data/app/assets/images/pageflow/themes/default/page_type_pictograms/audio_loop/wide.png +0 -0
  394. data/app/assets/javascripts/pageflow/editor/collections/file_usages_collection.js +0 -21
  395. data/app/assets/javascripts/pageflow/editor/models/file_usage.js +0 -8
  396. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/audio_loop.js +0 -20
  397. data/app/assets/javascripts/pageflow/editor/views/configuration_editors/background_video.js +0 -24
  398. data/app/assets/javascripts/pageflow/page_types/audio.js +0 -135
  399. data/app/assets/javascripts/pageflow/page_types/audio_loop.js +0 -102
  400. data/app/assets/javascripts/pageflow/page_types/background_image.js +0 -44
  401. data/app/assets/javascripts/pageflow/page_types/background_video.js +0 -137
  402. data/app/assets/javascripts/pageflow/page_types/video.js +0 -277
  403. data/app/assets/javascripts/pageflow/ui/views/inputs/file_input_view.js +0 -79
  404. data/app/assets/javascripts/pageflow/video_player/play_button_patch.js +0 -39
  405. data/app/assets/javascripts/pageflow/video_player/player_buffered_patch.js +0 -47
  406. data/app/assets/javascripts/pageflow/video_player/src_from_options_method.js +0 -31
  407. data/app/assets/stylesheets/pageflow/page_types/audio_loop.scss +0 -18
  408. data/app/assets/stylesheets/pageflow/page_types/background-video.scss +0 -50
  409. data/app/controllers/pageflow/editor/file_usages_controller.rb +0 -37
  410. data/app/jobs/pageflow/process_image_file_job.rb +0 -18
  411. data/app/views/pageflow/pages/templates/_audio.html.erb +0 -69
  412. data/app/views/pageflow/pages/templates/_audio_loop.html.erb +0 -34
  413. data/app/views/pageflow/pages/templates/_background_image.html.erb +0 -24
  414. data/app/views/pageflow/pages/templates/_background_video.html.erb +0 -32
  415. data/app/views/pageflow/pages/templates/_video.html.erb +0 -42
  416. data/lib/pageflow/built_in_page_type.rb +0 -79
data/config/routes.rb CHANGED
@@ -9,19 +9,19 @@ Pageflow::Engine.routes.draw do
9
9
 
10
10
  resources :storylines, only: [:create, :update, :destroy] do
11
11
  collection do
12
- patch :order
12
+ put :order
13
13
  post :scaffold
14
14
  end
15
15
 
16
16
  resources :chapters, only: [:create, :update, :destroy] do
17
17
  collection do
18
- patch :order
18
+ put :order
19
19
  post :scaffold
20
20
  end
21
21
 
22
22
  resources :pages, only: [:create, :update, :destroy] do
23
23
  collection do
24
- patch :order
24
+ put :order
25
25
  end
26
26
  end
27
27
  end
@@ -34,10 +34,6 @@ Pageflow::Engine.routes.draw do
34
34
  resources :entries, :only => :index, :shallow => true do
35
35
  get :seed, :on => :member
36
36
 
37
- resources :files, :path => 'files/:collection_name', :only => [:index, :create, :update] do
38
- get :retry, :on => :member
39
- end
40
-
41
37
  resources :file_usages, :only => [:create, :destroy]
42
38
 
43
39
  resources :encoding_confirmations, :only => [:create] do
@@ -49,6 +45,15 @@ Pageflow::Engine.routes.draw do
49
45
  end
50
46
  end
51
47
 
48
+ resources :entries, only: [] do
49
+ resources :files,
50
+ path: 'files/:collection_name',
51
+ only: [:index, :create, :update, :destroy] do
52
+ post :reuse, on: :collection
53
+ post :retry, on: :member
54
+ end
55
+ end
56
+
52
57
  resources :subjects, path: '/subjects/:collection_name', only: [] do
53
58
  resources :widgets, :only => [:index] do
54
59
  patch :batch, :on => :collection
@@ -63,8 +68,11 @@ Pageflow::Engine.routes.draw do
63
68
  get ':entry_id/audio/:id', :to => 'files#show', :as => :short_audio_file, :defaults => {:collection_name => 'audio_files'}
64
69
 
65
70
  resources :entries, :only => [:show]
66
- get ':id', :to => 'entries#show', :as => :short_entry
67
- get '/', :to => 'entries#index', :as => :public_root
68
71
 
69
- get ':id/pages/:page_index', :to => 'entries#page'
72
+ get ':id', to: 'entries#show', as: :short_entry
73
+ get ':id/embed', to: 'entries#show', defaults: {embed: '1'}, as: :entry_embed
74
+
75
+ get '/', to: 'entries#index', as: :public_root
76
+
77
+ get ':id/pages/:page_index', to: 'entries#page'
70
78
  end
@@ -0,0 +1,24 @@
1
+ class UpdateAudioLoopPagesToUseAtmo < ActiveRecord::Migration
2
+ # Pageflow::Page might have gotten out of sync with schema at this
3
+ # point. Use local model instead.
4
+ class MigratedPage < ActiveRecord::Base
5
+ self.table_name = 'pageflow_pages'
6
+
7
+ serialize :configuration, JSON
8
+
9
+ def configuration
10
+ super || {}
11
+ end
12
+ end
13
+
14
+ def change
15
+ MigratedPage.where(template: 'audio_loop').find_each do |page|
16
+ page.template = 'background_image'
17
+
18
+ audio_file_id = page.configuration.delete('audio_file_id')
19
+ page.configuration['atmo_audio_file_id'] = audio_file_id
20
+
21
+ page.save!
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ class RenameMembershipEntryAndMakePolymorphic < ActiveRecord::Migration
2
+ def change
3
+ rename_column :pageflow_memberships, :entry_id, :entity_id
4
+ add_column :pageflow_memberships, :entity_type, :string
5
+ reversible do |dir|
6
+ dir.up do
7
+ update_each_membership_to_reference_an_entity_of_type_entry
8
+ end
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def update_each_membership_to_reference_an_entity_of_type_entry
15
+ execute(<<-SQL)
16
+ UPDATE pageflow_memberships SET entity_type = 'Pageflow::Entry'
17
+ SQL
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ class AddRoleToMembership < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_memberships, :role, :string, null: false, default: 'editor'
4
+
5
+ reversible do |dir|
6
+ dir.up do
7
+ update_each_membership_to_have_default_role
8
+ end
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def update_each_membership_to_have_default_role
15
+ execute(<<-SQL)
16
+ UPDATE pageflow_memberships SET role = 'publisher'
17
+ SQL
18
+ end
19
+ end
@@ -0,0 +1,42 @@
1
+ class ReplaceRoleAndAccountOnUser < ActiveRecord::Migration
2
+ def up
3
+ add_account_member_membership_for_each_user
4
+ update_membership_role_to_manager_for_each_account_manager
5
+
6
+ add_column :users, :admin, :boolean, null: false, default: false
7
+
8
+ set_admin_to_true_for_each_admin
9
+
10
+ remove_column :users, :role, :string, default: 'editor', null: false
11
+ remove_column :users, :account_id, :integer
12
+ end
13
+
14
+ def down
15
+ raise ActiveRecord::IrreversibleMigration
16
+ end
17
+
18
+ private
19
+
20
+ def add_account_member_membership_for_each_user
21
+ execute(<<-SQL)
22
+ INSERT INTO pageflow_memberships (role, user_id, entity_id, entity_type, created_at)
23
+ SELECT 'member', id, account_id, 'Pageflow::Account', created_at FROM users
24
+ SQL
25
+ end
26
+
27
+ def update_membership_role_to_manager_for_each_account_manager
28
+ execute(<<-SQL)
29
+ UPDATE pageflow_memberships INNER JOIN users ON
30
+ pageflow_memberships.user_id = users.id AND
31
+ pageflow_memberships.entity_type = 'Pageflow::Account' AND
32
+ users.role = 'account_manager'
33
+ SET pageflow_memberships.role = 'manager'
34
+ SQL
35
+ end
36
+
37
+ def set_admin_to_true_for_each_admin
38
+ execute(<<-SQL)
39
+ UPDATE users SET users.admin = TRUE WHERE users.role = 'admin'
40
+ SQL
41
+ end
42
+ end
@@ -0,0 +1,27 @@
1
+ class UpdateUsersCount < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :pageflow_entries, :users_count, :integer, default: 0, null: false
4
+
5
+ execute(<<-SQL)
6
+ UPDATE pageflow_accounts SET users_count = (
7
+ SELECT COUNT(*)
8
+ FROM pageflow_memberships
9
+ WHERE pageflow_memberships.entity_id = pageflow_accounts.id AND
10
+ pageflow_memberships.entity_type = 'Pageflow::Account'
11
+ );
12
+ SQL
13
+
14
+ execute(<<-SQL)
15
+ UPDATE pageflow_entries SET users_count = (
16
+ SELECT COUNT(*)
17
+ FROM pageflow_memberships
18
+ WHERE pageflow_memberships.entity_id = pageflow_entries.id AND
19
+ pageflow_memberships.entity_type = 'Pageflow::Entry'
20
+ );
21
+ SQL
22
+ end
23
+
24
+ def self.down
25
+ remove_column :pageflow_entries, :users_count
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ class AddOutputPresencesToVideoFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_video_files, :output_presences, :text
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ class AddParentFileToVideoFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_video_files, :parent_file_id, :integer
4
+ add_column :pageflow_video_files, :parent_file_model_type, :string
5
+ add_index :pageflow_video_files, [:parent_file_id, :parent_file_model_type],
6
+ name: 'index_video_files_on_parent_id_and_parent_model_type'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class AddParentFileToAudioFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_audio_files, :parent_file_id, :integer
4
+ add_column :pageflow_audio_files, :parent_file_model_type, :string
5
+ add_index :pageflow_audio_files, [:parent_file_id, :parent_file_model_type],
6
+ name: 'index_audio_files_on_parent_id_and_parent_model_type'
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ class AddParentFileToImageFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_image_files, :parent_file_id, :integer
4
+ add_column :pageflow_image_files, :parent_file_model_type, :string
5
+ add_index :pageflow_image_files, [:parent_file_id, :parent_file_model_type],
6
+ name: 'index_image_files_on_parent_id_and_parent_model_type'
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ class AddConfigurationToFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_audio_files, :configuration, :text
4
+ add_column :pageflow_image_files, :configuration, :text
5
+ add_column :pageflow_video_files, :configuration, :text
6
+ end
7
+ end
@@ -0,0 +1,31 @@
1
+ class AddTextTrackFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :pageflow_text_track_files do |t|
4
+ t.belongs_to(:entry, index: true)
5
+ t.belongs_to(:uploader, index: true)
6
+
7
+ t.string(:state)
8
+ t.string(:rights)
9
+
10
+ t.string(:attachment_on_filesystem_file_name)
11
+ t.string(:attachment_on_filesystem_content_type)
12
+ t.integer(:attachment_on_filesystem_file_size, limit: 8)
13
+ t.datetime(:attachment_on_filesystem_updated_at)
14
+
15
+ t.string(:attachment_on_s3_file_name)
16
+ t.string(:attachment_on_s3_content_type)
17
+ t.integer(:attachment_on_s3_file_size, limit: 8)
18
+ t.datetime(:attachment_on_s3_updated_at)
19
+
20
+ t.timestamps
21
+
22
+ t.integer(:parent_file_id)
23
+ t.string(:parent_file_model_type)
24
+
25
+ t.text(:configuration)
26
+ end
27
+
28
+ add_index :pageflow_text_track_files, [:parent_file_id, :parent_file_model_type],
29
+ name: 'index_text_track_files_on_parent_id_and_parent_model_type'
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ class MoveConfigurationFromFileToFileUsage < ActiveRecord::Migration
2
+ def up
3
+ add_column :pageflow_file_usages, :configuration, :text
4
+
5
+ {
6
+ pageflow_image_files: 'Pageflow::ImaegFile',
7
+ pageflow_video_files: 'Pageflow::VideoFile',
8
+ pageflow_audio_files: 'Pageflow::AudioFile'
9
+ }.each do |table_name, type_name|
10
+ execute(<<-SQL)
11
+ UPDATE pageflow_file_usages
12
+ INNER JOIN #{table_name} ON
13
+ pageflow_file_usages.file_id = #{table_name}.id AND
14
+ pageflow_file_usages.file_type = "#{type_name}"
15
+ SET pageflow_file_usages.configuration = #{table_name}.configuration
16
+ SQL
17
+ end
18
+
19
+ remove_column :pageflow_image_files, :configuration
20
+ remove_column :pageflow_video_files, :configuration
21
+ remove_column :pageflow_audio_files, :configuration
22
+ end
23
+
24
+ def down
25
+ raise ActiveRecord::IrreversibleMigration
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ class AddProcessedAttachmentToTextTrackFiles < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_text_track_files, :processed_attachment_file_name, :string
4
+ add_column :pageflow_text_track_files, :processed_attachment_content_type, :string
5
+ add_column :pageflow_text_track_files, :processed_attachment_file_size, :integer, limit: 8
6
+ add_column :pageflow_text_track_files, :processed_attachment_updated_at, :datetime
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ class UpdateVideoFileOutputPresences < ActiveRecord::Migration
2
+ def up
3
+ execute(<<-SQL)
4
+ UPDATE pageflow_video_files
5
+ SET output_presences = '{"high":true,"medium":true,"low":true}'
6
+ WHERE output_presences IS NULL;
7
+ SQL
8
+ end
9
+
10
+ def down
11
+ end
12
+ end
@@ -0,0 +1,22 @@
1
+ class TurnBackgroundVideoPagesIntoBackgroundImagePages < ActiveRecord::Migration
2
+ # Pageflow::Page might have gotten out of sync with schema at this
3
+ # point. Use local model instead.
4
+ class MigratedPage < ActiveRecord::Base
5
+ self.table_name = 'pageflow_pages'
6
+
7
+ serialize :configuration, JSON
8
+
9
+ def configuration
10
+ super || {}
11
+ end
12
+ end
13
+
14
+ def change
15
+ MigratedPage.where(template: 'background_video').find_each do |page|
16
+ page.template = 'background_image'
17
+ page.configuration['background_type'] = 'video'
18
+
19
+ page.save!
20
+ end
21
+ end
22
+ end
@@ -14,6 +14,8 @@ module Pageflow
14
14
  template 'application.js', 'app/assets/javascripts/pageflow/application.js'
15
15
  template 'application.scss', 'app/assets/stylesheets/pageflow/application.scss'
16
16
 
17
+ template 'components.js', 'app/assets/javascripts/components.js'
18
+
17
19
  append_to_file 'app/assets/javascripts/active_admin.js.coffee' do
18
20
  "#= require pageflow/admin\n"
19
21
  end
@@ -0,0 +1,4 @@
1
+ //= require i18n
2
+ //= require i18n/translations
3
+
4
+ //= require pageflow/components
@@ -3,14 +3,9 @@ Pageflow.configure do |config|
3
3
  # users.
4
4
  config.mailer_sender = 'change-me-at-config-initializers-pageflow@example.com'
5
5
 
6
- # Page types available in the editor. Add futher page types from
7
- # page type engines below.
8
- config.page_types.register(Pageflow::BuiltInPageType.background_image)
9
- config.page_types.register(Pageflow::BuiltInPageType.background_video)
10
- config.page_types.register(Pageflow::BuiltInPageType.video)
11
- config.page_types.register(Pageflow::BuiltInPageType.audio)
12
- config.page_types.register(Pageflow::BuiltInPageType.audio_loop)
13
- # config.page_types.register(Pageflow::Rainbow::PageType.new)
6
+ # Plugins provide page types and widget types.
7
+ config.plugin(Pageflow.built_in_page_types_plugin)
8
+ # config.plugin(Pageflow::Rainbow.plugin)
14
9
 
15
10
  # Add custom themes by invoking the pageflow:theme generator and
16
11
  # registering the theme here.
@@ -53,25 +48,33 @@ Pageflow.configure do |config|
53
48
  # use s3 storage. All options allowed in paperclip has_attached_file
54
49
  # calls are allowed.
55
50
  config.paperclip_s3_default_options.merge!(
56
- :s3_credentials => {
57
- :bucket => ENV.fetch('S3_BUCKET', 'com-example-pageflow-development'),
58
- :access_key_id => ENV.fetch('S3_ACCESS_KEY', 'xxx'),
59
- :secret_access_key => ENV.fetch('S3_SECRET_KEY', 'xxx'),
60
- :s3_host_name => ENV.fetch('S3_HOST_NAME', 's3-eu-west-1.amazonaws.com')
51
+ s3_credentials: {
52
+ bucket: ENV.fetch('S3_BUCKET', 'com-example-pageflow-development'),
53
+ access_key_id: ENV.fetch('S3_ACCESS_KEY', 'xxx'),
54
+ secret_access_key: ENV.fetch('S3_SECRET_KEY', 'xxx'),
55
+ s3_host_name: ENV.fetch('S3_HOST_NAME', 's3-eu-west-1.amazonaws.com')
61
56
  },
62
- :s3_host_alias => ENV.fetch('S3_HOST_ALIAS', 'com-example-pageflow.s3-website-eu-west-1.amazonaws.com'),
63
- :s3_protocol => ENV.fetch('S3_PROTOCOL', 'http')
57
+ s3_host_alias: ENV.fetch('S3_HOST_ALIAS',
58
+ 'com-example-pageflow.s3-website-eu-west-1.amazonaws.com'),
59
+ s3_protocol: ENV.fetch('S3_PROTOCOL', 'http')
64
60
  )
65
61
 
66
62
  # Default options for paperclip attachments which are supposed to
67
63
  # use filesystem storage. All options allowed in paperclip has_attached_file
68
64
  # calls are allowed.
69
65
  config.zencoder_options.merge!(
70
- :api_key => ENV.fetch('ZENCODER_API_KEY', 'xxx'),
71
- :output_bucket => ENV.fetch('S3_OUTPUT_BUCKET', 'com-example-pageflow-out'),
72
- :s3_host_alias => ENV.fetch('S3_OUTPUT_HOST_ALIAS', 'com-example-pageflow-out.s3-website-eu-west-1.amazonaws.com'),
73
- :s3_protocol => ENV.fetch('S3_PROTOCOL','http'),
74
- :attachments_version => 'v1'
66
+ api_key: ENV.fetch('ZENCODER_API_KEY', 'xxx'),
67
+ output_bucket: ENV.fetch('S3_OUTPUT_BUCKET', 'com-example-pageflow-out'),
68
+ s3_host_alias: ENV.fetch('S3_OUTPUT_HOST_ALIAS',
69
+ 'com-example-pageflow-out.s3-website-eu-west-1.amazonaws.com'),
70
+ s3_protocol: ENV.fetch('S3_PROTOCOL', 'http'),
71
+ attachments_version: 'v1',
72
+
73
+ # Zencoder can generate SMIL files which can be used to have
74
+ # Akamai generate HLS-playlists. By default, Pageflow makes
75
+ # Zencoder generate HLS-playlists. To prevent hitting Zencoder's
76
+ # 20 outputs limit, we disable smil outputs.
77
+ skip_smil: true
75
78
  )
76
79
 
77
80
  # Specify default meta tags to use in published stories.
@@ -4,27 +4,93 @@ include Pageflow::Seeds
4
4
  # a production system.
5
5
  default_user_password('!Pass123')
6
6
 
7
+ publisher_account = account(name: 'Acme Corporation')
8
+ editor_account = account(name: 'General Products')
9
+ previewer_account = account(name: 'Oscorp')
10
+ member_account = account(name: 'Stagg Enterprises')
11
+ account(name: 'Waterloo Road Comprehensive')
12
+
7
13
  account(name: 'Pageflow') do |account|
8
- entry = sample_entry(account: account, title: 'Example Entry')
14
+ politics_entry = sample_entry(account: account, title: 'Story in Politics')
15
+ sports_entry = sample_entry(account: account, title: 'Story in Sports')
16
+ finance_entry = sample_entry(account: account, title: 'Story in Finance')
17
+ entertainment_entry = sample_entry(account: account, title: 'Story in Entertainment')
18
+ sample_entry(account: account, title: 'Story in Science')
9
19
 
10
- user(account: account,
11
- role: 'admin',
12
- email: 'admin@example.com',
20
+ user(email: 'admin@example.com',
13
21
  first_name: 'Alice',
14
- last_name: 'Adminson')
22
+ last_name: 'Adminson',
23
+ admin: true) do |admin|
24
+ membership(user: admin, entity: account, role: :member)
25
+ end
26
+
27
+ user(email: 'accountmanager@example.com',
28
+ first_name: 'Anne',
29
+ last_name: 'McManager') do |account_manager|
30
+ membership(user: account_manager, entity: account, role: :manager)
31
+ membership(user: account_manager, entity: publisher_account, role: :publisher)
32
+ membership(user: account_manager, entity: editor_account, role: :editor)
33
+ membership(user: account_manager, entity: previewer_account, role: :previewer)
34
+ membership(user: account_manager, entity: member_account, role: :member)
35
+ end
36
+
37
+ user(email: 'accountpublisher@example.com',
38
+ first_name: 'Alina',
39
+ last_name: 'Publisha') do |account_publisher|
40
+ membership(user: account_publisher, entity: account, role: :publisher)
41
+ membership(user: account_publisher, entity: publisher_account, role: :editor)
42
+ membership(user: account_publisher, entity: editor_account, role: :previewer)
43
+ membership(user: account_publisher, entity: previewer_account, role: :member)
44
+ end
45
+
46
+ user(email: 'accounteditor@example.com',
47
+ first_name: 'Annalena',
48
+ last_name: 'Editorian') do |account_editor|
49
+ membership(user: account_editor, entity: account, role: :editor)
50
+ membership(user: account_editor, entity: publisher_account, role: :previewer)
51
+ membership(user: account_editor, entity: editor_account, role: :member)
52
+ end
15
53
 
16
- user(account: account,
17
- role: 'account_manager',
18
- email: 'accountmanager@example.com',
19
- first_name: 'Alfred',
20
- last_name: 'Mc Count')
54
+ user(email: 'accountpreviewer@example.com',
55
+ first_name: 'Agnieszka',
56
+ last_name: 'Previewski') do |account_previewer|
57
+ membership(user: account_previewer, entity: account, role: :previewer)
58
+ membership(user: account_previewer, entity: publisher_account, role: :member)
59
+ end
60
+
61
+ user(email: 'accountmember@example.com',
62
+ first_name: 'Asuna',
63
+ last_name: 'Membergami') do |account_member|
64
+ membership(user: account_member, entity: account, role: :member)
65
+ end
66
+
67
+ user(email: 'entrymanager@example.com',
68
+ first_name: 'Evgen',
69
+ last_name: 'Managerov') do |entry_manager|
70
+ membership(user: entry_manager, entity: politics_entry, role: :manager)
71
+ membership(user: entry_manager, entity: sports_entry, role: :publisher)
72
+ membership(user: entry_manager, entity: finance_entry, role: :editor)
73
+ membership(user: entry_manager, entity: entertainment_entry, role: :previewer)
74
+ end
75
+
76
+ user(email: 'entrypublisher@example.com',
77
+ first_name: 'Elmar',
78
+ last_name: 'Publishero') do |entry_publisher|
79
+ membership(user: entry_publisher, entity: politics_entry, role: :publisher)
80
+ membership(user: entry_publisher, entity: sports_entry, role: :editor)
81
+ membership(user: entry_publisher, entity: finance_entry, role: :previewer)
82
+ end
21
83
 
22
- user(account: account,
23
- email: 'editor@example.com',
24
- role: 'editor',
84
+ user(email: 'entryeditor@example.com',
25
85
  first_name: 'Ed',
26
- last_name: 'Edison') do |editor|
86
+ last_name: 'Edison') do |entry_editor|
87
+ membership(user: entry_editor, entity: politics_entry, role: :editor)
88
+ membership(user: entry_editor, entity: sports_entry, role: :previewer)
89
+ end
27
90
 
28
- membership(user: editor, entry: entry)
91
+ user(email: 'entrypreviewer@example.com',
92
+ first_name: 'Émile',
93
+ last_name: 'Previewère') do |entry_previewer|
94
+ membership(user: entry_previewer, entity: politics_entry, role: :previewer)
29
95
  end
30
96
  end