comfortable_mexican_sofa 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. data/.gitignore +10 -0
  2. data/CHANGELOG.rdoc +2 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +55 -0
  5. data/Rakefile +88 -0
  6. data/VERSION +1 -0
  7. data/app/controllers/cms_admin/attachments_controller.rb +55 -0
  8. data/app/controllers/cms_admin/base_controller.rb +25 -0
  9. data/app/controllers/cms_admin/categories_controller.rb +69 -0
  10. data/app/controllers/cms_admin/layouts_controller.rb +71 -0
  11. data/app/controllers/cms_admin/pages_controller.rb +79 -0
  12. data/app/controllers/cms_admin/sections_controller.rb +17 -0
  13. data/app/controllers/cms_admin/snippets_controller.rb +58 -0
  14. data/app/controllers/cms_common/render_page.rb +47 -0
  15. data/app/controllers/cms_content_controller.rb +30 -0
  16. data/app/helpers/cms_helper.rb +12 -0
  17. data/app/models/cms_attachment.rb +17 -0
  18. data/app/models/cms_attachment_categorization.rb +5 -0
  19. data/app/models/cms_block.rb +15 -0
  20. data/app/models/cms_category.rb +36 -0
  21. data/app/models/cms_layout.rb +102 -0
  22. data/app/models/cms_page.rb +125 -0
  23. data/app/models/cms_page_categorization.rb +6 -0
  24. data/app/models/cms_snippet.rb +15 -0
  25. data/app/views/cms_admin/attachments/_details.html.haml +27 -0
  26. data/app/views/cms_admin/attachments/_form.html.haml +24 -0
  27. data/app/views/cms_admin/attachments/edit.html.haml +10 -0
  28. data/app/views/cms_admin/attachments/index.html.haml +36 -0
  29. data/app/views/cms_admin/attachments/new.html.haml +8 -0
  30. data/app/views/cms_admin/categories/_category.html.haml +21 -0
  31. data/app/views/cms_admin/categories/_category_subform.html.haml +12 -0
  32. data/app/views/cms_admin/categories/_form.html.haml +18 -0
  33. data/app/views/cms_admin/categories/_new.html.haml +7 -0
  34. data/app/views/cms_admin/categories/_toggle_link.html.haml +9 -0
  35. data/app/views/cms_admin/categories/_tree_branch.html.haml +36 -0
  36. data/app/views/cms_admin/categories/children.js.rjs +10 -0
  37. data/app/views/cms_admin/categories/create.js.rjs +9 -0
  38. data/app/views/cms_admin/categories/edit.html.haml +10 -0
  39. data/app/views/cms_admin/categories/index.html.haml +7 -0
  40. data/app/views/cms_admin/categories/new.html.haml +8 -0
  41. data/app/views/cms_admin/categories/show.html.haml +17 -0
  42. data/app/views/cms_admin/layouts/_details.html.haml +6 -0
  43. data/app/views/cms_admin/layouts/_form.html.haml +19 -0
  44. data/app/views/cms_admin/layouts/_toggle_link.html.haml +9 -0
  45. data/app/views/cms_admin/layouts/_tree_branch.html.haml +39 -0
  46. data/app/views/cms_admin/layouts/children.js.rjs +10 -0
  47. data/app/views/cms_admin/layouts/edit.html.haml +10 -0
  48. data/app/views/cms_admin/layouts/index.html.haml +7 -0
  49. data/app/views/cms_admin/layouts/new.html.haml +8 -0
  50. data/app/views/cms_admin/pages/_details.html.haml +25 -0
  51. data/app/views/cms_admin/pages/_form.html.haml +45 -0
  52. data/app/views/cms_admin/pages/_form_blocks.html.haml +48 -0
  53. data/app/views/cms_admin/pages/_toggle_link.html.haml +10 -0
  54. data/app/views/cms_admin/pages/_tree_branch.html.haml +41 -0
  55. data/app/views/cms_admin/pages/children.js.rjs +10 -0
  56. data/app/views/cms_admin/pages/edit.html.haml +11 -0
  57. data/app/views/cms_admin/pages/form_blocks.js.rjs +1 -0
  58. data/app/views/cms_admin/pages/index.html.haml +6 -0
  59. data/app/views/cms_admin/pages/new.html.haml +9 -0
  60. data/app/views/cms_admin/sections/show.html.haml +23 -0
  61. data/app/views/cms_admin/snippets/_form.html.haml +10 -0
  62. data/app/views/cms_admin/snippets/edit.html.haml +10 -0
  63. data/app/views/cms_admin/snippets/index.html.haml +26 -0
  64. data/app/views/cms_admin/snippets/new.html.haml +8 -0
  65. data/app/views/cms_content/show.xml.rxml +27 -0
  66. data/app/views/cms_content/sitemap.xml.rxml +16 -0
  67. data/app/views/layouts/cms_admin.html.haml +44 -0
  68. data/comfortable_mexican_sofa.gemspec +254 -0
  69. data/config/cms_routes.rb +25 -0
  70. data/generators/cms/cms_generator.rb +55 -0
  71. data/generators/cms/templates/README +32 -0
  72. data/generators/cms/templates/images/arrow_bottom.gif +0 -0
  73. data/generators/cms/templates/images/arrow_right.gif +0 -0
  74. data/generators/cms/templates/images/icon_attachment.gif +0 -0
  75. data/generators/cms/templates/images/icon_category.gif +0 -0
  76. data/generators/cms/templates/images/icon_draft.gif +0 -0
  77. data/generators/cms/templates/images/icon_layout.gif +0 -0
  78. data/generators/cms/templates/images/icon_move.gif +0 -0
  79. data/generators/cms/templates/images/icon_regular.gif +0 -0
  80. data/generators/cms/templates/images/icon_snippet.gif +0 -0
  81. data/generators/cms/templates/images/logo.png +0 -0
  82. data/generators/cms/templates/initializers/cms.rb +14 -0
  83. data/generators/cms/templates/initializers/paperclip.rb +14 -0
  84. data/generators/cms/templates/javascripts/codemirror_init.js +16 -0
  85. data/generators/cms/templates/javascripts/mce_init.js +17 -0
  86. data/generators/cms/templates/javascripts/utilities.js +27 -0
  87. data/generators/cms/templates/migrations/create_cms.rb +113 -0
  88. data/generators/cms/templates/stylesheets/cms_master.sass +414 -0
  89. data/init.rb +1 -0
  90. data/lib/comfortable_mexican_sofa.rb +46 -0
  91. data/lib/comfortable_mexican_sofa/acts_as_categorized.rb +87 -0
  92. data/lib/comfortable_mexican_sofa/acts_as_published.rb +60 -0
  93. data/lib/comfortable_mexican_sofa/cms_acts_as_tree.rb +108 -0
  94. data/lib/comfortable_mexican_sofa/cms_rails_extensions.rb +12 -0
  95. data/lib/comfortable_mexican_sofa/cms_tag.rb +109 -0
  96. data/lib/comfortable_mexican_sofa/cms_tags/attachment.rb +3 -0
  97. data/lib/comfortable_mexican_sofa/cms_tags/block.rb +117 -0
  98. data/lib/comfortable_mexican_sofa/cms_tags/helper.rb +3 -0
  99. data/lib/comfortable_mexican_sofa/cms_tags/page_block.rb +119 -0
  100. data/lib/comfortable_mexican_sofa/cms_tags/partial.rb +19 -0
  101. data/lib/comfortable_mexican_sofa/cms_tags/snippet.rb +19 -0
  102. data/rails/init.rb +1 -0
  103. data/test/fixtures/cms_attachment_categorizations.yml +7 -0
  104. data/test/fixtures/cms_attachments.yml +6 -0
  105. data/test/fixtures/cms_blocks.yml +38 -0
  106. data/test/fixtures/cms_categories.yml +19 -0
  107. data/test/fixtures/cms_layouts.yml +41 -0
  108. data/test/fixtures/cms_page_categorizations.yml +15 -0
  109. data/test/fixtures/cms_pages.yml +38 -0
  110. data/test/fixtures/cms_snippets.yml +7 -0
  111. data/test/fixtures/files/upload_file.txt +1 -0
  112. data/test/functional/cms_admin/attachments_controller_test.rb +63 -0
  113. data/test/functional/cms_admin/categories_controller_test.rb +86 -0
  114. data/test/functional/cms_admin/layouts_controller_test.rb +77 -0
  115. data/test/functional/cms_admin/pages_controller_test.rb +153 -0
  116. data/test/functional/cms_admin/sections_controller_test.rb +9 -0
  117. data/test/functional/cms_admin/snippets_controller_test.rb +63 -0
  118. data/test/functional/cms_content_controller_test.rb +52 -0
  119. data/test/models/cms_attachment_test.rb +16 -0
  120. data/test/models/cms_block_test.rb +11 -0
  121. data/test/models/cms_categorization_test.rb +39 -0
  122. data/test/models/cms_category_test.rb +71 -0
  123. data/test/models/cms_layout_test.rb +44 -0
  124. data/test/models/cms_page_test.rb +55 -0
  125. data/test/models/cms_snippet_test.rb +16 -0
  126. data/test/models/cms_tag_test.rb +70 -0
  127. data/test/rails_root/README +243 -0
  128. data/test/rails_root/Rakefile +10 -0
  129. data/test/rails_root/app/controllers/application_controller.rb +10 -0
  130. data/test/rails_root/app/helpers/application_helper.rb +3 -0
  131. data/test/rails_root/app/views/cms/under-development.html.haml +1 -0
  132. data/test/rails_root/app/views/complex_page/_example.html.erb +1 -0
  133. data/test/rails_root/config/boot.rb +110 -0
  134. data/test/rails_root/config/database.yml +22 -0
  135. data/test/rails_root/config/environment.rb +48 -0
  136. data/test/rails_root/config/environments/development.rb +17 -0
  137. data/test/rails_root/config/environments/production.rb +28 -0
  138. data/test/rails_root/config/environments/test.rb +28 -0
  139. data/test/rails_root/config/initializers/backtrace_silencers.rb +7 -0
  140. data/test/rails_root/config/initializers/inflections.rb +10 -0
  141. data/test/rails_root/config/initializers/mime_types.rb +5 -0
  142. data/test/rails_root/config/initializers/new_rails_defaults.rb +19 -0
  143. data/test/rails_root/config/initializers/session_store.rb +15 -0
  144. data/test/rails_root/config/locales/en.yml +5 -0
  145. data/test/rails_root/config/routes.rb +43 -0
  146. data/test/rails_root/doc/README_FOR_APP +2 -0
  147. data/test/rails_root/public/404.html +30 -0
  148. data/test/rails_root/public/422.html +30 -0
  149. data/test/rails_root/public/500.html +30 -0
  150. data/test/rails_root/public/favicon.ico +0 -0
  151. data/test/rails_root/public/images/rails.png +0 -0
  152. data/test/rails_root/public/index.html +275 -0
  153. data/test/rails_root/public/javascripts/application.js +2 -0
  154. data/test/rails_root/public/javascripts/controls.js +963 -0
  155. data/test/rails_root/public/javascripts/dragdrop.js +973 -0
  156. data/test/rails_root/public/javascripts/effects.js +1128 -0
  157. data/test/rails_root/public/javascripts/prototype.js +4320 -0
  158. data/test/rails_root/public/robots.txt +5 -0
  159. data/test/rails_root/public/stylesheets/sass/cms_master.sass +414 -0
  160. data/test/rails_root/script/about +4 -0
  161. data/test/rails_root/script/console +3 -0
  162. data/test/rails_root/script/dbconsole +3 -0
  163. data/test/rails_root/script/destroy +3 -0
  164. data/test/rails_root/script/generate +3 -0
  165. data/test/rails_root/script/performance/benchmarker +3 -0
  166. data/test/rails_root/script/performance/profiler +3 -0
  167. data/test/rails_root/script/plugin +3 -0
  168. data/test/rails_root/script/runner +3 -0
  169. data/test/rails_root/script/server +3 -0
  170. data/test/test_helper.rb +17 -0
  171. metadata +303 -0
