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
@@ -194,6 +194,7 @@ de:
194
194
  share_image_id: Social Sharing Bild
195
195
  share_url: Social Sharing URL
196
196
  summary: Zusammenfassung
197
+ theme_name: Theme
197
198
  title: Titel
198
199
  updated_at: Geändert am
199
200
  url: Permalink
@@ -754,7 +755,8 @@ de:
754
755
  accounts:
755
756
  no_entries: Keine Beiträge
756
757
  no_members: Keine Benutzer
757
- widgets_inline_help: Die hier ausgewählten Widgets werden als Standard für neue Beiträge des Kontos verwendet. Änderungen wirken sich nicht auf existierende Beiträge aus.
758
+ theming_defaults_inline_help: Die folgenden Einstellungen werden als Standard für neue Beiträge des Kontos verwendet. Änderungen wirken sich nicht auf existierende Beiträge aus.
759
+ widgets_inline_help: DELETED
758
760
  entries:
759
761
  add_folder: Ordner hinzufügen
760
762
  confirm_depublish: Soll der Beitrag wirklich depubliziert werden?
@@ -981,6 +983,8 @@ de:
981
983
  captions: Ton-Ersatz-Textspur
982
984
  descriptions: Bild-Ersatz-Textspur
983
985
  subtitles: Übersetzungs-Textspur
986
+ default_theme:
987
+ name: Standard
984
988
  delayed_text_fade_in:
985
989
  feature_name: Text verzögert einblenden
986
990
  devise:
@@ -1125,6 +1129,11 @@ de:
1125
1129
  ratio4to3Portrait: 4:3 Portrait
1126
1130
  save: Speichern
1127
1131
  title: Bildausschnitt anpassen
1132
+ change_theme_dialog:
1133
+ close: Schließen
1134
+ header: Themes
1135
+ preview_header_prefix: Vorschau
1136
+ preview_header_suffix: "-Theme"
1128
1137
  chapter_item:
1129
1138
  new_page: Neue Seite
1130
1139
  save_error: Beim Speichern des Kapitels ist ein Fehler aufgetreten.
@@ -1171,6 +1180,8 @@ de:
1171
1180
  outline: Gliederung
1172
1181
  retry: Erneut versuchen
1173
1182
  save_error: Beim Speichern des Erzählstrangs ist ein Problem aufgetreten.
1183
+ edit_widget:
1184
+ back: Erscheinungsbild
1174
1185
  embedded:
1175
1186
  page_link:
1176
1187
  reset: Zurücksetzen
@@ -1207,8 +1218,8 @@ de:
1207
1218
  open_help: Hilfe anzeigen
1208
1219
  inputs:
1209
1220
  reference:
1210
- edit: Verknüpfung ändern
1211
- reset: Verknüpfung entfernen
1221
+ edit: DELETED
1222
+ reset: DELETED
1212
1223
  list_blank_slate:
1213
1224
  text: "(Keine Einträge)"
1214
1225
  list_item:
@@ -1274,9 +1285,15 @@ de:
1274
1285
  text_tracks:
1275
1286
  edit_file_header: Metadaten
1276
1287
  upload: Hinzufügen
1288
+ theme:
1289
+ use: Verwenden
1290
+ widget_item:
1291
+ settings: Einstellungen
1277
1292
  text_track_files:
1278
1293
  label_missing: "(Label fehlt)"
1279
1294
  srclang_missing: "(Fehlt)"
1295
+ themes:
1296
+ header: Themes
1280
1297
  views:
1281
1298
  chapter_item_view:
1282
1299
  chapter: Kapitel
@@ -1319,7 +1336,11 @@ de:
1319
1336
  edit_file_settings: Datei-Einstellungen...
1320
1337
  no_default_text_track: "(Kein)"
1321
1338
  reference_input_view:
1339
+ choose: Verknüpfung ändern
1322
1340
  none: "(Kein)"
1341
+ unset: Verknüpfung entfernen
1342
+ theme_input_view:
1343
+ choose: Theme ändern
1323
1344
  page_item_view:
1324
1345
  unnamed: "(Unbenannt)"
1325
1346
  page_link_item_view:
@@ -1666,6 +1687,8 @@ de:
1666
1687
  scroll_right: Scrollen (von rechts)
