fassets_core 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. data/MIT-LICENSE +21 -0
  2. data/README.md +22 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/images/fassets_core/add.png +0 -0
  5. data/app/assets/images/fassets_core/archive.png +0 -0
  6. data/app/assets/images/fassets_core/classify.png +0 -0
  7. data/app/assets/images/fassets_core/clipboard.png +0 -0
  8. data/app/assets/images/fassets_core/collapse.png +0 -0
  9. data/app/assets/images/fassets_core/collapsed.png +0 -0
  10. data/app/assets/images/fassets_core/delete.png +0 -0
  11. data/app/assets/images/fassets_core/drag.png +0 -0
  12. data/app/assets/images/fassets_core/edit.png +0 -0
  13. data/app/assets/images/fassets_core/link.png +0 -0
  14. data/app/assets/images/fassets_core/markup_preview.png +0 -0
  15. data/app/assets/images/fassets_core/remove.png +0 -0
  16. data/app/assets/images/fassets_core/sort.png +0 -0
  17. data/app/assets/images/fassets_core/warning.png +0 -0
  18. data/app/assets/javascripts/fassets_core/add_asset_box.js +102 -0
  19. data/app/assets/javascripts/fassets_core/application.js.erb +14 -0
  20. data/app/assets/javascripts/fassets_core/assets.js +31 -0
  21. data/app/assets/javascripts/fassets_core/catalog_box.js +73 -0
  22. data/app/assets/javascripts/fassets_core/catalogs.js +46 -0
  23. data/app/assets/javascripts/fassets_core/classification.js +37 -0
  24. data/app/assets/javascripts/fassets_core/edit_box.js +63 -0
  25. data/app/assets/javascripts/fassets_core/facets.js.erb +32 -0
  26. data/app/assets/javascripts/fassets_core/tray.js +30 -0
  27. data/app/assets/stylesheets/fassets_core/add_asset_box.css.scss +77 -0
  28. data/app/assets/stylesheets/fassets_core/application.css +16 -0
  29. data/app/assets/stylesheets/fassets_core/assets.css.scss +74 -0
  30. data/app/assets/stylesheets/fassets_core/catalog_box.css.scss +45 -0
  31. data/app/assets/stylesheets/fassets_core/collapsible.css.scss +54 -0
  32. data/app/assets/stylesheets/fassets_core/edit_box.css.scss +58 -0
  33. data/app/assets/stylesheets/fassets_core/facet.css.scss +56 -0
  34. data/app/assets/stylesheets/fassets_core/filter.css.scss +20 -0
  35. data/app/assets/stylesheets/fassets_core/forms.css.scss +12 -0
  36. data/app/assets/stylesheets/fassets_core/labels.css.scss +13 -0
  37. data/app/assets/stylesheets/fassets_core/master.css.scss +127 -0
  38. data/app/assets/stylesheets/fassets_core/sidebar.css.scss +84 -0
  39. data/app/assets/stylesheets/fassets_core/tray.css.scss +106 -0
  40. data/app/controllers/assets_controller.rb +115 -0
  41. data/app/controllers/catalogs_controller.rb +99 -0
  42. data/app/controllers/classifications_controller.rb +56 -0
  43. data/app/controllers/facets_controller.rb +57 -0
  44. data/app/controllers/fassets_core/application_controller.rb +5 -0
  45. data/app/controllers/labels_controller.rb +54 -0
  46. data/app/controllers/tray_positions_controller.rb +81 -0
  47. data/app/helpers/assets_helper.rb +20 -0
  48. data/app/helpers/catalogs_helper.rb +3 -0
  49. data/app/helpers/classifications_helper.rb +8 -0
  50. data/app/helpers/fassets_core/application_helper.rb +48 -0
  51. data/app/helpers/labels_helper.rb +3 -0
  52. data/app/helpers/tray_positions_helper.rb +3 -0
  53. data/app/models/asset.rb +52 -0
  54. data/app/models/catalog.rb +16 -0
  55. data/app/models/classification.rb +8 -0
  56. data/app/models/facet.rb +19 -0
  57. data/app/models/label.rb +11 -0
  58. data/app/models/label_filter.rb +16 -0
  59. data/app/models/labeling.rb +5 -0
  60. data/app/models/tray_position.rb +9 -0
  61. data/app/views/assets/_add_asset_sidebar.html.haml +8 -0
  62. data/app/views/assets/_classification.html.haml +33 -0
  63. data/app/views/assets/_form.html.haml +30 -0
  64. data/app/views/assets/_put_on_tray.html.haml +7 -0
  65. data/app/views/assets/edit.html.haml +15 -0
  66. data/app/views/assets/new.html.haml +25 -0
  67. data/app/views/assets/show.html.haml +13 -0
  68. data/app/views/catalogs/_box_catalog_list.html.haml +6 -0
  69. data/app/views/catalogs/_box_content.html.haml +13 -0
  70. data/app/views/catalogs/_catalog.html.haml +2 -0
  71. data/app/views/catalogs/_facet.html.haml +13 -0
  72. data/app/views/catalogs/_filter_item.html.haml +3 -0
  73. data/app/views/catalogs/_form.html.haml +6 -0
  74. data/app/views/catalogs/box.html.haml +6 -0
  75. data/app/views/catalogs/edit.html.haml +8 -0
  76. data/app/views/catalogs/index.html.haml +17 -0
  77. data/app/views/catalogs/new.html.haml +8 -0
  78. data/app/views/catalogs/show.html.haml +30 -0
  79. data/app/views/classifications/update.js.erb +4 -0
  80. data/app/views/facets/_form.html.haml +9 -0
  81. data/app/views/facets/edit.html.haml +15 -0
  82. data/app/views/labels/_form.haml +3 -0
  83. data/app/views/labels/_sidebar.html.haml +22 -0
  84. data/app/views/labels/destroy.js.erb +13 -0
  85. data/app/views/layouts/fassets_core/application.html.haml +16 -0
  86. data/app/views/shared/_asset.html.haml +22 -0
  87. data/app/views/shared/_asset_form.html.haml +7 -0
  88. data/app/views/shared/_classification.html.haml +23 -0
  89. data/app/views/shared/_clipboard.html.haml +10 -0
  90. data/app/views/shared/_error.html.haml +6 -0
  91. data/app/views/shared/_tray.html.haml +13 -0
  92. data/app/views/shared/_tray_position.html.haml +8 -0
  93. data/app/views/tray_positions/create.js.rjs +10 -0
  94. data/app/views/tray_positions/destroy.js.rjs +1 -0
  95. data/app/views/tray_positions/sort.js.rjs +15 -0
  96. data/config/initializers/mime_types.rb +2 -0
  97. data/config/initializers/uploader.rb +2 -0
  98. data/config/initializers/users.rb +7 -0
  99. data/config/routes.rb +34 -0
  100. data/db/migrate/001_create_catalogs.rb +13 -0
  101. data/db/migrate/002_create_facets.rb +14 -0
  102. data/db/migrate/003_create_labels.rb +12 -0
  103. data/db/migrate/005_create_classifications.rb +12 -0
  104. data/db/migrate/006_create_labelings.rb +12 -0
  105. data/db/migrate/007_create_tray_positions.rb +13 -0
  106. data/db/migrate/008_create_assets.rb +16 -0
  107. data/db/migrate/010_add_label_ordering.rb +10 -0
  108. data/db/migrate/017_add_clipboard.rb +11 -0
  109. data/db/migrate/20120803150826_add_position_to_facet.rb +5 -0
  110. data/db/schema.rb +141 -0
  111. data/db/seeds.rb +7 -0
  112. data/lib/acts_as_asset.rb +36 -0
  113. data/lib/authenticated_system.rb +187 -0
  114. data/lib/authenticated_test_helper.rb +20 -0
  115. data/lib/fassets_core.rb +6 -0
  116. data/lib/fassets_core/engine.rb +7 -0
  117. data/lib/fassets_core/plugins.rb +13 -0
  118. data/lib/fassets_core/test_helper.rb +3 -0
  119. data/lib/fassets_core/test_helper/every_assets_controller.rb +161 -0
  120. data/lib/fassets_core/test_helper/every_authenticated_controller.rb +10 -0
  121. data/lib/fassets_core/version.rb +3 -0
  122. data/lib/tasks/cucumber.rake +57 -0
  123. data/lib/tasks/fassets-core_tasks.rake +4 -0
  124. data/lib/template_manager.rb +27 -0
  125. data/test/fassets-core_test.rb +7 -0
  126. data/test/fixtures/asset_contents.yml +7 -0
  127. data/test/fixtures/assets.yml +7 -0
  128. data/test/fixtures/catalogs.yml +9 -0
  129. data/test/fixtures/classifications.yml +7 -0
  130. data/test/fixtures/facets.yml +9 -0
  131. data/test/fixtures/frames.yml +11 -0
  132. data/test/fixtures/image_assets.yml +7 -0
  133. data/test/fixtures/labellings.yml +7 -0
  134. data/test/fixtures/labels.yml +9 -0
  135. data/test/fixtures/presentations.yml +7 -0
  136. data/test/fixtures/slides.yml +11 -0
  137. data/test/fixtures/slots.yml +0 -0
  138. data/test/fixtures/topics.yml +11 -0
  139. data/test/fixtures/tray_positions.yml +7 -0
  140. data/test/fixtures/users.yml +31 -0
  141. data/test/functional/assets_controller_test.rb +8 -0
  142. data/test/functional/catalogs_controller_test.rb +8 -0
  143. data/test/functional/classifications_controller_test.rb +8 -0
  144. data/test/functional/content_controller_test.rb +8 -0
  145. data/test/functional/facets_controller_test.rb +8 -0
  146. data/test/functional/file_assets_controller_test.rb +8 -0
  147. data/test/functional/files_controller_test.rb +8 -0
  148. data/test/functional/labellings_controller_test.rb +8 -0
  149. data/test/functional/labels_controller_test.rb +8 -0
  150. data/test/functional/presentations_controller_test.rb +8 -0
  151. data/test/functional/sessions_controller_test.rb +82 -0
  152. data/test/functional/slides_controller_test.rb +8 -0
  153. data/test/functional/slots_controller_test.rb +8 -0
  154. data/test/functional/tray_positions_controller_test.rb +8 -0
  155. data/test/functional/urls_controller_test.rb +8 -0
  156. data/test/functional/users_controller_test.rb +58 -0
  157. data/test/integration/navigation_test.rb +10 -0
  158. data/test/performance/browsing_test.rb +9 -0
  159. data/test/test_helper.rb +10 -0
  160. data/test/unit/asset_content_test.rb +8 -0
  161. data/test/unit/asset_test.rb +8 -0
  162. data/test/unit/catalog_test.rb +8 -0
  163. data/test/unit/classification_test.rb +8 -0
  164. data/test/unit/facet_test.rb +8 -0
  165. data/test/unit/frame_test.rb +8 -0
  166. data/test/unit/image_asset_test.rb +8 -0
  167. data/test/unit/label_test.rb +8 -0
  168. data/test/unit/labelling_test.rb +8 -0
  169. data/test/unit/presentation_test.rb +8 -0
  170. data/test/unit/slide_test.rb +8 -0
  171. data/test/unit/slot_test.rb +8 -0
  172. data/test/unit/topic_test.rb +8 -0
  173. data/test/unit/tray_position_test.rb +8 -0
  174. data/test/unit/user_test.rb +103 -0
  175. metadata +453 -0