@@ -0,0 +1,25 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+
3
+ map.namespace :cms_admin, :path_prefix => 'cms-admin' do |cms_admin|
4
+ cms_admin.connect '/', :controller => 'pages', :action => 'index'
5
+ cms_admin.resources :layouts,
6
+ :member => { :children => :any,
7
+ :reorder => :any }
8
+ cms_admin.resources :pages,
9
+ :member => { :children => :any,
10
+ :form_blocks => :any,
11
+ :reorder => :any }
12
+ cms_admin.resources :snippets,
13
+ :collection => { :reorder => :any }
14
+ cms_admin.resources :attachments
15
+ cms_admin.resources :categories,
16
+ :member => { :children => :any }
17
+ cms_admin.resources :sections, :only => [ :show ]
18
+ end
19
+
20
+ map.with_options :controller => 'cms_content' do |cms|
21
+ cms.connect '/sitemap.xml', :action => 'sitemap'
22
+ cms.connect '*path', :action => 'show'
23
+ end
24
+
25
+ end
@@ -0,0 +1,55 @@
1
+ class CmsGenerator < Rails::Generator::Base
2
+ def manifest
3
+ record do |m|
4
+
5
+ # moving database migration
6
+ if Dir.glob("db/migrate/[0-9]*_*.rb").grep(/[0-9]+_create_cms.rb$/).empty?
7
+ m.migration_template 'migrations/create_cms.rb', 'db/migrate', :migration_file_name => 'create_cms'
8
+ else
9
+ puts "WARNING: Migration 'create_cms' already exists. Manually adjust it, or remove it."
10
+ end
11
+
12
+ # moving stylesheets
13
+ if defined?(Sass)
14
+ sass_dir = Sass::Plugin.options[:template_location].gsub(Rails.root, '')
15
+ m.directory sass_dir
16
+ m.file "stylesheets/cms_master.sass", "#{sass_dir}/cms_master.sass", :collision => :ask
17
+ else
18
+ puts 'WARNING: HAML/SASS not installed'
19
+ end
20
+
21
+ # moving javascript
22
+ m.directory 'public/javascripts/cms'
23
+ %w(utilities.js mce_init.js codemirror_init.js).each do |f|
24
+ m.file "javascripts/#{f}", "public/javascripts/cms/#{f}", :collision => :ask
25
+ end
26
+
27
+ # moving initializers
28
+ m.directory 'config/initializers'
29
+ %w(paperclip.rb cms.rb).each do |f|
30
+ m.file "initializers/#{f}", "config/initializers/#{f}", :collision => :ask
31
+ end
32
+
33
+ # moving images
34
+ m.directory 'public/images/cms'
35
+ %w(
36
+ arrow_bottom.gif
37
+ arrow_right.gif
38
+ icon_attachment.gif
39
+ icon_category.gif
40
+ icon_draft.gif
41
+ icon_layout.gif
42
+ icon_move.gif
43
+ icon_regular.gif
44
+ icon_snippet.gif
45
+ logo.png
46
+ ).each do |f|
47
+ m.file "images/#{f}", "public/images/cms/#{f}", :collision => :ask
48
+ end
49
+
50
+ # some reading material
51
+ m.readme 'README'
52
+
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,32 @@
1
+ ____ __ _ _ _
2
+ / ___|___ _ __ ___ / _| ___ _ __| |_ __ _| |__ | | ___
3
+ | | / _ \| '_ ` _ \| |_ / _ \| '__| __/ _` | '_ \| |/ _ \
4
+ | |__| (_) | | | | | | _| (_) | | | || (_| | |_) | | __/
5
+ \____\___/|_| |_| |_|_| \___/|_| \__\__,_|_.__/|_|\___|
6
+ __ __ _ ____ __
7
+ | \/ | _____ _(_) ___ __ _ _ __ / ___| ___ / _| __ _
8
+ | |\/| |/ _ \ \/ / |/ __/ _` | '_ \ \___ \ / _ \| |_ / _` |
9
+ | | | | __/> <| | (_| (_| | | | | ___) | (_) | _| (_| |
10
+ |_| |_|\___/_/\_\_|\___\__,_|_| |_| |____/ \___/|_| \__,_|
11
+
12
+ Hey, thanks for being AWESOME!
13
+
14
+ Please make sure you got following in your environment.rb file:
15
+
16
+ config.gem 'haml'
17
+ config.gem 'calendar_date_select'
18
+ config.gem 'thoughtbot-paperclip', :lib => 'paperclip'
19
+ config.gem 'mislav-will_paginate', :lib => 'will_paginate'
20
+ config.gem 'active_link_helper'
21
+
22
+ config.gem 'comfortable_mexican_sofa'
23
+
24
+ Be sure to check out config/initializers/cms.rb for configuration options!
25
+
26
+ Some other things you may want to install if you want some fancy textarea
27
+ replacements:
28
+
29
+ TinyMCE Editor - http://tinymce.moxiecode.com/
30
+ CodeMirror - http://marijn.haverbeke.nl/codemirror/
31
+
32
+
@@ -0,0 +1,14 @@
1
+ ### CMS Configuration
2
+ # Available configuration options:
3
+
4
+ # http_auth_enabled: enable authentication or not. Default: true
5
+ # http_auth_username: the username for /cms-admin. Default: username
6
+ # http_auth_password: the password for /cms-admin Default: password
7
+ # cms_title: If set, this overrides the randomly changing CMS title. Only set this if you're boring. Default: not set
8
+
9
+ ComfortableMexicanSofa.config do |config|
10
+ #config.http_auth_enabled = true
11
+ #config.http_auth_username = 'some_other_username'
12
+ #config.http_auth_password = 'some_other_password'
13
+ #config.cms_title = 'some_other_boring_title'
14
+ end
@@ -0,0 +1,14 @@
1
+ class Paperclip::Attachment
2
+ def self.default_options
3
+ @default_options ||= {
4
+ :url => "/system/:attachment/:id/:style/:filename",
5
+ :path => ":rails_root/public:url",
6
+ :styles => {},
7
+ :default_url => "/:attachment/:style/missing.png",
8
+ :default_style => :original,
9
+ :validations => [],
10
+ :storage => :filesystem,
11
+ :whiny => Paperclip.options[:whiny] || Paperclip.options[:whiny_thumbnails]
12
+ }
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ function init_CodeMirror(){
2
+ $$('.codeTextArea').each(function(el){
3
+ try{
4
+ CodeMirror.fromTextArea(el, {
5
+ parserfile: ["parsexml.js", "parsecss.js", "tokenizejavascript.js", "parsejavascript.js", "parsehtmlmixed.js"],
6
+ stylesheet: ["/stylesheets/codemirror/xmlcolors.css", "/stylesheets/codemirror/jscolors.css", "/stylesheets/codemirror/csscolors.css"],
7
+ path: "/javascripts/codemirror/",
8
+ iframeClass: 'codeMirrorIframe'
9
+ });
10
+ }catch(e){ }
11
+ });
12
+ }
13
+
14
+ Event.observe(window, 'load', function() {
15
+ init_CodeMirror();
16
+ });
@@ -0,0 +1,17 @@
1
+ function init_TinyMCE(){
2
+ tinyMCE.init({
3
+ mode : "specific_textareas",
4
+ editor_selector : "mceEditor",
5
+ theme : "advanced",
6
+ theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,code",
7
+ theme_advanced_buttons2 : '',
8
+ theme_advanced_buttons3 : '',
9
+ theme_advanced_toolbar_location : "top",
10
+ theme_advanced_toolbar_align : "left",
11
+ auto_reset_designmode : true
12
+ });
13
+ }
14
+
15
+ Event.observe(window, 'load', function() {
16
+ init_TinyMCE();
17
+ });
@@ -0,0 +1,27 @@
1
+ function slugify_field(field, value) {
2
+ field.value = slugify(value)
3
+ }
4
+
5
+ // slugify was found at http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript
6
+ function slugify(str) {
7
+ str = str.replace(/^\s+|\s+$/g, '');
8
+ var from = "ÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛàáäâèéëêìíïîòóöôùúüûÑñÇç·/_,:;";
9
+ var to = "aaaaeeeeiiiioooouuuuaaaaeeeeiiiioooouuuunncc------";
10
+ for (var i=0, l=from.length ; i<l ; i++) {
11
+ str = str.replace(new RegExp(from[i], "g"), to[i]);
12
+ }
13
+ str = str.replace(/[^a-zA-Z0-9 -]/g, '').replace(/\s+/g, '-').toLowerCase();
14
+ return str;
15
+ }
16
+
17
+ function toggle_category_selections(obj, parents, children){
18
+ if (obj.checked == true){
19
+ parents.each(function(id){
20
+ $('cms_category_id_' + id).checked = true
21
+ })
22
+ } else {
23
+ children.each(function(id){
24
+ $('cms_category_id_' + id).checked = false
25
+ })
26
+ }
27
+ }
@@ -0,0 +1,113 @@
1
+ class CreateCms < ActiveRecord::Migration
2
+ def self.up
3
+
4
+ create_table :cms_layouts do |t|
5
+ t.integer :parent_id
6
+ t.string :label
7
+ t.text :content
8
+ t.string :app_layout
9
+ t.integer :children_count, :null => false, :default => 0
10
+ t.boolean :is_extendable, :null => false, :default => false
11
+ t.integer :position, :null => false, :default => 0
12
+ t.timestamps
13
+ end
14
+ add_index :cms_layouts, :parent_id
15
+ add_index :cms_layouts, :label
16
+
17
+
18
+ create_table :cms_pages do |t|
19
+ t.integer :cms_layout_id
20
+ t.integer :parent_id
21
+ t.integer :redirect_to_page_id
22
+ t.string :label
23
+ t.string :slug
24
+ t.string :full_path
25
+ t.integer :children_count, :null => false, :default => 0
26
+ t.integer :position, :null => false, :default => 0
27
+ t.boolean :is_section, :null => false, :default => false
28
+ t.datetime :published_at
29
+ t.datetime :unpublished_at
30
+ t.timestamps
31
+ end
32
+ add_index :cms_pages, :parent_id
33
+ add_index :cms_pages, :slug
34
+ add_index :cms_pages, :is_section
35
+ add_index :cms_pages, :full_path, :unique => true
36
+
37
+
38
+ create_table :cms_snippets do |t|
39
+ t.string :label
40
+ t.text :content
41
+ t.timestamps
42
+ end
43
+ add_index :cms_snippets, :label, :unique => true
44
+
45
+
46
+ create_table :cms_blocks do |t|
47
+ t.integer :cms_page_id
48
+ t.string :label
49
+ t.text :content_text
50
+ t.string :content_string
51
+ t.integer :content_integer
52
+ t.boolean :content_boolean
53
+ t.datetime :content_datetime
54
+ t.timestamps
55
+ end
56
+ add_index :cms_blocks, [:cms_page_id, :label], :unique => true
57
+ add_index :cms_blocks, [:cms_page_id, :label, :content_string], :unique => true
58
+ add_index :cms_blocks, [:cms_page_id, :label, :content_integer], :unique => true
59
+ add_index :cms_blocks, [:cms_page_id, :label, :content_boolean], :unique => true
60
+ add_index :cms_blocks, [:cms_page_id, :label, :content_datetime], :unique => true
61
+
62
+
63
+ create_table :cms_attachments do |t|
64
+ t.string :file_file_name
65
+ t.string :file_content_type
66
+ t.string :file_file_size
67
+ t.string :label
68
+ t.text :description
69
+ t.timestamps
70
+ end
71
+ add_index :cms_attachments, :created_at
72
+ add_index :cms_attachments, :file_content_type
73
+ add_index :cms_attachments, [:file_content_type, :created_at]
74
+
75
+
76
+ create_table :cms_categories do |t|
77
+ t.integer :parent_id
78
+ t.string :slug
79
+ t.string :label
80
+ t.text :description
81
+ end
82
+ add_index :cms_categories, :slug
83
+ add_index :cms_categories, [:parent_id, :slug]
84
+
85
+
86
+ create_table :cms_page_categorizations do |t|
87
+ t.integer :cms_category_id
88
+ t.integer :cms_page_id
89
+ end
90
+ add_index :cms_page_categorizations, [:cms_category_id, :cms_page_id], :unique => true,
91
+ :name => 'index_page_categorizations_on_category_id_and_page_id' #auto-generated name was too long.
92
+
93
+
94
+ create_table :cms_attachment_categorizations do |t|
95
+ t.integer :cms_category_id
96
+ t.integer :cms_attachment_id
97
+ end
98
+ add_index :cms_attachment_categorizations, [:cms_category_id, :cms_attachment_id], :unique => true,
99
+ :name => 'index_attach_categorizations_on_category_id_and_attachment_id' #auto-generated name was too long.
100
+
101
+ end
102
+
103
+ def self.down
104
+ drop_table :cms_layouts
105
+ drop_table :cms_pages
106
+ drop_table :cms_snippets
107
+ drop_table :cms_blocks
108
+ drop_table :cms_attachments
109
+ drop_table :cms_categories
110
+ drop_table :cms_page_categorizations
111
+ drop_table :cms_attachment_categorizations
112
+ end
113
+ end
@@ -0,0 +1,414 @@
1
+ // -------------------------------------------------------------------- Reset
2
+ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td
3
+ margin: 0
4
+ padding: 0
5
+ border: 0
6
+ outline: 0
7
+ font-size: 100%
8
+ vertical-align: baseline
9
+ background: transparent
10
+ font-weight: normal
11
+ body
12
+ line-height: 1
13
+ ol, ul
14
+ list-style: none
15
+ blockquote, q
16
+ quotes: none
17
+ blockquote:before, blockquote:after, q:before, q:after
18
+ content: ''
19
+ content: none
20
+ *:focus
21
+ outline: 0
22
+ ins
23
+ text-decoration: none
24
+ del
25
+ text-decoration: line-through
26
+ table
27
+ border-collapse: collapse
28
+ border-spacing: 0
29
+ caption, th
30
+ text-align: left
31
+
32
+ // --------------------------------------------------------------- Typography
33
+ body
34
+ font: 13px Tahoma, "Lucida Grande", arial, verdana, clean, sans-serif
35
+ _font-size: small
36
+ _font: x-small
37
+ table
38
+ font-size: inherit
39
+ font: 100%
40
+ th
41
+ font-weight: bold
42
+ pre, code
43
+ font: 115% monospace
44
+ _font-size: 100%
45
+
46
+ a
47
+ color: #1F6FBA
48
+ text-decoration: none
49
+ a:hover
50
+ text-decoration: underline
51
+
52
+ h2
53
+ font: 20px/30px Georgia, serif
54
+ margin-bottom: 15px
55
+ border-bottom: 2px solid #444
56
+
57
+ // ------------------------------------------------------------------- Common
58
+ a.big_button
59
+ float: right
60
+ background-color: #404040
61
+ color: #fff
62
+ text-decoration: none
63
+ padding: 0px 10px
64
+ -moz-border-radius: 4px
65
+ font: 12px/24px Tahoma, "Lucida Grande", sans-serif
66
+
67
+ .filter_form
68
+ float: right
69
+ margin-bottom: 15px
70
+
71
+ // ---------------------------------------------------------------- Structure
72
+ body
73
+ background-color: #292E35
74
+ .header
75
+ height: 45px
76
+ background-color: #292E35
77
+ padding: 0px 15px
78
+ h1
79
+ padding: 0px
80
+ margin: 0px
81
+ a
82
+ display: block
83
+ background: url(/images/cms/logo.png) left center no-repeat
84
+ padding-left: 60px
85
+ font: 18px/45px Georgia, serif
86
+ color: #fff
87
+ text-decoration: none
88
+ .content_wrapper
89
+ overflow: hidden
90
+ background: #d4d4d4
91
+ .left_navigation_column
92
+ width: 145px
93
+ padding: 5px 0px 5px 5px
94
+ float: left
95
+ .content_column
96
+ background-color: #fff
97
+ margin-left: 150px
98
+ padding: 15px
99
+ border-left: 1px solid #aaa
100
+ overflow: hidden
101
+ min-height: 300px
102
+ .flash.notice
103
+ padding: 10px
104
+ text-align: center
105
+ background-color: #2E9442
106
+ color: #fff
107
+ margin-bottom: 15px
108
+ font-size: 16px
109
+ .footer
110
+ padding: 15px
111
+ color: #fff
112
+
113
+ // -------------------------------------------------------------- Left Column
114
+ .left_navigation_column
115
+ ul
116
+ -moz-border-radius-topleft: 4px
117
+ -moz-border-radius-bottomleft: 4px
118
+ margin-bottom: 5px
119
+ padding: 5px 0px
120
+ background-color: #545B66
121
+ li
122
+ a
123
+ display: block
124
+ padding: 5px 10px
125
+ font: 13px Georgia, serif
126
+ color: #fff
127
+ border: 1px solid transparent
128
+ a.active, a:hover
129
+ text-decoration: none
130
+ background-color: #fff
131
+ -moz-border-radius-topleft: 4px
132
+ -moz-border-radius-bottomleft: 4px
133
+ border: 1px solid #aaa
134
+ border-right: none
135
+ margin-right: -1px
136
+ margin-left: 5px
137
+ padding-left: 5px
138
+ color: #000
139
+ a:hover
140
+ color: #fff
141
+ background-color: transparent
142
+ border-style: dotted
143
+ border-right: none
144
+ a.active:hover
145
+ border-color: #aaa
146
+ background-color: #fff
147
+ color: #000
148
+ // ----------------------------------------------------------- Tree Structure
149
+ .tree_structure
150
+ ul
151
+ li
152
+ margin-left: 35px
153
+ border-top: 1px solid #eee
154
+
155
+ a.tree_toggle
156
+ margin-top: 5px
157
+ width: 20px
158
+ height: 28px
159
+ float: left
160
+ margin-left: -35px
161
+ font: 10px/25px Arial, sans-serif
162
+ background: url(/images/cms/arrow_bottom.gif) right center no-repeat
163
+ padding-right: 15px
164
+ color: #ccc
165
+ text-align: right
166
+ a.tree_toggle.closed
167
+ background-image: url(/images/cms/arrow_right.gif)
168
+ a.tree_toggle:hover
169
+ text-decoration: none
170
+ color: #000
171
+
172
+ .item
173
+ padding: 5px 0px 5px 35px
174
+ overflow: hidden
175
+
176
+ .icon
177
+ margin-left: -35px
178
+ float: left
179
+ width: 28px
180
+ height: 28px
181
+ background: url(/images/cms/icon_draft.gif)
182
+ .dragger
183
+ width: 28px
184
+ height: 28px
185
+ cursor: move
186
+ .dragger:hover
187
+ background: url(/images/cms/icon_move.gif)
188
+
189
+ a.label
190
+ font: 14px Georgia, serif
191
+ color: #000
192
+ .url
193
+ font-size: 10px
194
+
195
+ .action_links
196
+ visibility: hidden
197
+ font-size: 10px
198
+
199
+ table.details
200
+ font-size: 10px
201
+ margin: 5px 15px
202
+ border-left: 3px solid #ccc
203
+ th
204
+ padding: 0px 5px 0px 10px
205
+ font-weight: normal
206
+
207
+ .item:hover
208
+ background-color: #f5f5f5
209
+ .action_links
210
+ visibility: visible
211
+
212
+ // ---------------------------------------------------------- Formatted Table
213
+ table.formatted
214
+ width: 100%
215
+ margin-bottom: 15px
216
+ th, td
217
+ padding: 5px
218
+ vertical-align: top
219
+ border-bottom: 1px solid #eee
220
+ th
221
+ background-color: #eee
222
+ font-size: 10px
223
+ text-transform: uppercase
224
+ border-bottom: 1px solid #444
225
+ td.main, th.main
226
+ width: 100%
227
+ white-space: normal
228
+ td, th
229
+ white-space: nowrap
230
+ th.first
231
+ -moz-border-radius-topleft: 4px
232
+ th.last
233
+ -moz-border-radius-topright: 4px
234
+ tr:hover
235
+ background-color: #f5f5f5
236
+
237
+ // -------------------------------------------------------------------- Forms
238
+ .form_element_group
239
+ background-color: #e5e5e5
240
+ -moz-border-radius: 4px
241
+ -moz-box-shadow: 1px 1px 2px 2px #aaa
242
+ padding: 10px
243
+ margin-bottom: 15px
244
+ .form_element
245
+ margin-bottom: 5px
246
+ overflow: hidden
247
+ .label
248
+ text-transform: uppercase
249
+ font-size: 11px
250
+ .field
251
+ input, select, textarea
252
+ width: 100%
253
+ .codemirror
254
+ background-color: #fff
255
+ border: 1px inset #e5e5e5
256
+ .fieldWithErrors label
257
+ color: #9E0B0F
258
+ .form_element.time, .form_element.date, .form_element.checkbox
259
+ select, input
260
+ width: auto
261
+
262
+ .form_element_group.horizontal
263
+ .form_element
264
+ .label
265
+ width: 90px
266
+ float: left
267
+ text-align: right
268
+ line-height: 20px
269
+ .field
270
+ margin-left: 100px
271
+ .form_element.large
272
+ label
273
+ font-size: 16px
274
+ line-height: 26px
275
+ .field
276
+ input
277
+ font-size: 16px
278
+
279
+ .form_element_group.publishing
280
+ .form_element .field
281
+ input
282
+ width: 200px
283
+
284
+ .form_element_group.categories
285
+ .label
286
+ border-bottom: 2px solid #fff
287
+ padding-bottom: 5px
288
+ margin-bottom: 5px
289
+ ul#root_categories
290
+ margin-bottom: 10px
291
+ li li
292
+ padding-left: 15px
293
+ input
294
+ width: auto
295
+ #new_category
296
+ input, select
297
+ margin-bottom: 5px
298
+ input.submit_button
299
+ width: auto
300
+
301
+ .form_left_column
302
+ margin-right: 265px
303
+ .form_right_column
304
+ float: right
305
+ width: 250px
306
+
307
+ form
308
+ .errorExplanation
309
+ background-color: #9E0B0F
310
+ padding: 10px
311
+ margin-bottom: 15px
312
+ color: #fff
313
+ -moz-border-radius: 4px
314
+ font-size: 12px
315
+ h2
316
+ padding: 0px 5px
317
+ margin: -5px -5px 5px -5px
318
+ -moz-border-radius: 4px
319
+ background-color: #000
320
+ font-size: 16px
321
+ border: none
322
+
323
+ // --------------------------------------------------------------- Pagination
324
+ .pagination
325
+ margin-bottom: 15px
326
+ float: right
327
+ a, span
328
+ background: #404040
329
+ color: #fff
330
+ padding: 2px 5px
331
+ font-size: 11px
332
+ -moz-border-radius: 2px
333
+ a:hover
334
+ text-decoration: none
335
+ span.disabled
336
+ display: none
337
+ span.current
338
+ background-color: #999
339
+
340
+ // ------------------------------------------------------------------ Layouts
341
+ #cms_admin_layouts_index
342
+ .icon
343
+ background-image: url(/images/cms/icon_layout.gif)
344
+
345
+ // --------------------------------------------------------------- Categories
346
+ #cms_admin_categories_index
347
+ .icon
348
+ background-image: url(/images/cms/icon_category.gif)
349
+ .categorizations
350
+ font-size: 10px
351
+ #cms_admin_categories_show
352
+ h3
353
+ font-size: 12px
354
+ text-transform: uppercase
355
+ border-bottom: 1px solid #ccc
356
+ color: #ccc
357
+ margin-bottom: 15px
358
+ .pages, .attachments
359
+ margin-bottom: 15px
360
+ overflow: hidden
361
+ a.page, a.attachment
362
+ width: 150px
363
+ float: left
364
+ height: 30px
365
+ padding-left: 35px
366
+ font: 14px/30px Georgia, serif
367
+ color: #000
368
+ margin: 0px 5px 5px 0px
369
+ a.page
370
+ background: url(/images/cms/icon_regular.gif) left center no-repeat
371
+ a.attachment
372
+ background: url(/images/cms/icon_attachment.gif) left center no-repeat
373
+ // -------------------------------------------------------------------- Pages
374
+ #cms_admin_pages_index
375
+ .icon.published
376
+ background-image: url(/images/cms/icon_regular.gif)
377
+
378
+ // ----------------------------------------------------------------- Snippets
379
+ #cms_admin_snippets_index
380
+ a.label
381
+ font: 14px Georgia, serif
382
+ color: #000
383
+ a.slug
384
+ font-size: 10px
385
+ .icon
386
+ width: 28px
387
+ height: 28px
388
+ background: url(/images/cms/icon_snippet.gif)
389
+
390
+ // -------------------------------------------------------------- Attachments
391
+ #cms_admin_attachments_index
392
+ a.label
393
+ font: 14px Georgia, serif
394
+ color: #000
395
+ a.url
396
+ font-size: 10px
397
+ .icon
398
+ width: 28px
399
+ height: 28px
400
+ background: url(/images/cms/icon_attachment.gif)
401
+
402
+ // ----------------------------------------------------------------- Sections
403
+ #cms_admin_sections_show
404
+ a.label
405
+ font: 14px Georgia, serif
406
+ color: #000
407
+ a.url
408
+ font-size: 10px
409
+ .icon
410
+ width: 28px
411
+ height: 28px
412
+ background: url(/images/cms/icon_draft.gif)
413
+ .icon.published
414
+ background-image: url(/images/cms/icon_regular.gif)