1667
1688
  quotas:
1668
1689
  exhausted: Quota verbraucht.
1690
+ selectable_themes:
1691
+ feature_name: Editor-Theme-Auswahl
1669
1692
  storyline_attributes:
1670
1693
  main:
1671
1694
  inline_help: Macht die erste Seite dieses Erzählstrangs zur Startseite des Beitrags.
@@ -194,6 +194,7 @@ en:
194
194
  share_image_id: Social Sharing Image
195
195
  share_url: Social Sharing URL
196
196
  summary: Summary
197
+ theme_name: Theme
197
198
  title: Title
198
199
  updated_at: Updated at
199
200
  url: Permalink
@@ -754,7 +755,8 @@ en:
754
755
  accounts:
755
756
  no_entries: No Stories
756
757
  no_members: No members
757
- widgets_inline_help: The widgets selected here will be used as defaults for new entries in this account. Changes do not affect existing entries.
758
+ theming_defaults_inline_help: The following settings will be used as defaults for new entries in this account. Changes do not affect existing entries.
759
+ widgets_inline_help: DELETED
758
760
  entries:
759
761
  add_folder: Add folder
760
762
  confirm_depublish: Unpublish this story?
@@ -979,6 +981,8 @@ en:
979
981
  captions: Audio Replacement Text Track
980
982
  descriptions: Image Description Text Track
981
983
  subtitles: Translation Text Track
984
+ default_theme:
985
+ name: Default
982
986
  delayed_text_fade_in:
983
987
  feature_name: Delayed text fade in
984
988
  devise:
@@ -1125,6 +1129,11 @@ en:
1125
1129
  ratio4to3Portrait: 4:3 Portrait
1126
1130
  save: Save
1127
1131
  title: Adjust position
1132
+ change_theme_dialog:
1133
+ close: Close
1134
+ header: Themes
1135
+ preview_header_prefix: Preview
1136
+ preview_header_suffix: "-Theme"
1128
1137
  chapter_item:
1129
1138
  new_page: New page
1130
1139
  save_error: Errors were detected while saving this chapter.
@@ -1171,6 +1180,8 @@ en:
1171
1180
  outline: Outline
1172
1181
  retry: Retry
1173
1182
  save_error: Errors were detected while saving the storyline.
1183
+ edit_widget:
1184
+ back: Appearance
1174
1185
  embedded:
1175
1186
  page_link:
1176
1187
  reset: Reset
@@ -1207,8 +1218,8 @@ en:
1207
1218
  open_help: Open help
1208
1219
  inputs:
1209
1220
  reference:
1210
- edit: Edit
1211
- reset: Reset
1221
+ edit: DELETED
1222
+ reset: DELETED
1212
1223
  list_blank_slate:
1213
1224
  text: "(No items)"
1214
1225
  list_item:
@@ -1274,9 +1285,15 @@ en:
1274
1285
  text_tracks:
1275
1286
  edit_file_header: Metadata
1276
1287
  upload: Add
1288
+ theme:
1289
+ use: Use
1290
+ widget_item:
1291
+ settings: Settings
1277
1292
  text_track_files:
1278
1293
  label_missing: "(Label missing)"
1279
1294
  srclang_missing: "(Missing)"
1295
+ themes:
1296
+ header: Themes
1280
1297
  views:
1281
1298
  chapter_item_view:
1282
1299
  chapter: Chapter
@@ -1319,7 +1336,11 @@ en:
1319
1336
  edit_file_settings: File settings...
1320
1337
  no_default_text_track: "(None)"
1321
1338
  reference_input_view:
1339
+ choose: Edit
1322
1340
  none: "(None)"
1341
+ unset: Reset
1342
+ theme_input_view:
1343
+ choose: Change theme
1323
1344
  page_item_view:
1324
1345
  unnamed: "(New page)"
1325
1346
  page_link_item_view:
@@ -1638,6 +1659,8 @@ en:
1638
1659
  scroll_right: Scroll right
1639
1660
  quotas:
1640
1661
  exhausted: Quota exhausted
1662
+ selectable_themes:
1663
+ feature_name: Editor theme selection
1641
1664
  storyline_attributes:
1642
1665
  main:
