pageflow-sitemap 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.jshintrc +18 -0
  4. data/Gemfile +24 -0
  5. data/LICENSE.md +20 -0
  6. data/README.md +47 -0
  7. data/Rakefile +32 -0
  8. data/app/assets/images/pageflow/sitemap/.keep +0 -0
  9. data/app/assets/javascripts/pageflow/sitemap/.keep +0 -0
  10. data/app/assets/javascripts/pageflow/sitemap/editor/controllers/abstract_controller.js +68 -0
  11. data/app/assets/javascripts/pageflow/sitemap/editor/controllers/editor_mode_controller.js +301 -0
  12. data/app/assets/javascripts/pageflow/sitemap/editor/controllers/fragment_parser.js +31 -0
  13. data/app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js +37 -0
  14. data/app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_navigator.js +43 -0
  15. data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/mouse_wheel.js +43 -0
  16. data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/multi_drag.js +73 -0
  17. data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/scroll_and_zoom.js +286 -0
  18. data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/selection_rect.js +104 -0
  19. data/app/assets/javascripts/pageflow/sitemap/editor/d3/behaviors/tooltip_target.js +24 -0
  20. data/app/assets/javascripts/pageflow/sitemap/editor/d3/graph_view.js +277 -0
  21. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/chapter_collision.js +33 -0
  22. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/collision.js +116 -0
  23. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/dragging_decorator.js +58 -0
  24. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/grid.js +238 -0
  25. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout/link_dragging_decorator.js +42 -0
  26. data/app/assets/javascripts/pageflow/sitemap/editor/d3/layout.js +94 -0
  27. data/app/assets/javascripts/pageflow/sitemap/editor/d3/options.js +25 -0
  28. data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/follow_path.js +36 -0
  29. data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/linkpath.js +64 -0
  30. data/app/assets/javascripts/pageflow/sitemap/editor/d3/paths/successor_path.js +49 -0
  31. data/app/assets/javascripts/pageflow/sitemap/editor/d3/utils.js +33 -0
  32. data/app/assets/javascripts/pageflow/sitemap/editor/d3/view_model.js +202 -0
  33. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/add_button_view.js +28 -0
  34. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/chapter_placeholders_view.js +22 -0
  35. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/chapters_view.js +89 -0
  36. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/group_view.js +104 -0
  37. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/page_links_view.js +7 -0
  38. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/pages_view.js +112 -0
  39. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/selectable_links_view.js +104 -0
  40. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/storylines_view.js +86 -0
  41. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/successor_links_view.js +7 -0
  42. data/app/assets/javascripts/pageflow/sitemap/editor/d3/views/text_label_view.js +45 -0
  43. data/app/assets/javascripts/pageflow/sitemap/editor/d3.js +20 -0
  44. data/app/assets/javascripts/pageflow/sitemap/editor/feature.js +126 -0
  45. data/app/assets/javascripts/pageflow/sitemap/editor/models/selection.js +41 -0
  46. data/app/assets/javascripts/pageflow/sitemap/editor/templates/scroll_bar.jst.ejs +2 -0
  47. data/app/assets/javascripts/pageflow/sitemap/editor/templates/sitemap.jst.ejs +85 -0
  48. data/app/assets/javascripts/pageflow/sitemap/editor/views/scroll_bar_view.js +130 -0
  49. data/app/assets/javascripts/pageflow/sitemap/editor/views/scroll_pane_view.js +73 -0
  50. data/app/assets/javascripts/pageflow/sitemap/editor/views/sitemap_view.js +137 -0
  51. data/app/assets/javascripts/pageflow/sitemap/editor.js +14 -0
  52. data/app/assets/javascripts/pageflow/sitemap/feature.js +3 -0
  53. data/app/assets/javascripts/pageflow/sitemap/scroll_navigator.js +112 -0
  54. data/app/assets/javascripts/pageflow/sitemap.js +5 -0
  55. data/app/assets/stylesheets/pageflow/sitemap/.keep +0 -0
  56. data/app/assets/stylesheets/pageflow/sitemap/editor/add_button.scss +29 -0
  57. data/app/assets/stylesheets/pageflow/sitemap/editor/chapter_placeholders.scss +14 -0
  58. data/app/assets/stylesheets/pageflow/sitemap/editor/chapters.scss +62 -0
  59. data/app/assets/stylesheets/pageflow/sitemap/editor/page_links.scss +19 -0
  60. data/app/assets/stylesheets/pageflow/sitemap/editor/pages.scss +78 -0
  61. data/app/assets/stylesheets/pageflow/sitemap/editor/scroll_bar.css.scss +33 -0
  62. data/app/assets/stylesheets/pageflow/sitemap/editor/scroll_pane.scss +15 -0
  63. data/app/assets/stylesheets/pageflow/sitemap/editor/selectable_links.scss +88 -0
  64. data/app/assets/stylesheets/pageflow/sitemap/editor/selection_rect.scss +12 -0
  65. data/app/assets/stylesheets/pageflow/sitemap/editor/storylines.scss +59 -0
  66. data/app/assets/stylesheets/pageflow/sitemap/editor/successor_links.scss +42 -0
  67. data/app/assets/stylesheets/pageflow/sitemap/editor/text_label.scss +23 -0
  68. data/app/assets/stylesheets/pageflow/sitemap/editor/toolbar.css.scss +45 -0
  69. data/app/assets/stylesheets/pageflow/sitemap/editor.css.scss +96 -0
  70. data/config/locales/de.yml +16 -0
  71. data/config/locales/en.yml +48 -0
  72. data/config/locales/new/help_button.de.yml +7 -0
  73. data/config/locales/new/help_button.en.yml +7 -0
  74. data/config/locales/new/tooltips.de.yml +11 -0
  75. data/config/locales/new/tooltips.en.yml +11 -0
  76. data/config/routes.rb +7 -0
  77. data/config/spring.rb +1 -0
  78. data/exec/rails +12 -0
  79. data/exec/spring +18 -0
  80. data/exec/teaspoon +17 -0
  81. data/lib/pageflow/sitemap/engine.rb +10 -0
  82. data/lib/pageflow/sitemap/plugin.rb +11 -0
  83. data/lib/pageflow/sitemap/version.rb +5 -0
  84. data/lib/pageflow-sitemap.rb +9 -0
  85. data/pageflow-sitemap.gemspec +29 -0
  86. data/spec/d/r/.gitignore +16 -0
  87. data/spec/d/r/README.rdoc +28 -0
  88. data/spec/d/r/Rakefile +6 -0
  89. data/spec/d/r/app/admin/dashboard.rb +33 -0
  90. data/spec/d/r/app/assets/images/.keep +0 -0
  91. data/spec/d/r/app/assets/javascripts/active_admin.js.coffee +2 -0
  92. data/spec/d/r/app/assets/javascripts/application.js +16 -0
  93. data/spec/d/r/app/assets/javascripts/pageflow/application.js +1 -0
  94. data/spec/d/r/app/assets/javascripts/pageflow/editor.js +4 -0
  95. data/spec/d/r/app/assets/stylesheets/active_admin.css.scss +18 -0
  96. data/spec/d/r/app/assets/stylesheets/application.css +13 -0
  97. data/spec/d/r/app/assets/stylesheets/pageflow/application.css.scss +1 -0
  98. data/spec/d/r/app/assets/stylesheets/pageflow/editor.css.scss +1 -0
  99. data/spec/d/r/app/controllers/application_controller.rb +5 -0
  100. data/spec/d/r/app/controllers/concerns/.keep +0 -0
  101. data/spec/d/r/app/helpers/application_helper.rb +2 -0
  102. data/spec/d/r/app/mailers/.keep +0 -0
  103. data/spec/d/r/app/models/.keep +0 -0
  104. data/spec/d/r/app/models/ability.rb +12 -0
  105. data/spec/d/r/app/models/concerns/.keep +0 -0
  106. data/spec/d/r/app/models/user.rb +9 -0
  107. data/spec/d/r/app/views/layouts/application.html.erb +14 -0
  108. data/spec/d/r/bin/bundle +3 -0
  109. data/spec/d/r/bin/rails +4 -0
  110. data/spec/d/r/bin/rake +4 -0
  111. data/spec/d/r/config/application.rb +31 -0
  112. data/spec/d/r/config/boot.rb +4 -0
  113. data/spec/d/r/config/database.yml +39 -0
  114. data/spec/d/r/config/environment.rb +5 -0
  115. data/spec/d/r/config/environments/development.rb +29 -0
  116. data/spec/d/r/config/environments/production.rb +80 -0
  117. data/spec/d/r/config/environments/test.rb +37 -0
  118. data/spec/d/r/config/initializers/active_admin.rb +225 -0
  119. data/spec/d/r/config/initializers/backtrace_silencers.rb +7 -0
  120. data/spec/d/r/config/initializers/devise.rb +252 -0
  121. data/spec/d/r/config/initializers/devise_async.rb +6 -0
  122. data/spec/d/r/config/initializers/filter_parameter_logging.rb +4 -0
  123. data/spec/d/r/config/initializers/friendly_id.rb +88 -0
  124. data/spec/d/r/config/initializers/inflections.rb +16 -0
  125. data/spec/d/r/config/initializers/mime_types.rb +5 -0
  126. data/spec/d/r/config/initializers/pageflow.rb +76 -0
  127. data/spec/d/r/config/initializers/resque.rb +4 -0
  128. data/spec/d/r/config/initializers/resque_enqueue_after_commit_patch.rb +25 -0
  129. data/spec/d/r/config/initializers/resque_logger.rb +16 -0
  130. data/spec/d/r/config/initializers/resque_mailer.rb +4 -0
  131. data/spec/d/r/config/initializers/secret_token.rb +12 -0
  132. data/spec/d/r/config/initializers/session_store.rb +3 -0
  133. data/spec/d/r/config/initializers/wrap_parameters.rb +14 -0
  134. data/spec/d/r/config/locales/devise.en.yml +59 -0
  135. data/spec/d/r/config/locales/en.yml +23 -0
  136. data/spec/d/r/config/routes.rb +59 -0
  137. data/spec/d/r/config.ru +4 -0
  138. data/spec/d/r/db/migrate/00000000000000_create_test_hosted_file.rb +7 -0
  139. data/spec/d/r/db/migrate/00000000000001_create_test_revision_component.rb +10 -0
  140. data/spec/d/r/db/migrate/20150209101518_create_active_admin_comments.rb +19 -0
  141. data/spec/d/r/db/migrate/20150209101524_devise_create_users.rb +46 -0
  142. data/spec/d/r/db/migrate/20150209101530_create_friendly_id_slugs.rb +15 -0
  143. data/spec/d/r/db/migrate/20150209101540_setup_schema.pageflow.rb +208 -0
  144. data/spec/d/r/db/migrate/20150209101541_add_attributes_to_users.pageflow.rb +16 -0
  145. data/spec/d/r/db/migrate/20150209101542_create_themings.pageflow.rb +16 -0
  146. data/spec/d/r/db/migrate/20150209101543_create_themings_for_existing_accounts.pageflow.rb +27 -0
  147. data/spec/d/r/db/migrate/20150209101544_change_theme_references_to_theming_references.pageflow.rb +46 -0
  148. data/spec/d/r/db/migrate/20150209101545_remove_attributes_from_themes.pageflow.rb +11 -0
  149. data/spec/d/r/db/migrate/20150209101546_create_accounts_themes_join_table.pageflow.rb +9 -0
  150. data/spec/d/r/db/migrate/20150209101547_move_cname_from_account_to_theming.pageflow.rb +22 -0
  151. data/spec/d/r/db/migrate/20150209101548_drop_themes.pageflow.rb +15 -0
  152. data/spec/d/r/db/migrate/20150209101549_add_confirmed_by_to_encoded_files.pageflow.rb +7 -0
  153. data/spec/d/r/db/migrate/20150209101550_add_home_url_attributes_to_themings_and_revisions.pageflow.rb +10 -0
  154. data/spec/d/r/db/migrate/20150209101551_create_widgets.pageflow.rb +12 -0
  155. data/spec/d/r/db/migrate/20150209101552_add_emphasize_chapter_beginning_to_revisions.pageflow.rb +6 -0
  156. data/spec/d/r/db/migrate/20150209101553_add_emphasize_new_pages_to_revisions.pageflow.rb +6 -0
  157. data/spec/d/r/db/migrate/20150209101554_add_sharing_image_to_revisions.pageflow.rb +8 -0
  158. data/spec/d/r/db/schema.rb +316 -0
  159. data/spec/d/r/db/seeds.rb +30 -0
  160. data/spec/d/r/lib/assets/.keep +0 -0
  161. data/spec/d/r/lib/tasks/.keep +0 -0
  162. data/spec/d/r/lib/tasks/resque.rake +7 -0
  163. data/spec/d/r/public/404.html +58 -0
  164. data/spec/d/r/public/422.html +58 -0
  165. data/spec/d/r/public/500.html +57 -0
  166. data/spec/d/r/public/favicon.ico +0 -0
  167. data/spec/d/r/public/javascripts/translations.js +2 -0
  168. data/spec/d/r/public/robots.txt +5 -0
  169. data/spec/d/r/vendor/assets/javascripts/.keep +0 -0
  170. data/spec/d/r/vendor/assets/stylesheets/.keep +0 -0
  171. data/spec/javascripts/.jshintrc +26 -0
  172. data/spec/javascripts/pageflow/sitemap/editor/controllers/selection_navigator_spec.js +52 -0
  173. data/spec/javascripts/pageflow/sitemap/editor/d3/layout/collision_spec.js +99 -0
  174. data/spec/javascripts/pageflow/sitemap/editor/d3/layout/dragging_decorator_spec.js +114 -0
  175. data/spec/javascripts/pageflow/sitemap/editor/d3/layout/grid_spec.js +183 -0
  176. data/spec/javascripts/pageflow/sitemap/editor/d3/layout_spec.js +31 -0
  177. data/spec/javascripts/pageflow/sitemap/editor/d3/view_model_spec.js +56 -0
  178. data/spec/javascripts/pageflow/sitemap/editor/models/selection_spec.js +62 -0
  179. data/spec/javascripts/pageflow/sitemap/scroll_navigator_spec.js +5 -0
  180. data/spec/javascripts/spec_helper.js +13 -0
  181. data/spec/javascripts/support/factories.js +81 -0
  182. data/spec/teaspoon_env.rb +182 -0
  183. data/vendor/assets/javascripts/d3.v3.js +9215 -0
  184. metadata +379 -0