@@ -0,0 +1,9 @@
1
+ %p
2
+ %label{:for => 'caption'} Caption:
3
+ =text_field :facet, :caption
4
+ %p
5
+ %label{:for => 'order'} Label Order:
6
+ =select(:facet, :label_order, Facet::LABEL_ORDER)
7
+ %p
8
+ %label{:for => 'color'} Color:
9
+ =select(:facet, :color, %w(red orange yellow green blue violet gray))
@@ -0,0 +1,15 @@
1
+ =content_for :h1 do
2
+ #type
3
+ %small Catalog
4
+ Facet
5
+ #title
6
+ %small=link_to @catalog.title, catalog_path(@catalog)
7
+ =@facet.caption
8
+ #action
9
+ =button_to "Delete", catalog_facet_path(@catalog, @facet), :method => :delete, :onclick => "return confirm('Are you sure?')"
10
+ #sidebar.fassets_core=render "labels/sidebar"
11
+
12
+ #main.fassets_core
13
+ =form_for [@catalog, @facet], :url => catalog_facet_path(@catalog,@facet) do |f|
14
+ =render :partial => "form", :object => f
15
+ =submit_tag "Save"
@@ -0,0 +1,3 @@
1
+ %p
2
+ %label{:for => 'caption'} Caption:
3
+ =text_field :label, :caption
@@ -0,0 +1,22 @@
1
+ .collapsible
2
+ %h2.title New Label
3
+ =form_for [@catalog, @facet, Label.new], :url => catalog_facet_labels_path(@catalog,@facet) do |f|
4
+ =render :partial => "labels/form", :object => f
5
+ =submit_tag "Create"
6
+
7
+ .collapsible
8
+ %h2.title Labels
9
+ %ol.collection{:class => @facet.label_order == 'position' ? "sortable" : nil, :id => "catalogs.#{@catalog.id}.facets.#{@facet.id}.labels.sort"}
10
+ -@facet.ordered_labels.each do |label|
11
+ %li{:id => "label_#{label.id}"}
12
+ =label.caption
13
+ .content
14
+ =form_for [@catalog, @facet, label], :url => catalog_facet_label_path(@catalog, @facet, label) do |f|
15
+ =render :partial => "labels/form", :object => f
16
+ =submit_tag "Save"
17
+ =button_to "Drop", catalog_facet_label_path(@catalog, @facet, label),
18
+ :confirm => 'Are you sure?',
19
+ :method => "delete",
20
+ :remote => true,
21
+ :disable_with => 'loading...'
22
+
@@ -0,0 +1,13 @@
1
+ $("#flash").html("<%= escape_javascript render(:partial => 'shared/flash_messages', :locals => {:flash => flash}) %>");
2
+ $("#message").show("slide", { direction: "left" }).delay(3000).hide("slide", { direction: "left" });
3
+ <% flash.discard %>
4
+
5
+ $("#sidebar.fassets_core").html("<%= escape_javascript render(:partial => 'labels/sidebar') %>");
6
+
7
+ $("#sidebar.fassets_core .collapsible").collapsiblePanel({
8
+ collapsedImage: "<%= image_path 'fassets_core/collapsed.png' %>",
9
+ expandedImage: "<%= image_path 'fassets_core/collapse.png' %>",
10
+ titleQuery: "h2.title",
11
+ startCollapsed: true
12
+ });
13
+
@@ -0,0 +1,16 @@
1
+ - content_for :head do
2
+ =stylesheet_link_tag 'fassets_core/application'
3
+ =javascript_include_tag 'fassets_core/application'
4
+ =yield :core_head
5
+
6
+ - content_for :catalogs_selector do
7
+ =collection_select :catalog,
8
+ :id, Catalog.all,
9
+ :id, :title,
10
+ options ={:prompt => "Catalogs ..."},
11
+ :onchange => "javascript:window.location= '/catalogs/' + this.value"
12
+
13
+ - content_for :tray do
14
+ =render :partial => "shared/tray"
15
+
16
+ =render :template => 'layouts/application'
@@ -0,0 +1,22 @@
1
+ %li.asset{:id => tp ? "tp_#{tp.id}" : "asset_#{asset.id}", :rel => tp ? asset.id : nil, :data => { 'asset-id' => asset ? asset.id: nil}}
2
+ .asset_content
3
+ .icon
4
+ =render :partial => content_partial(asset.content, :icon), :locals => {:content => asset.content}
5
+ .caption
6
+ =link_to truncate(asset.name,:length => 13,:omission => "..."), asset_content_path(asset.content), :class => "caption"
7
+ .asset_actions
8
+ .action
9
+ -if user_signed_in?
10
+ =button_to "Edit", "",
11
+ :method => :get,
12
+ :class => "edit_button",
13
+ :data => {:asset_id => asset.id, :content_id => asset.content_id}
14
+ =#image_tag "fassets_core/drag.png", :width => 12, :height => 13, :class => "handle"
15
+ -if tp
16
+ =button_to "Drop", main_app.user_tray_position_path(current_user,tp.id),
17
+ :method => :delete,
18
+ :class => "drop_button",
19
+ :data => {:tp_id => tp.id, :user_id => current_user.id}
20
+ -else
21
+ -@content = asset.content
22
+ =render :partial => "assets/put_on_tray", :locals => {}
@@ -0,0 +1,7 @@
1
+ =form_for model, :html => options do |f|
2
+ =fields_for "#{model.class.to_s.underscore}", asset do |asset|
3
+ %p
4
+ %label{:for => 'name'} Name:
5
+ =asset.text_field :name
6
+ =render :partial => "form", :object => f
7
+ =submit_tag submit
@@ -0,0 +1,23 @@
1
+ .collapsible
2
+ %h2.title Add Classification
3
+ =form_for Classification.new(:asset_id => asset.id) do |f|
4
+ =select("classification", "catalog_id", Catalog.all.map {|c| [ c.title, c.id ] })
5
+ =f.hidden_field :asset_id
6
+ =submit_tag "Add"
7
+
8
+ %ul.collection{:class => "drawers"}
9
+ -asset.classifications.each do |classification|
10
+ %h2.title=classification.catalog.title
11
+ %li
12
+ .handle=classification.catalog.title
13
+ .content
14
+ =button_to "Drop", [classification], :method => :delete, :confirm => "Sure?"
15
+ =form_for [classification] do
16
+ =submit_tag "Save"
17
+ -facet2label = Hash[*classification.labels.map{|l| [l.facet_id, l.id]}.flatten]
18
+ .submit
19
+ -classification.catalog.facets.each do |facet|
20
+ %p
21
+ %label=facet.caption
22
+ =label_select(facet, facet2label[facet.id])
23
+
@@ -0,0 +1,10 @@
1
+ %li.clipboard{:id => "tp_#{tp.id}", :class => tp.clipboard_type}
2
+ .icon
3
+ =image_tag 'fassets_core/clipboard.png'
4
+ =link_to tp.clipboard.title, tp.clipboard.path, :class => "caption"
5
+ .type
6
+ =tp.clipboard_type.upcase
7
+ .action
8
+ =link_to image_tag("fassets_core/edit.png", :width => 15, :height => 15), tp.clipboard.path + "/edit"
9
+ =image_tag "fassets_core/drag.png", :width => 12, :height => 13, :class => "handle"
10
+ =check_box_tag "del[]", tp.id
@@ -0,0 +1,6 @@
1
+ -if target.errors.any?
2
+ #form_error
3
+ %ul
4
+ -target.errors.full_messages.each do |msg|
5
+ %li
6
+ =msg
@@ -0,0 +1,13 @@
1
+ - if user_signed_in?
2
+ =form_tag main_app.replace_user_tray_positions_path(current_user),
3
+ :data => { :user_id => current_user.id },
4
+ :id => "tray",
5
+ :method => :put do
6
+ %ol.sortable{:id => "users.#{current_user.id}.tray_positions.replace", :class => "sortable_tray"}
7
+ -current_user.tray_positions.each do |tp|
8
+ -if tp.clipboard_type
9
+ =render :partial => "shared/clipboard", :locals => {:tp => tp}
10
+ -else
11
+ =render :partial => "shared/asset", :locals => {:tp => tp, :asset => tp.asset}
12
+ %ul#create_links
13
+ %li=button_tag "New Assets", :id => "new_asset_link"
@@ -0,0 +1,8 @@
1
+ %li.asset
2
+ .icon
3
+ =render :partial => content_partial(asset.content, :icon), :locals => {:content => asset.content}
4
+ .type
5
+ =asset.content.media_type.upcase
6
+ -if user_signed_in?
7
+ =link_to "edit", edit_asset_content_path(asset.content)
8
+ =link_to asset.name, asset_content_path(asset.content)
@@ -0,0 +1,10 @@
1
+ if @tp
2
+ page << %Q{ $("#tray_#{@tp.id}").effect("shake"); }
3
+ else
4
+ tray_position = render_escaped(:partial => 'shared/tray_position',
5
+ :locals => {:tray_position => @tray_position})
6
+ page << %Q{
7
+ $("#tray").prepend("#{tray_position}");
8
+ $("#tray").sortable("refresh");
9
+ }
10
+ end
@@ -0,0 +1 @@
1
+ page << %Q{ $("#tray_#{@tray_position.id}").remove(); }
@@ -0,0 +1,15 @@
1
+
2
+ if @tp
3
+ tray_position = render_escaped(:partial => 'shared/tray_position',
4
+ :locals => {:tray_position => @tp})
5
+
6
+ page << %Q{
7
+ $("#tray_0").replaceWith("#{tray_position}");
8
+ ajaxifyTrayRemoveButtons();
9
+ }
10
+
11
+ end
12
+
13
+ page << %Q{
14
+ $("#tray").sortable("refresh");
15
+ }
@@ -0,0 +1,2 @@
1
+ Mime::Type.register "image/svg+xml", :svg
2
+
@@ -0,0 +1,2 @@
1
+ Rails.application.config.autoload_paths += %W(#{Rails.application.config.root}/app/uploaders)
2
+
@@ -0,0 +1,7 @@
1
+ Rails.application.config.to_prepare do
2
+
3
+ User.class_eval do
4
+ has_many :tray_positions, :order => "position", :include => {:asset => :classifications}
5
+ end
6
+
7
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,34 @@
1
+ Rails.application.routes.draw do
2
+ resources :catalogs do
3
+ resources :facets do
4
+ collection do
5
+ post :sort
6
+ end
7
+ resources :labels do
8
+ collection do
9
+ put :sort
10
+ end
11
+ end
12
+ end
13
+ put :add_asset
14
+ end
15
+
16
+ resources :classifications
17
+
18
+ resources :users do
19
+ resources :tray_positions do
20
+ collection do
21
+ put :replace
22
+ end
23
+ end
24
+ end
25
+
26
+ match 'asset/:id/preview' => 'Assets#preview'
27
+ match 'asset/:id/edit' => 'Assets#edit'
28
+ match 'asset/:id/classifications' => 'Assets#classifications'
29
+ match 'catalog_box' => 'Catalogs#catalog_box'
30
+ match 'box_content' => 'Catalogs#box_content'
31
+ match 'box_facet' => 'Catalogs#box_facet'
32
+ match 'edit_box/:id' => 'Assets#edit_box'
33
+ match 'assets/new' => 'assets#new'
34
+ end
@@ -0,0 +1,13 @@
1
+ class CreateCatalogs < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :catalogs do |t|
4
+ t.string :title
5
+ t.string :permalink
6
+ t.text :info
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :catalogs
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ class CreateFacets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :facets do |t|
4
+ t.string :caption
5
+ t.string :color
6
+ t.string :order
7
+ t.integer :catalog_id
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :facets
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ class CreateLabels < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :labels do |t|
4
+ t.string :caption
5
+ t.integer :facet_id
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table :labels
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateClassifications < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :classifications do |t|
4
+ t.integer :catalog_id
5
+ t.integer :asset_id
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table :classifications
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateLabelings < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :labelings do |t|
4
+ t.integer :classification_id
5
+ t.integer :label_id
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table :labelings
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateTrayPositions < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :tray_positions do |t|
4
+ t.integer :user_id
5
+ t.integer :position
6
+ t.integer :asset_id
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :tray_positions
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ class CreateAssets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :assets do |t|
4
+ t.string :name
5
+ t.boolean :public
6
+ t.integer :content_id
7
+ t.string :content_type
8
+ t.integer :user_id
9
+ t.integer :classifications_count
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ class AddLabelOrdering < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :labels, :position, :integer
4
+ add_column :labels, :value, :integer
5
+ add_column :facets, :label_order, :string
6
+ end
7
+
8
+ def self.down
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class AddClipboard < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :tray_positions, :clipboard_type, :string
4
+ add_column :tray_positions, :clipboard_id, :integer
5
+ end
6
+
7
+ def self.down
8
+ remove_column :tray_positions, :clipboard_type, :string
9
+ remove_column :tray_positions, :clipboard_id, :integer
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddPositionToFacet < ActiveRecord::Migration
2
+ def change
3
+ add_column :facets, :position, :integer
4
+ end
5
+ end
data/db/schema.rb ADDED
@@ -0,0 +1,141 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended to check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(:version => 20) do
14
+
15
+ create_table "assets", :force => true do |t|
16
+ t.string "name"
17
+ t.boolean "public"
18
+ t.integer "content_id"
19
+ t.string "content_type"
20
+ t.integer "user_id"
21
+ t.integer "classifications_count"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ create_table "catalogs", :force => true do |t|
27
+ t.string "title"
28
+ t.string "permalink"
29
+ t.text "info"
30
+ end
31
+
32
+ create_table "classifications", :force => true do |t|
33
+ t.integer "catalog_id"
34
+ t.integer "asset_id"
35
+ end
36
+
37
+ create_table "facets", :force => true do |t|
38
+ t.string "caption"
39
+ t.string "color"
40
+ t.string "order"
41
+ t.integer "catalog_id"
42
+ t.string "label_order"
43
+ end
44
+
45
+ create_table "file_assets", :force => true do |t|
46
+ t.string "file"
47
+ t.string "content_type"
48
+ t.datetime "created_at"
49
+ t.datetime "updated_at"
50
+ end
51
+
52
+ create_table "frames", :force => true do |t|
53
+ t.integer "presentation_id"
54
+ t.string "title"
55
+ t.string "template"
56
+ t.integer "position"
57
+ t.integer "parent_id"
58
+ t.text "content"
59
+ end
60
+
61
+ create_table "labelings", :force => true do |t|
62
+ t.integer "classification_id"
63
+ t.integer "label_id"
64
+ end
65
+
66
+ create_table "labels", :force => true do |t|
67
+ t.string "caption"
68
+ t.integer "facet_id"
69
+ t.integer "position"
70
+ t.integer "value"
71
+ end
72
+
73
+ create_table "presentations", :force => true do |t|
74
+ t.string "title"
75
+ t.string "template"
76
+ end
77
+
78
+ create_table "sessions", :force => true do |t|
79
+ t.string "session_id", :null => false
80
+ t.text "data"
81
+ t.datetime "created_at"
82
+ t.datetime "updated_at"
83
+ end
84
+
85
+ add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
86
+ add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
87
+
88
+ create_table "slides", :force => true do |t|
89
+ t.integer "presentation_id"
90
+ t.string "title"
91
+ t.string "template"
92
+ t.integer "position"
93
+ t.text "content"
94
+ t.integer "topic_id"
95
+ end
96
+
97
+ create_table "slots", :force => true do |t|
98
+ t.integer "slide_id"
99
+ t.string "name"
100
+ t.text "body"
101
+ t.integer "asset_id"
102
+ end
103
+
104
+ create_table "topics", :force => true do |t|
105
+ t.integer "presentation_id"
106
+ t.integer "topic_slide"
107
+ t.string "title"
108
+ t.integer "position"
109
+ t.integer "parent_id"
110
+ end
111
+
112
+ create_table "tray_positions", :force => true do |t|
113
+ t.integer "user_id"
114
+ t.integer "position"
115
+ t.integer "asset_id"
116
+ t.string "clipboard_type"
117
+ t.integer "clipboard_id"
118
+ end
119
+
120
+ create_table "urls", :force => true do |t|
121
+ t.string "url"
122
+ end
123
+
124
+ create_table "users", :force => true do |t|
125
+ t.string "email", :default => "", :null => false
126
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
127
+ t.string "reset_password_token"
128
+ t.datetime "remember_created_at"
129
+ t.integer "sign_in_count", :default => 0
130
+ t.datetime "current_sign_in_at"
131
+ t.datetime "last_sign_in_at"
132
+ t.string "current_sign_in_ip"
133
+ t.string "last_sign_in_ip"
134
+ t.datetime "created_at"
135
+ t.datetime "updated_at"
136
+ end
137
+
138
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
139
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
140
+
141
+ end