1643
1666
  inline_help: Turns the first page of this storyline into the start page of the entry.
@@ -0,0 +1,5 @@
1
+ class AddConfigurationToWidgets < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_widgets, :configuration, :text
4
+ end
5
+ end
@@ -2,7 +2,7 @@ class UpdateVideoFileOutputPresences < ActiveRecord::Migration
2
2
  def up
3
3
  execute(<<-SQL)
4
4
  UPDATE pageflow_video_files
5
- SET output_presences = '{"high":true,"medium":true,"low":true}'
5
+ SET output_presences = '{"high":true,"medium":true,"low":true,"hls-playlist":true}'
6
6
  WHERE output_presences IS NULL;
7
7
  SQL
8
8
  end
@@ -0,0 +1,12 @@
1
+ class AddThemeNameToRevisions < ActiveRecord::Migration
2
+ def change
3
+ add_column :pageflow_revisions, :theme_name, :string, null: false, default: 'default'
4
+
5
+ execute(<<-SQL)
6
+ UPDATE pageflow_revisions, pageflow_entries, pageflow_themings
7
+ SET pageflow_revisions.theme_name = pageflow_themings.theme_name
8
+ WHERE pageflow_revisions.entry_id = pageflow_entries.id
9
+ AND pageflow_entries.theming_id = pageflow_themings.id
10
+ SQL
11
+ end
12
+ end
@@ -0,0 +1,24 @@
1
+ class ResetCopiedSnapshotType < ActiveRecord::Migration
2
+ def up
3
+ fix_restored_drafts
4
+ fix_publications_created_from_restored_drafts
5
+ end
6
+
7
+ private
8
+
9
+ def fix_restored_drafts
10
+ execute(<<-SQL)
11
+ UPDATE pageflow_revisions
12
+ SET snapshot_type = NULL
13
+ WHERE frozen_at IS NULL;
14
+ SQL
15
+ end
16
+
17
+ def fix_publications_created_from_restored_drafts
18
+ execute(<<-SQL)
19
+ UPDATE pageflow_revisions
20
+ SET snapshot_type = NULL
21
+ WHERE published_at IS NOT NULL;
22
+ SQL
23
+ end
24
+ end
@@ -7,9 +7,19 @@ module Pageflow
7
7
 
8
8
  def add_route
9
9
  inject_into_file 'config/routes.rb', after: " ActiveAdmin.routes(self)\n" do
10
- " Pageflow.routes(self)\n"
10
+ <<-HEREDOC
11
+ Pageflow.routes(self)
12
+
13
+ authenticate :user, lambda { |user| user.admin? } do
14
+ mount Resque::Server.new, at: "/background_jobs"
15
+ end
16
+ HEREDOC
11
17
  end
12
18
  end
19
+
20
+ def require_resque_server
21
+ prepend_to_file 'config/routes.rb', "require 'resque/server'\nrequire 'resque_scheduler/server'\n\n"
22
+ end
13
23
  end
14
24
  end
15
25
  end
@@ -1,10 +1,15 @@
1
1
  require 'rails/generators'
2
+ require 'securerandom'
2
3
 
3
4
  module Pageflow
4
5
  module Generators
5
6
  class SeedsGenerator < Rails::Generators::Base
6
7
  desc "Requires the pageflow seeds in db/seeds.rb"
7
8
 
9
+ argument :password,
10
+ default: SecureRandom.random_number(36**12).to_s(36).rjust(12, '0'),
11
+ desc: 'Default user password'
12
+
8
13
  source_root File.expand_path("../templates", __FILE__)
9
14
 
10
15
  def create_initializer
@@ -1,8 +1,10 @@
1
+ # This file was generated by Pageflow.
2
+ # It will create example users for each of the Pageflow roles.
3
+ # Feel free to edit or remove it; these entries are not required for Pageflow to function.
4
+
1
5
  include Pageflow::Seeds
2
6
 
3
- # Make sure to change the password if you intend to apply this seed to
4
- # a production system.
5
- default_user_password('!Pass123')
7
+ default_user_password('<%= password %>')
6
8
 
7
9
  publisher_account = account(name: 'Acme Corporation')
8
10
  editor_account = account(name: 'General Products')