@@ -0,0 +1,59 @@
1
+ Rails405::Application.routes.draw do
2
+ devise_for :users, ActiveAdmin::Devise.config
3
+ ActiveAdmin.routes(self)
4
+ Pageflow.routes(self)
5
+ # The priority is based upon order of creation: first created -> highest priority.
6
+ # See how all your routes lay out with "rake routes".
7
+
8
+ # You can have the root of your site routed with "root"
9
+ # root 'welcome#index'
10
+
11
+ # Example of regular route:
12
+ # get 'products/:id' => 'catalog#view'
13
+
14
+ # Example of named route that can be invoked with purchase_url(id: product.id)
15
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
16
+
17
+ # Example resource route (maps HTTP verbs to controller actions automatically):
18
+ # resources :products
19
+
20
+ # Example resource route with options:
21
+ # resources :products do
22
+ # member do
23
+ # get 'short'
24
+ # post 'toggle'
25
+ # end
26
+ #
27
+ # collection do
28
+ # get 'sold'
29
+ # end
30
+ # end
31
+
32
+ # Example resource route with sub-resources:
33
+ # resources :products do
34
+ # resources :comments, :sales
35
+ # resource :seller
36
+ # end
37
+
38
+ # Example resource route with more complex sub-resources:
39
+ # resources :products do
40
+ # resources :comments
41
+ # resources :sales do
42
+ # get 'recent', on: :collection
43
+ # end
44
+ # end
45
+
46
+ # Example resource route with concerns:
47
+ # concern :toggleable do
48
+ # post 'toggle'
49
+ # end
50
+ # resources :posts, concerns: :toggleable
51
+ # resources :photos, concerns: :toggleable
52
+
53
+ # Example resource route within a namespace:
54
+ # namespace :admin do
55
+ # # Directs /admin/products/* to Admin::ProductsController
56
+ # # (app/controllers/admin/products_controller.rb)
57
+ # resources :products
58
+ # end
59
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,7 @@
1
+ class CreateTestHostedFile < ActiveRecord::Migration
2
+ def change
3
+ create_table :test_hosted_files do |t|
4
+ Pageflow::HostedFile.columns(t)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ class CreateTestRevisionComponent < ActiveRecord::Migration
2
+ def change
3
+ create_table :test_revision_components do |t|
4
+ t.belongs_to :revision
5
+ t.integer :perma_id
6
+
7
+ t.string :text
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,19 @@
1
+ class CreateActiveAdminComments < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :active_admin_comments do |t|
4
+ t.string :namespace
5
+ t.text :body
6
+ t.string :resource_id, :null => false
7
+ t.string :resource_type, :null => false
8
+ t.references :author, :polymorphic => true
9
+ t.timestamps
10
+ end
11
+ add_index :active_admin_comments, [:namespace]
12
+ add_index :active_admin_comments, [:author_type, :author_id]
13
+ add_index :active_admin_comments, [:resource_type, :resource_id]
14
+ end
15
+
16
+ def self.down
17
+ drop_table :active_admin_comments
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+ ## Token authenticatable
34
+ # t.string :authentication_token
35
+
36
+
37
+ t.timestamps
38
+ end
39
+
40
+ add_index :users, :email, :unique => true
41
+ add_index :users, :reset_password_token, :unique => true
42
+ # add_index :users, :confirmation_token, :unique => true
43
+ # add_index :users, :unlock_token, :unique => true
44
+ # add_index :users, :authentication_token, :unique => true
45
+ end
46
+ end
@@ -0,0 +1,15 @@
1
+ class CreateFriendlyIdSlugs < ActiveRecord::Migration
2
+ def change
3
+ create_table :friendly_id_slugs do |t|
4
+ t.string :slug, :null => false
5
+ t.integer :sluggable_id, :null => false
6
+ t.string :sluggable_type, :limit => 50
7
+ t.string :scope
8
+ t.datetime :created_at
9
+ end
10
+ add_index :friendly_id_slugs, :sluggable_id
11
+ add_index :friendly_id_slugs, [:slug, :sluggable_type]
12
+ add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], :unique => true
13
+ add_index :friendly_id_slugs, :sluggable_type
14
+ end
15
+ end
@@ -0,0 +1,208 @@
1
+ # This migration comes from pageflow (originally 20140418225525)
2
+ class SetupSchema < ActiveRecord::Migration
3
+ def change
4
+ create_table "friendly_id_slugs", force: true do |t|
5
+ t.string "slug", null: false
6
+ t.integer "sluggable_id", null: false
7
+ t.string "sluggable_type", limit: 50
8
+ t.string "scope"
9
+ t.datetime "created_at"
10
+ end
11
+
12
+ add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, using: :btree
13
+ add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", using: :btree
14
+ add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
15
+ add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree
16
+
17
+ create_table "pageflow_accounts", force: true do |t|
18
+ t.string "name", default: "", null: false
19
+ t.integer "default_theme_id"
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ t.string "default_file_rights", default: "", null: false
23
+ t.string "cname", default: "", null: false
24
+ t.string "landing_page_name", default: "", null: false
25
+ end
26
+
27
+ add_index "pageflow_accounts", ["cname"], name: "index_pageflow_accounts_on_cname", using: :btree
28
+
29
+ create_table "pageflow_audio_files", force: true do |t|
30
+ t.integer "entry_id"
31
+ t.integer "uploader_id"
32
+ t.string "attachment_on_filesystem_file_name"
33
+ t.string "attachment_on_filesystem_content_type"
34
+ t.integer "attachment_on_filesystem_file_size", limit: 8
35
+ t.datetime "attachment_on_filesystem_updated_at"
36
+ t.string "attachment_on_s3_file_name"
37
+ t.string "attachment_on_s3_content_type"
38
+ t.integer "attachment_on_s3_file_size", limit: 8
39
+ t.datetime "attachment_on_s3_updated_at"
40
+ t.integer "job_id"
41
+ t.string "state"
42
+ t.decimal "encoding_progress", precision: 5, scale: 2
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ t.string "encoding_error_message"
46
+ t.integer "duration_in_ms"
47
+ t.string "format"
48
+ t.string "rights", default: "", null: false
49
+ end
50
+
51
+ create_table "pageflow_chapters", force: true do |t|
52
+ t.integer "entry_id"
53
+ t.datetime "created_at"
54
+ t.datetime "updated_at"
55
+ t.integer "position", default: 0, null: false
56
+ t.string "title", default: "", null: false
57
+ t.integer "revision_id"
58
+ end
59
+
60
+ add_index "pageflow_chapters", ["entry_id"], name: "index_pageflow_chapters_on_entry_id", using: :btree
61
+ add_index "pageflow_chapters", ["revision_id"], name: "index_pageflow_chapters_on_revision_id", using: :btree
62
+
63
+ create_table "pageflow_edit_locks", force: true do |t|
64
+ t.integer "user_id"
65
+ t.integer "entry_id"
66
+ t.datetime "created_at"
67
+ t.datetime "updated_at"
68
+ end
69
+
70
+ add_index "pageflow_edit_locks", ["entry_id"], name: "index_pageflow_edit_locks_on_entry_id", using: :btree
71
+ add_index "pageflow_edit_locks", ["user_id"], name: "index_pageflow_edit_locks_on_user_id", using: :btree
72
+
73
+ create_table "pageflow_entries", force: true do |t|
74
+ t.string "title", default: "", null: false
75
+ t.datetime "created_at"
76
+ t.datetime "updated_at"
77
+ t.string "slug", null: false
78
+ t.integer "account_id"
79
+ t.integer "theme_id"
80
+ t.integer "folder_id"
81
+ end
82
+
83
+ add_index "pageflow_entries", ["account_id"], name: "index_pageflow_entries_on_account_id", using: :btree
84
+ add_index "pageflow_entries", ["folder_id"], name: "index_pageflow_entries_on_folder_id", using: :btree
85
+ add_index "pageflow_entries", ["slug"], name: "index_pageflow_entries_on_slug", unique: true, using: :btree
86
+ add_index "pageflow_entries", ["theme_id"], name: "index_pageflow_entries_on_theme_id", using: :btree
87
+
88
+ create_table "pageflow_file_usages", force: true do |t|
89
+ t.integer "revision_id"
90
+ t.integer "file_id"
91
+ t.string "file_type"
92
+ t.datetime "created_at"
93
+ t.datetime "updated_at"
94
+ end
95
+
96
+ add_index "pageflow_file_usages", ["file_id", "file_type"], name: "index_pageflow_file_usages_on_file_id_and_file_type", using: :btree
97
+ add_index "pageflow_file_usages", ["revision_id"], name: "index_pageflow_file_usages_on_revision_id", using: :btree
98
+
99
+ create_table "pageflow_folders", force: true do |t|
100
+ t.string "name"
101
+ t.integer "account_id"
102
+ t.datetime "created_at"
103
+ t.datetime "updated_at"
104
+ end
105
+
106
+ add_index "pageflow_folders", ["account_id"], name: "index_pageflow_folders_on_account_id", using: :btree
107
+
108
+ create_table "pageflow_image_files", force: true do |t|
109
+ t.integer "entry_id"
110
+ t.integer "uploader_id"
111
+ t.string "unprocessed_attachment_file_name"
112
+ t.string "unprocessed_attachment_content_type"
113
+ t.integer "unprocessed_attachment_file_size", limit: 8
114
+ t.datetime "unprocessed_attachment_updated_at"
115
+ t.string "processed_attachment_file_name"
116
+ t.string "processed_attachment_content_type"
117
+ t.integer "processed_attachment_file_size", limit: 8
118
+ t.datetime "processed_attachment_updated_at"
119
+ t.string "state"
120
+ t.datetime "created_at"
121
+ t.datetime "updated_at"
122
+ t.integer "width"
123
+ t.integer "height"
124
+ t.string "rights", default: "", null: false
125
+ end
126
+
127
+ create_table "pageflow_memberships", force: true do |t|
128
+ t.integer "user_id"
129
+ t.integer "entry_id"
130
+ t.string "name"
131
+ t.datetime "created_at"
132
+ t.datetime "updated_at"
133
+ end
134
+
135
+ add_index "pageflow_memberships", ["entry_id"], name: "index_pageflow_memberships_on_entry_id", using: :btree
136
+ add_index "pageflow_memberships", ["user_id"], name: "index_pageflow_memberships_on_user_id", using: :btree
137
+
138
+ create_table "pageflow_pages", force: true do |t|
139
+ t.integer "chapter_id"
140
+ t.string "template", default: "", null: false
141
+ t.text "configuration"
142
+ t.datetime "created_at"
143
+ t.datetime "updated_at"
144
+ t.integer "position", default: 0, null: false
145
+ t.boolean "display_in_navigation", default: true
146
+ t.integer "perma_id"
147
+ end
148
+
149
+ add_index "pageflow_pages", ["chapter_id"], name: "index_pageflow_pages_on_chapter_id", using: :btree
150
+ add_index "pageflow_pages", ["perma_id"], name: "index_pageflow_pages_on_perma_id", using: :btree
151
+
152
+ create_table "pageflow_revisions", force: true do |t|
153
+ t.integer "entry_id"
154
+ t.integer "creator_id"
155
+ t.datetime "published_at"
156
+ t.datetime "published_until"
157
+ t.datetime "created_at"
158
+ t.datetime "updated_at"
159
+ t.text "credits"
160
+ t.string "title", default: "", null: false
161
+ t.text "summary"
162
+ t.boolean "manual_start", default: false
163
+ t.integer "restored_from_id"
164
+ t.datetime "frozen_at"
165
+ t.string "snapshot_type"
166
+ end
167
+
168
+ add_index "pageflow_revisions", ["restored_from_id"], name: "index_pageflow_revisions_on_restored_from_id", using: :btree
169
+
170
+ create_table "pageflow_themes", force: true do |t|
171
+ t.string "name", default: "", null: false
172
+ t.datetime "created_at"
173
+ t.datetime "updated_at"
174
+ t.string "imprint_link_url"
175
+ t.string "imprint_link_label"
176
+ t.string "copyright_link_url"
177
+ t.string "copyright_link_label"
178
+ end
179
+
180
+ create_table "pageflow_video_files", force: true do |t|
181
+ t.integer "entry_id"
182
+ t.integer "uploader_id"
183
+ t.string "attachment_on_filesystem_file_name"
184
+ t.string "attachment_on_filesystem_content_type"
185
+ t.integer "attachment_on_filesystem_file_size", limit: 8
186
+ t.datetime "attachment_on_filesystem_updated_at"
187
+ t.string "attachment_on_s3_file_name"
188
+ t.string "attachment_on_s3_content_type"
189
+ t.integer "attachment_on_s3_file_size", limit: 8
190
+ t.datetime "attachment_on_s3_updated_at"
191
+ t.integer "job_id"
192
+ t.string "state"
193
+ t.decimal "encoding_progress", precision: 5, scale: 2
194
+ t.datetime "created_at"
195
+ t.datetime "updated_at"
196
+ t.string "encoding_error_message"
197
+ t.string "thumbnail_file_name"
198
+ t.integer "width"
199
+ t.integer "height"
200
+ t.integer "duration_in_ms"
201
+ t.string "format"
202
+ t.string "poster_file_name"
203
+ t.string "poster_content_type"
204
+ t.string "thumbnail_content_type"
205
+ t.string "rights", default: "", null: false
206
+ end
207
+ end
208
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from pageflow (originally 20140418240000)
2
+ class AddAttributesToUsers < ActiveRecord::Migration
3
+ def change
4
+ add_column :users, :failed_attempts, :integer, default: 0
5
+ add_column :users, :locked_at, :datetime
6
+
7
+ add_column :users, :first_name, :string
8
+ add_column :users, :last_name, :string
9
+ add_column :users, :suspended_at, :datetime
10
+ add_column :users, :account_id, :integer
11
+ add_column :users, :role, :string, default: "editor", null: false
12
+
13
+ add_index :users, [:account_id], name: "index_pageflow_users_on_account_id", using: :btree
14
+ add_index :users, [:email], name: "index_pageflow_users_on_email", unique: true, using: :btree
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from pageflow (originally 20140624135420)
2
+ class CreateThemings < ActiveRecord::Migration
3
+ def change
4
+ create_table :pageflow_themings do |t|
5
+ t.string :imprint_link_url
6
+ t.string :imprint_link_label
7
+ t.string :copyright_link_url
8
+ t.string :copyright_link_label
9
+
10
+ t.belongs_to :account
11
+ t.belongs_to :theme
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,27 @@
1
+ # This migration comes from pageflow (originally 20140624135421)
2
+ class CreateThemingsForExistingAccounts < ActiveRecord::Migration
3
+ def up
4
+ # For each account create a theming. Copy link attributes from
5
+ # theme to theming. Store account_id on theming so we can identify
6
+ # it as the accounts default_theming later on.
7
+ execute(<<-SQL)
8
+ INSERT INTO pageflow_themings
9
+ (account_id, theme_id, imprint_link_label, imprint_link_url, copyright_link_label, copyright_link_url, created_at, updated_at)
10
+ SELECT a.id, default_theme_id, imprint_link_label, imprint_link_url, copyright_link_label, copyright_link_url, a.created_at, a.updated_at
11
+ FROM pageflow_accounts AS a
12
+ LEFT JOIN pageflow_themes AS t ON t.id = a.default_theme_id;
13
+ SQL
14
+ end
15
+
16
+ def down
17
+ # Copy link attributes back to themes.
18
+ execute(<<-SQL)
19
+ UPDATE pageflow_themes AS t
20
+ LEFT JOIN pageflow_themings AS g ON g.theme_id = t.id
21
+ SET t.imprint_link_label = g.imprint_link_label,
22
+ t.imprint_link_url = g.imprint_link_url,
23
+ t.copyright_link_label = g.copyright_link_label,
24
+ t.copyright_link_url = g.copyright_link_url
25
+ SQL
26
+ end
27
+ end
@@ -0,0 +1,46 @@
1
+ # This migration comes from pageflow (originally 20140624135422)
2
+ class ChangeThemeReferencesToThemingReferences < ActiveRecord::Migration
3
+ def up
4
+ add_reference :pageflow_accounts, :default_theming, :index => true
5
+ add_reference :pageflow_entries, :theming, :index => true
6
+
7
+ # Use theming created for account as default_theming.
8
+ execute(<<-SQL)
9
+ UPDATE pageflow_accounts SET default_theming_id =
10
+ (SELECT id FROM pageflow_themings where pageflow_accounts.id = pageflow_themings.account_id LIMIT 1);
11
+ SQL
12
+
13
+ # Use default theming from entry's account as theming
14
+ execute(<<-SQL)
15
+ UPDATE pageflow_entries SET theming_id =
16
+ (SELECT default_theming_id FROM pageflow_accounts where pageflow_accounts.id = pageflow_entries.account_id);
17
+ SQL
18
+
19
+ remove_reference :pageflow_accounts, :default_theme
20
+ remove_reference :pageflow_entries, :theme
21
+ end
22
+
23
+ def down
24
+ add_reference :pageflow_accounts, :default_theme, :index => true
25
+ add_reference :pageflow_entries, :theme, :index => true
26
+
27
+ # Set default_theme_id to theme_id of account's default_theming.
28
+ execute(<<-SQL)
29
+ UPDATE pageflow_accounts SET default_theme_id =
30
+ (SELECT id FROM pageflow_themes where pageflow_themes.id =
31
+ (SELECT theme_id FROM pageflow_themings
32
+ WHERE pageflow_accounts.default_theming_id = pageflow_themings.id LIMIT 1));
33
+ SQL
34
+
35
+ # Set theme_id to theme_id of entries's theming.
36
+ execute(<<-SQL)
37
+ UPDATE pageflow_entries SET theme_id =
38
+ (SELECT id FROM pageflow_themes where pageflow_themes.id =
39
+ (SELECT theme_id FROM pageflow_themings
40
+ WHERE pageflow_entries.theming_id = pageflow_themings.id LIMIT 1));
41
+ SQL
42
+
43
+ remove_reference :pageflow_accounts, :default_theming
44
+ remove_reference :pageflow_entries, :theming
45
+ end
46
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from pageflow (originally 20140624135423)
2
+ class RemoveAttributesFromThemes < ActiveRecord::Migration
3
+ def change
4
+ remove_column :pageflow_themes, :copyright_link_url, :string
5
+ remove_column :pageflow_themes, :copyright_link_label, :string
6
+ remove_column :pageflow_themes, :imprint_link_url, :string
7
+ remove_column :pageflow_themes, :imprint_link_label, :string
8
+
9
+ rename_column :pageflow_themes, :name, :css_dir
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from pageflow (originally 20140624135424)
2
+ class CreateAccountsThemesJoinTable < ActiveRecord::Migration
3
+ def change
4
+ create_table :pageflow_accounts_themes, id: false do |t|
5
+ t.belongs_to :account
6
+ t.belongs_to :theme
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # This migration comes from pageflow (originally 20140624135425)
2
+ class MoveCnameFromAccountToTheming < ActiveRecord::Migration
3
+ def up
4
+ add_column :pageflow_themings, :cname, :string, null: false, default: ''
5
+ add_index :pageflow_themings, :cname
6
+
7
+ execute("UPDATE pageflow_themings SET cname = (SELECT cname FROM pageflow_accounts WHERE pageflow_accounts.default_theming_id = pageflow_themings.id LIMIT 1);")
8
+
9
+ remove_index :pageflow_accounts, :cname
10
+ remove_column :pageflow_accounts, :cname
11
+ end
12
+
13
+ def down
14
+ add_column :pageflow_accounts, :cname, :string, null: false, default: ''
15
+ add_index :pageflow_accounts, :cname
16
+
17
+ execute("UPDATE pageflow_accounts SET cname = (SELECT cname FROM pageflow_themings WHERE pageflow_themings.id = pageflow_accounts.default_theming_id);")
18
+
19
+ remove_index :pageflow_themings, :cname
20
+ remove_column :pageflow_themings, :cname
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ # This migration comes from pageflow (originally 20140625184800)
2
+ class DropThemes < ActiveRecord::Migration
3
+ def up
4
+ rename_column :pageflow_accounts_themes, :theme_id, :theme_name
5
+ add_column :pageflow_themings, :theme_name, :string
6
+
7
+ execute(<<-SQL)
8
+ UPDATE pageflow_themings SET theme_name =
9
+ (SELECT css_dir FROM pageflow_themes WHERE pageflow_themes.id = pageflow_themings.theme_id);
10
+ SQL
11
+
12
+ remove_reference :pageflow_themings, :theme
13
+ drop_table :pageflow_themes
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ # This migration comes from pageflow (originally 20140704110631)
2
+ class AddConfirmedByToEncodedFiles < ActiveRecord::Migration
3
+ def change
4
+ add_reference :pageflow_video_files, :confirmed_by
5
+ add_reference :pageflow_audio_files, :confirmed_by
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # This migration comes from pageflow (originally 20140819081454)
2
+ class AddHomeUrlAttributesToThemingsAndRevisions < ActiveRecord::Migration
3
+ def change
4
+ add_column :pageflow_themings, :home_url, :string, default: '', null: false
5
+ add_column :pageflow_themings, :home_button_enabled_by_default, :boolean, default: true, null: false
6
+
7
+ add_column :pageflow_revisions, :home_url, :string, default: '', null: false
8
+ add_column :pageflow_revisions, :home_button_enabled, :boolean, default: false, null: false
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from pageflow (originally 20141027102310)
2
+ class CreateWidgets < ActiveRecord::Migration
3
+ def change
4
+ create_table :pageflow_widgets do |t|
5
+ t.belongs_to :subject, polymorphic: true
6
+ t.string :type_name
7
+ t.string :role
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from pageflow (originally 20141028125408)
2
+ class AddEmphasizeChapterBeginningToRevisions < ActiveRecord::Migration
3
+ def change
4
+ add_column :pageflow_revisions, :emphasize_chapter_beginning, :boolean, default: false, null: false
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from pageflow (originally 20141119164526)
2
+ class AddEmphasizeNewPagesToRevisions < ActiveRecord::Migration
3
+ def change
4
+ add_column :pageflow_revisions, :emphasize_new_pages, :boolean, default: false, null: false
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ # This migration comes from pageflow (originally 20141119174032)
2
+ class AddSharingImageToRevisions < ActiveRecord::Migration
3
+ def change
4
+ add_column :pageflow_revisions, :share_image_id, :integer
5
+ add_column :pageflow_revisions, :share_image_x, :integer
6
+ add_column :pageflow_revisions, :share_image_y, :integer
7
+ end
8
+ end