@@ -15,6 +15,9 @@ module Pageflow
15
15
  def copy_template
16
16
  directory('themes', File.join('app', 'assets', 'stylesheets', 'pageflow', 'themes'))
17
17
  empty_directory(File.join('app', 'assets', 'images', 'pageflow', 'themes', name))
18
+ copy_file('preview.png', "app/assets/images/pageflow/themes/#{name}/preview.png")
19
+ copy_file('preview_thumbnail.png',
20
+ "app/assets/images/pageflow/themes/#{name}/preview_thumbnail.png")
18
21
  end
19
22
  end
20
23
  end
@@ -1,6 +1,8 @@
1
1
  module Pageflow
2
2
  # Defines the default abilities for the Pageflow models.
3
3
  module AbilityMixin
4
+ include ActiveAdminCanCanFix
5
+
4
6
  # Call this in the ability initializer.
5
7
  def pageflow_default_abilities(user)
6
8
  return if user.nil?
@@ -13,8 +15,8 @@ module Pageflow
13
15
  AccountPolicy.new(user, account).update?
14
16
  end
15
17
 
16
- can :index, Account do |account|
17
- AccountPolicy.new(user, account).index?
18
+ can :update_feature_configuration_on, Account do |account|
19
+ AccountPolicy.new(user, account).update_feature_configuration_on?
18
20
  end
19
21
 
20
22
  can :add_member_to, Account do |account|
@@ -43,6 +45,18 @@ module Pageflow
43
45
  MembershipPolicy.new(user, membership).destroy?
44
46
  end
45
47
 
48
+ can :index, :users do
49
+ UserPolicy.new(user, User.new).index?
50
+ end
51
+
52
+ can :create_any, :users do
53
+ UserPolicy.new(user, User.new).create_any?
54
+ end
55
+
56
+ can :add_account_to, :users do
57
+ UserPolicy.new(user, User.new).add_account_to?
58
+ end
59
+
46
60
  can :set_admin, ::User do |managed_user|
47
61
  UserPolicy.new(user, managed_user).set_admin?
48
62
  end
@@ -59,6 +73,12 @@ module Pageflow
59
73
  AccountPolicy.new(user, Account.new).index?
60
74
  end
61
75
 
76
+ can :index, :entries
77
+
78
+ can :create_any, :entries do
79
+ EntryPolicy.new(user, Entry.new).create_any?
80
+ end
81
+
62
82
  can :see_own_role_on, :entries do
63
83
  !user.admin?
64
84
  end
@@ -202,14 +222,14 @@ module Pageflow
202
222
  UserPolicy.new(user, managed_user).create?
203
223
  end
204
224
 
205
- can :index, ::User, UserPolicy::Scope.new(user, ::User).resolve do |managed_user|
206
- UserPolicy.new(user, managed_user).index?
207
- end
208
-
209
225
  can :read, ::User, UserPolicy::Scope.new(user, ::User).resolve do |managed_user|
210
226
  UserPolicy.new(user, managed_user).read?
211
227
  end
212
228
 
229
+ can :see_admin_status, ::User do |managed_user|
230
+ UserPolicy.new(user, managed_user).see_admin_status?
231
+ end
232
+
213
233
  can :redirect_to_user,
214
234
  ::User,
215
235
  UserPolicy::Scope.new(user, ::User).resolve do |managed_user|
@@ -223,6 +243,7 @@ module Pageflow
223
243
 
224
244
  if user.admin?
225
245
  can [:create, :configure_folder_on], Account
246
+ can :create_any, :accounts
226
247
  can :destroy, Account do |account|
227
248
  account.users.empty? && account.entries.empty?
228
249
  end
@@ -0,0 +1,34 @@
1
+ module Pageflow
2
+ # @api private
3
+ #
4
+ # ActiveAdmin passes class objects to CanCan when authorizing access
5
+ # to the "index" and "new resource" pages. CanCan does not evaluate
6
+ # `can` blocks when classes are passed as subjects. Since the above
7
+ # code relies on block evaluation for all but the `admin` case, this
8
+ # causes "new" buttons and menu items to be displayed even though
9
+ # access should not be permitted.
10
+ #
11
+ # see also https://github.com/activeadmin/activeadmin/issues/5144
12
+ #
13
+ # Detect these cases and pass the collection name as subject
14
+ # instead. To prevent collision with existing cases, rename actions:
15
+ #
16
+ # :read, User -> :index, :users
17
+ # :create, User -> :create_any, :users
18
+ module ActiveAdminCanCanFix
19
+ def can?(action, subject)
20
+ if [:read, :create].include?(action) &&
21
+ [Entry, Account, User].include?(subject)
22
+ collection_name = subject.name.demodulize.underscore.pluralize.to_sym
23
+
24
+ if action == :read
25
+ super(:index, collection_name)
26
+ elsif action == :create
27
+ super(:create_any, collection_name)
28
+ end
29
+ else
30
+ super
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ module Pageflow
2
+ class Configuration
3
+ # Permissions related options to be defined in the pageflow
4
+ # initializer of the main app.
5
+ class Permissions
6
+ def initialize
7
+ @only_admins_may_update_features = false
8
+ @only_admins_may_see_admin_boolean = false
9
+ @only_admins_may_update_theming = false
10
+ end
11
+
12
+ # Restrict access to features tabs to admins. Defaults to false.
13
+ # @since 12.1
14
+ attr_accessor :only_admins_may_update_features
15
+
16
+ # Restrict visibility of admin flag on user admin page to
17
+ # admins. Defaults to false.
18
+ # @since 12.1
19
+ attr_accessor :only_admins_may_see_admin_boolean
20
+
21
+ # Restrict access to theming drop down on entry edit admin page
22
+ # to admins. Defaults to false.
23
+ # @since 12.1
24
+ attr_accessor :only_admins_may_update_theming
25
+ end
26
+ end
27
+ end
@@ -252,6 +252,25 @@ module Pageflow
252
252
  # take. Defaults to `[:captions, :subtitles, :descriptions]`.
253
253
  attr_reader :available_text_track_kinds
254
254
 
255
+ # Allow one user to be member of multiple accounts. Defaults to
256
+ # true.
257
+ # @since 12.1
258
+ attr_accessor :allow_multiaccount_users
259
+
260
+ # Options hash for account admin menu. Options from config precede
261
+ # defaults.
262
+ # @since 12.1
263
+ attr_accessor :account_admin_menu_options
264
+
265
+ # Sublayer for permissions related config.
266
+ # @since 12.1
267
+ attr_reader :permissions
268
+
269
+ # Defines the editor lock polling interval.
270
+ # @return [number]
271
+ # @since 12.1
272
+ attr_accessor :edit_lock_polling_interval
273
+
255
274
  def initialize
256
275
  @paperclip_filesystem_default_options = {validate_media_type: false}
257
276
  @paperclip_s3_default_options = {validate_media_type: false}
@@ -294,6 +313,14 @@ module Pageflow
294
313
  @authorize_user_deletion = lambda { |_user| true }
295
314
 
296
315
  @available_text_track_kinds = [:captions, :subtitles, :descriptions]
316
+
317
+ @allow_multiaccount_users = true
318
+
319
+ @account_admin_menu_options = {}
320
+
321
+ @permissions = Permissions.new
322
+
323
+ @edit_lock_polling_interval = 15.seconds
297
324
  end
298
325
 
299
326
  # Activate a plugin.
@@ -342,6 +369,7 @@ module Pageflow
342
369
  delegate :widget_types, to: :config
343
370
  delegate :help_entries, to: :config
344
371
  delegate :admin_form_inputs, to: :config
372
+ delegate :themes, to: :config
345
373
  end
346
374
  end
347
375
  end
@@ -15,6 +15,7 @@ require 'resque_mailer'
15
15
  require 'resque_scheduler'
16
16
 
17
17
  require 'active_admin'
18
+ require 'activeadmin-searchable_select'
18
19
 
19
20
  require 'jquery-layout-rails'
20
21
  require 'backbone-rails'
@@ -57,25 +58,6 @@ module Pageflow
57
58
  config.i18n.reload!
58
59
  end
59
60
 
60
- # Precompile additional assets. pageflow/editor.* has to be
61
- # provided by the main app.
62
- config.assets.precompile += %w(pageflow/editor.js pageflow/editor.css
63
- pageflow/application_with_simulated_media_queries.css
64
- pageflow/print_view.css
65
- pageflow/lt_ie9.js pageflow/lt_ie9.css pageflow/ie9.js pageflow/ie9.css
66
- video-js.swf vjs.eot vjs.svg vjs.ttf vjs.woff)
67
-
68
- config.assets.precompile << lambda do |path, _filename|
69
- Pageflow.config.themes.any? do |theme|
70
- path == theme.stylesheet_path
71
- end
72
- end
73
-
74
- config.assets.precompile << lambda do |path, filename|
75
- filename.start_with?(Engine.root.join('app/assets').to_s) &&
76
- !['.js', '.css', ''].include?(File.extname(path))
77
- end
78
-
79
61
  # Make sure the configuration is recreated when classes are
80
62
  # reloded. Otherwise registered page types might still point to
81
63
  # unloaded classes in development mode.
@@ -88,5 +70,29 @@ module Pageflow
88
70
  FactoryGirl.definition_file_paths.unshift(Engine.root.join('spec', 'factories'))
89
71
  end
90
72
  end
73
+
74
+ # Precompile additional assets. pageflow/editor.* has to be
75
+ # provided by the main app.
76
+ initializer 'pageflow.assets.precompile' do |app|
77
+ app.config.assets.precompile += %w(
78
+ pageflow/editor.js pageflow/editor.css
79
+ pageflow/application_with_simulated_media_queries.css
80
+ pageflow/print_view.css
81
+ pageflow/lt_ie9.js pageflow/lt_ie9.css pageflow/ie9.js pageflow/ie9.css
82
+ pageflow/vendor.js
83
+ video-js.swf vjs.eot vjs.svg vjs.ttf vjs.woff
84
+ )
85
+
86
+ app.config.assets.precompile << lambda do |path, _filename|
87
+ Pageflow.config.themes.any? do |theme|
88
+ path == theme.stylesheet_path
89
+ end
90
+ end
91
+
92
+ app.config.assets.precompile << lambda do |path, filename|
93
+ filename.start_with?(Engine.root.join('app/assets').to_s) &&
94
+ !['.js', '.css', ''].include?(File.extname(path))
95
+ end
96
+ end
91
97
  end
92
98
  end
Binary file
@@ -54,7 +54,7 @@ module Pageflow
54
54
  # @return [Theming] newly built theming
55
55
  def build_default_theming_for(account, attributes = {}, &block)
56
56
  default_attributes = {
57
- theme_name: Pageflow.config.themes.names.first,
57
+ theme_name: Pageflow.config_for(account).themes.names.first,
58
58
 
59
59
  imprint_link_label: 'Impressum',
60
60
  imprint_link_url: 'http://example.com/impressum.html',
@@ -12,6 +12,14 @@ module Pageflow
12
12
  "pageflow/themes/#{name}.css"
13
13
  end
14
14
 
15
+ def preview_image_path
16
+ "pageflow/themes/#{name}/preview.png"
17
+ end
18
+
19
+ def preview_thumbnail_path
20
+ "pageflow/themes/#{name}/preview_thumbnail.png"
21
+ end
22
+
15
23
  def has_home_button?
16
24
  !@options[:no_home_button]
17
25
  end
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '12.0.4'.freeze
2
+ VERSION = '12.1.0'.freeze
3
3
  end
@@ -25,11 +25,24 @@ module Pageflow
25
25
  true
26
26
  end
27
27
 
28
+ # Override instead of render to use the widget
29
+ # configuration. Return html as string.
30
+ def render_with_configuration(template, entry, _configuration)
31
+ render(template, entry)
32
+ end
33
+
28
34
  # Override to return html as string.
29
35
  def render(template, entry)
30
36
  template.render(File.join('pageflow', name, 'widget'), entry: entry)
31
37
  end
32
38
 
39
+ # Override instead of render_head_fragment to use the widget
40
+ # configuration. Return html as string that should be placed in
41
+ # the head element of the page.
42
+ def render_head_fragment_with_configuration(template, entry, _configuration)
43
+ render_head_fragment(template, entry)
44
+ end
45
+
33
46
  # Override to return html that should be placed in the head
34
47
  # element of the page. Not supported inside the editor.
35
48
  def render_head_fragment(template, entry)