comfortable_mexican_sofa 0.0.18 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -8
- data/Gemfile +11 -0
- data/Gemfile.lock +91 -0
- data/README.md +4 -0
- data/Rakefile +28 -57
- data/VERSION +1 -1
- data/app/controllers/application_controller.rb +5 -0
- data/app/controllers/cms_admin/base_controller.rb +1 -21
- data/app/controllers/cms_admin/layouts_controller.rb +23 -38
- data/app/controllers/cms_admin/pages_controller.rb +24 -40
- data/app/controllers/cms_admin/snippets_controller.rb +26 -34
- data/app/controllers/cms_admin/uploads_controller.rb +27 -0
- data/app/controllers/cms_content_controller.rb +22 -19
- data/app/models/cms_block.rb +20 -6
- data/app/models/cms_layout.rb +34 -80
- data/app/models/cms_page.rb +44 -102
- data/app/models/cms_snippet.rb +12 -7
- data/app/models/cms_upload.rb +36 -0
- data/app/views/cms_admin/layouts/_form.html.erb +6 -0
- data/app/views/cms_admin/layouts/_index_branch.html.erb +24 -0
- data/app/views/cms_admin/layouts/edit.html.erb +6 -0
- data/app/views/cms_admin/layouts/index.html.erb +6 -0
- data/app/views/cms_admin/layouts/new.html.erb +6 -0
- data/app/views/cms_admin/pages/_form.html.erb +14 -0
- data/app/views/cms_admin/pages/_form_blocks.html.erb +7 -0
- data/app/views/cms_admin/pages/_index_branch.html.erb +27 -0
- data/app/views/cms_admin/pages/edit.html.erb +6 -0
- data/app/views/cms_admin/pages/form_blocks.js.erb +1 -0
- data/app/views/cms_admin/pages/index.html.erb +6 -0
- data/app/views/cms_admin/pages/new.html.erb +6 -0
- data/app/views/cms_admin/snippets/_form.html.erb +2 -0
- data/app/views/cms_admin/snippets/edit.html.erb +6 -0
- data/app/views/cms_admin/snippets/index.html.erb +3 -0
- data/app/views/cms_admin/snippets/new.html.erb +6 -0
- data/app/views/cms_admin/uploads/_index.html.erb +8 -0
- data/app/views/cms_admin/uploads/_upload.html.erb +11 -0
- data/app/views/cms_admin/uploads/destroy.js.erb +3 -0
- data/app/views/cms_admin/uploads/index.html.erb +2 -0
- data/app/views/layouts/cms_admin.html.erb +36 -0
- data/comfortable_mexican_sofa.gemspec +141 -197
- data/config.ru +4 -0
- data/config/application.rb +44 -0
- data/config/boot.rb +13 -0
- data/{test/rails_root/config → config}/database.yml +0 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +22 -0
- data/config/environments/production.rb +49 -0
- data/config/environments/test.rb +35 -0
- data/{test/rails_root/config → config}/initializers/backtrace_silencers.rb +2 -2
- data/{test/rails_root/config → config}/initializers/inflections.rb +1 -1
- data/{test/rails_root/config → config}/initializers/mime_types.rb +0 -0
- data/config/initializers/paperclip.rb +3 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/{test/rails_root/config → config}/locales/en.yml +1 -1
- data/config/routes.rb +20 -0
- data/db/migrate/01_create_cms.rb +73 -0
- data/db/seeds.rb +7 -0
- data/doc/README_FOR_APP +95 -0
- data/lib/comfortable_mexican_sofa.rb +34 -39
- data/lib/comfortable_mexican_sofa/cms_acts_as_tree.rb +42 -49
- data/lib/comfortable_mexican_sofa/cms_form_builder.rb +107 -0
- data/lib/comfortable_mexican_sofa/cms_rails_extensions.rb +25 -5
- data/lib/comfortable_mexican_sofa/cms_tag.rb +90 -85
- data/lib/comfortable_mexican_sofa/cms_tag/field_datetime.rb +26 -0
- data/lib/comfortable_mexican_sofa/cms_tag/field_integer.rb +26 -0
- data/lib/comfortable_mexican_sofa/cms_tag/field_string.rb +26 -0
- data/lib/comfortable_mexican_sofa/cms_tag/field_text.rb +26 -0
- data/lib/comfortable_mexican_sofa/cms_tag/page_datetime.rb +22 -0
- data/lib/comfortable_mexican_sofa/cms_tag/page_integer.rb +22 -0
- data/lib/comfortable_mexican_sofa/cms_tag/page_string.rb +22 -0
- data/lib/comfortable_mexican_sofa/cms_tag/page_text.rb +22 -0
- data/lib/comfortable_mexican_sofa/cms_tag/partial.rb +20 -0
- data/lib/comfortable_mexican_sofa/cms_tag/snippet.rb +18 -0
- data/{generators/cms/templates → lib/generators}/README +0 -20
- data/lib/generators/cms_generator.rb +28 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/{test/rails_root/public → public}/favicon.ico +0 -0
- data/public/images/comfortable_mexican_sofa/body_bg.jpg +0 -0
- data/{generators/cms/templates/images → public/images/comfortable_mexican_sofa}/icon_regular.gif +0 -0
- data/public/javascripts/comfortable_mexican_sofa/cms.js +53 -0
- data/public/javascripts/comfortable_mexican_sofa/jquery-ui.js +325 -0
- data/public/javascripts/comfortable_mexican_sofa/jquery.js +154 -0
- data/public/javascripts/comfortable_mexican_sofa/plupload/plupload.full.min.js +1 -0
- data/public/javascripts/comfortable_mexican_sofa/plupload/plupload.html4.min.js +1 -0
- data/public/javascripts/comfortable_mexican_sofa/plupload/plupload.html5.min.js +1 -0
- data/public/javascripts/comfortable_mexican_sofa/rails.js +132 -0
- data/public/javascripts/comfortable_mexican_sofa/uploader.js +47 -0
- data/{test/rails_root/public → public}/robots.txt +0 -0
- data/public/stylesheets/comfortable_mexican_sofa/jquery-ui.css +305 -0
- data/public/stylesheets/comfortable_mexican_sofa/reset.css +1 -0
- data/public/stylesheets/comfortable_mexican_sofa/structure.css +194 -0
- data/public/stylesheets/comfortable_mexican_sofa/typography.css +20 -0
- data/script/rails +6 -0
- data/test/fixtures/README.md +22 -0
- data/test/fixtures/cms_blocks.yml +10 -34
- data/test/fixtures/cms_layouts.yml +37 -33
- data/test/fixtures/cms_pages.yml +11 -32
- data/test/fixtures/cms_snippets.yml +2 -6
- data/test/fixtures/cms_uploads.yml +4 -0
- data/test/fixtures/files/invalid_file.gif +9 -0
- data/test/fixtures/files/valid_image.jpg +0 -0
- data/test/functional/cms_admin/base_controller_test.rb +9 -0
- data/test/functional/cms_admin/layouts_controller_test.rb +61 -46
- data/test/functional/cms_admin/pages_controller_test.rb +201 -102
- data/test/functional/cms_admin/snippets_controller_test.rb +46 -39
- data/test/functional/cms_admin/uploads_controller_test.rb +32 -0
- data/test/functional/cms_content_controller_test.rb +37 -32
- data/test/test_helper.rb +29 -9
- data/test/unit/cms_block_test.rb +60 -0
- data/test/unit/cms_layout_test.rb +48 -0
- data/test/unit/cms_page_test.rb +122 -0
- data/test/unit/cms_snippet_test.rb +23 -0
- data/test/unit/cms_tag_test.rb +149 -0
- data/test/unit/cms_tags/field_datetime_test.rb +36 -0
- data/test/unit/cms_tags/field_integer_test.rb +35 -0
- data/test/unit/cms_tags/field_string_test.rb +35 -0
- data/test/unit/cms_tags/field_text_test.rb +34 -0
- data/test/unit/cms_tags/page_datetime_test.rb +36 -0
- data/test/unit/cms_tags/page_integer_test.rb +35 -0
- data/test/unit/cms_tags/page_string_test.rb +35 -0
- data/test/unit/cms_tags/page_text_test.rb +36 -0
- data/test/unit/cms_tags/partial_test.rb +30 -0
- data/test/unit/cms_tags/snippet_test.rb +34 -0
- data/test/unit/cms_upload_test.rb +30 -0
- metadata +176 -215
- data/CHANGELOG.rdoc +0 -2
- data/LICENSE +0 -20
- data/README.rdoc +0 -55
- data/app/controllers/cms_admin/attachments_controller.rb +0 -55
- data/app/controllers/cms_admin/categories_controller.rb +0 -69
- data/app/controllers/cms_admin/sections_controller.rb +0 -17
- data/app/controllers/cms_common/render_page.rb +0 -47
- data/app/helpers/cms_helper.rb +0 -12
- data/app/models/cms_attachment.rb +0 -17
- data/app/models/cms_attachment_categorization.rb +0 -5
- data/app/models/cms_category.rb +0 -36
- data/app/models/cms_page_categorization.rb +0 -6
- data/app/views/cms_admin/attachments/_details.html.haml +0 -27
- data/app/views/cms_admin/attachments/_form.html.haml +0 -24
- data/app/views/cms_admin/attachments/edit.html.haml +0 -10
- data/app/views/cms_admin/attachments/index.html.haml +0 -36
- data/app/views/cms_admin/attachments/new.html.haml +0 -8
- data/app/views/cms_admin/categories/_category.html.haml +0 -21
- data/app/views/cms_admin/categories/_category_subform.html.haml +0 -12
- data/app/views/cms_admin/categories/_form.html.haml +0 -18
- data/app/views/cms_admin/categories/_new.html.haml +0 -7
- data/app/views/cms_admin/categories/_toggle_link.html.haml +0 -9
- data/app/views/cms_admin/categories/_tree_branch.html.haml +0 -36
- data/app/views/cms_admin/categories/children.js.rjs +0 -10
- data/app/views/cms_admin/categories/create.js.rjs +0 -9
- data/app/views/cms_admin/categories/edit.html.haml +0 -10
- data/app/views/cms_admin/categories/index.html.haml +0 -7
- data/app/views/cms_admin/categories/new.html.haml +0 -8
- data/app/views/cms_admin/categories/show.html.haml +0 -17
- data/app/views/cms_admin/layouts/_details.html.haml +0 -6
- data/app/views/cms_admin/layouts/_form.html.haml +0 -19
- data/app/views/cms_admin/layouts/_toggle_link.html.haml +0 -9
- data/app/views/cms_admin/layouts/_tree_branch.html.haml +0 -39
- data/app/views/cms_admin/layouts/children.js.rjs +0 -10
- data/app/views/cms_admin/layouts/edit.html.haml +0 -10
- data/app/views/cms_admin/layouts/index.html.haml +0 -7
- data/app/views/cms_admin/layouts/new.html.haml +0 -8
- data/app/views/cms_admin/pages/_details.html.haml +0 -25
- data/app/views/cms_admin/pages/_form.html.haml +0 -45
- data/app/views/cms_admin/pages/_form_blocks.html.haml +0 -48
- data/app/views/cms_admin/pages/_toggle_link.html.haml +0 -10
- data/app/views/cms_admin/pages/_tree_branch.html.haml +0 -41
- data/app/views/cms_admin/pages/children.js.rjs +0 -10
- data/app/views/cms_admin/pages/edit.html.haml +0 -11
- data/app/views/cms_admin/pages/form_blocks.js.rjs +0 -1
- data/app/views/cms_admin/pages/index.html.haml +0 -6
- data/app/views/cms_admin/pages/new.html.haml +0 -9
- data/app/views/cms_admin/sections/show.html.haml +0 -23
- data/app/views/cms_admin/snippets/_form.html.haml +0 -10
- data/app/views/cms_admin/snippets/edit.html.haml +0 -10
- data/app/views/cms_admin/snippets/index.html.haml +0 -26
- data/app/views/cms_admin/snippets/new.html.haml +0 -8
- data/app/views/cms_content/show.xml.rxml +0 -27
- data/app/views/cms_content/sitemap.xml.rxml +0 -16
- data/app/views/layouts/cms_admin.html.haml +0 -44
- data/config/cms_routes.rb +0 -25
- data/generators/cms/cms_generator.rb +0 -55
- data/generators/cms/templates/images/arrow_bottom.gif +0 -0
- data/generators/cms/templates/images/arrow_right.gif +0 -0
- data/generators/cms/templates/images/icon_attachment.gif +0 -0
- data/generators/cms/templates/images/icon_category.gif +0 -0
- data/generators/cms/templates/images/icon_draft.gif +0 -0
- data/generators/cms/templates/images/icon_layout.gif +0 -0
- data/generators/cms/templates/images/icon_move.gif +0 -0
- data/generators/cms/templates/images/icon_snippet.gif +0 -0
- data/generators/cms/templates/images/logo.png +0 -0
- data/generators/cms/templates/initializers/cms.rb +0 -14
- data/generators/cms/templates/initializers/paperclip.rb +0 -14
- data/generators/cms/templates/javascripts/codemirror_init.js +0 -16
- data/generators/cms/templates/javascripts/mce_init.js +0 -17
- data/generators/cms/templates/javascripts/utilities.js +0 -27
- data/generators/cms/templates/migrations/create_cms.rb +0 -113
- data/generators/cms/templates/stylesheets/cms_master.sass +0 -414
- data/init.rb +0 -1
- data/lib/comfortable_mexican_sofa/acts_as_categorized.rb +0 -87
- data/lib/comfortable_mexican_sofa/acts_as_published.rb +0 -60
- data/lib/comfortable_mexican_sofa/cms_tags/attachment.rb +0 -3
- data/lib/comfortable_mexican_sofa/cms_tags/block.rb +0 -117
- data/lib/comfortable_mexican_sofa/cms_tags/helper.rb +0 -3
- data/lib/comfortable_mexican_sofa/cms_tags/page_block.rb +0 -119
- data/lib/comfortable_mexican_sofa/cms_tags/partial.rb +0 -19
- data/lib/comfortable_mexican_sofa/cms_tags/snippet.rb +0 -19
- data/rails/init.rb +0 -1
- data/test/fixtures/cms_attachment_categorizations.yml +0 -7
- data/test/fixtures/cms_attachments.yml +0 -6
- data/test/fixtures/cms_categories.yml +0 -19
- data/test/fixtures/cms_page_categorizations.yml +0 -15
- data/test/fixtures/files/upload_file.txt +0 -1
- data/test/functional/cms_admin/attachments_controller_test.rb +0 -63
- data/test/functional/cms_admin/categories_controller_test.rb +0 -86
- data/test/functional/cms_admin/sections_controller_test.rb +0 -9
- data/test/models/cms_attachment_test.rb +0 -16
- data/test/models/cms_block_test.rb +0 -11
- data/test/models/cms_categorization_test.rb +0 -39
- data/test/models/cms_category_test.rb +0 -71
- data/test/models/cms_layout_test.rb +0 -44
- data/test/models/cms_page_test.rb +0 -55
- data/test/models/cms_snippet_test.rb +0 -16
- data/test/models/cms_tag_test.rb +0 -70
- data/test/rails_root/README +0 -243
- data/test/rails_root/Rakefile +0 -10
- data/test/rails_root/app/controllers/application_controller.rb +0 -10
- data/test/rails_root/app/helpers/application_helper.rb +0 -3
- data/test/rails_root/app/views/cms/under-development.html.haml +0 -1
- data/test/rails_root/app/views/complex_page/_example.html.erb +0 -1
- data/test/rails_root/config/boot.rb +0 -110
- data/test/rails_root/config/environment.rb +0 -48
- data/test/rails_root/config/environments/development.rb +0 -17
- data/test/rails_root/config/environments/production.rb +0 -28
- data/test/rails_root/config/environments/test.rb +0 -28
- data/test/rails_root/config/initializers/new_rails_defaults.rb +0 -19
- data/test/rails_root/config/initializers/session_store.rb +0 -15
- data/test/rails_root/config/routes.rb +0 -43
- data/test/rails_root/doc/README_FOR_APP +0 -2
- data/test/rails_root/public/404.html +0 -30
- data/test/rails_root/public/422.html +0 -30
- data/test/rails_root/public/500.html +0 -30
- data/test/rails_root/public/images/rails.png +0 -0
- data/test/rails_root/public/index.html +0 -275
- data/test/rails_root/public/javascripts/application.js +0 -2
- data/test/rails_root/public/javascripts/controls.js +0 -963
- data/test/rails_root/public/javascripts/dragdrop.js +0 -973
- data/test/rails_root/public/javascripts/effects.js +0 -1128
- data/test/rails_root/public/javascripts/prototype.js +0 -4320
- data/test/rails_root/public/stylesheets/sass/cms_master.sass +0 -414
- data/test/rails_root/script/about +0 -4
- data/test/rails_root/script/console +0 -3
- data/test/rails_root/script/dbconsole +0 -3
- data/test/rails_root/script/destroy +0 -3
- data/test/rails_root/script/generate +0 -3
- data/test/rails_root/script/performance/benchmarker +0 -3
- data/test/rails_root/script/performance/profiler +0 -3
- data/test/rails_root/script/plugin +0 -3
- data/test/rails_root/script/runner +0 -3
- data/test/rails_root/script/server +0 -3
data/.gitignore
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
+
.bundle
|
2
|
+
db/*.sqlite3
|
3
|
+
log/*.log
|
4
|
+
tmp/**/*
|
1
5
|
.DS_Store
|
6
|
+
db/schema.rb
|
7
|
+
db/development_structure.sql
|
8
|
+
public/system/*
|
2
9
|
pkg
|
3
|
-
rdoc
|
4
|
-
test/rails_root/db
|
5
|
-
test/rails_root/log
|
6
|
-
test/rails_root/vendor
|
7
|
-
test/rails_root/config/initializers/paperclip.rb
|
8
|
-
test/rails_root/public/javascripts/cms_mce_init.js
|
9
|
-
test/rails_root/public/javascripts/cms_codemirror_init.js
|
10
|
-
test/rails_root/public/javascripts/cms_utilities.js
|
10
|
+
rdoc
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '3.0.0'
|
4
|
+
gem 'sqlite3-ruby', :require => 'sqlite3'
|
5
|
+
gem 'active_link_to', '>=0.0.6'
|
6
|
+
gem 'paperclip', '>=2.3.3'
|
7
|
+
gem 'mime-types', :require => 'mime/types'
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem 'jeweler', '>=1.4.0'
|
11
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.0)
|
6
|
+
actionpack (= 3.0.0)
|
7
|
+
mail (~> 2.2.5)
|
8
|
+
actionpack (3.0.0)
|
9
|
+
activemodel (= 3.0.0)
|
10
|
+
activesupport (= 3.0.0)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.4.1)
|
14
|
+
rack (~> 1.2.1)
|
15
|
+
rack-mount (~> 0.6.12)
|
16
|
+
rack-test (~> 0.5.4)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
active_link_to (0.0.6)
|
19
|
+
activemodel (3.0.0)
|
20
|
+
activesupport (= 3.0.0)
|
21
|
+
builder (~> 2.1.2)
|
22
|
+
i18n (~> 0.4.1)
|
23
|
+
activerecord (3.0.0)
|
24
|
+
activemodel (= 3.0.0)
|
25
|
+
activesupport (= 3.0.0)
|
26
|
+
arel (~> 1.0.0)
|
27
|
+
tzinfo (~> 0.3.23)
|
28
|
+
activeresource (3.0.0)
|
29
|
+
activemodel (= 3.0.0)
|
30
|
+
activesupport (= 3.0.0)
|
31
|
+
activesupport (3.0.0)
|
32
|
+
arel (1.0.1)
|
33
|
+
activesupport (~> 3.0.0)
|
34
|
+
builder (2.1.2)
|
35
|
+
erubis (2.6.6)
|
36
|
+
abstract (>= 1.0.0)
|
37
|
+
gemcutter (0.5.0)
|
38
|
+
json_pure
|
39
|
+
git (1.2.5)
|
40
|
+
i18n (0.4.1)
|
41
|
+
jeweler (1.4.0)
|
42
|
+
gemcutter (>= 0.1.0)
|
43
|
+
git (>= 1.2.5)
|
44
|
+
rubyforge (>= 2.0.0)
|
45
|
+
json_pure (1.4.6)
|
46
|
+
mail (2.2.5)
|
47
|
+
activesupport (>= 2.3.6)
|
48
|
+
mime-types
|
49
|
+
treetop (>= 1.4.5)
|
50
|
+
mime-types (1.16)
|
51
|
+
paperclip (2.3.3)
|
52
|
+
activerecord
|
53
|
+
activesupport
|
54
|
+
polyglot (0.3.1)
|
55
|
+
rack (1.2.1)
|
56
|
+
rack-mount (0.6.13)
|
57
|
+
rack (>= 1.0.0)
|
58
|
+
rack-test (0.5.4)
|
59
|
+
rack (>= 1.0)
|
60
|
+
rails (3.0.0)
|
61
|
+
actionmailer (= 3.0.0)
|
62
|
+
actionpack (= 3.0.0)
|
63
|
+
activerecord (= 3.0.0)
|
64
|
+
activeresource (= 3.0.0)
|
65
|
+
activesupport (= 3.0.0)
|
66
|
+
bundler (~> 1.0.0)
|
67
|
+
railties (= 3.0.0)
|
68
|
+
railties (3.0.0)
|
69
|
+
actionpack (= 3.0.0)
|
70
|
+
activesupport (= 3.0.0)
|
71
|
+
rake (>= 0.8.4)
|
72
|
+
thor (~> 0.14.0)
|
73
|
+
rake (0.8.7)
|
74
|
+
rubyforge (2.0.4)
|
75
|
+
json_pure (>= 1.1.7)
|
76
|
+
sqlite3-ruby (1.3.1)
|
77
|
+
thor (0.14.0)
|
78
|
+
treetop (1.4.8)
|
79
|
+
polyglot (>= 0.3.1)
|
80
|
+
tzinfo (0.3.23)
|
81
|
+
|
82
|
+
PLATFORMS
|
83
|
+
ruby
|
84
|
+
|
85
|
+
DEPENDENCIES
|
86
|
+
active_link_to (>= 0.0.6)
|
87
|
+
jeweler (>= 1.4.0)
|
88
|
+
mime-types
|
89
|
+
paperclip (>= 2.3.3)
|
90
|
+
rails (= 3.0.0)
|
91
|
+
sqlite3-ruby
|
data/README.md
ADDED
data/Rakefile
CHANGED
@@ -1,88 +1,59 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
1
5
|
require 'rubygems'
|
2
6
|
require 'rake'
|
3
7
|
|
8
|
+
ComfortableMexicanSofa::Application.load_tasks
|
4
9
|
|
5
10
|
begin
|
6
11
|
require 'jeweler'
|
7
12
|
Jeweler::Tasks.new do |gem|
|
8
|
-
gem.name
|
9
|
-
gem.summary
|
13
|
+
gem.name = 'comfortable_mexican_sofa'
|
14
|
+
gem.summary = 'ComfortableMexicanSofa is a Rails Engine CMS gem'
|
10
15
|
gem.description = ''
|
11
|
-
gem.email
|
12
|
-
gem.homepage
|
13
|
-
gem.authors
|
14
|
-
|
15
|
-
gem.
|
16
|
-
gem.add_dependency('
|
17
|
-
gem.add_dependency('will_paginate')
|
18
|
-
gem.add_dependency('paperclip')
|
19
|
-
gem.add_dependency('calendar_date_select')
|
20
|
-
gem.add_dependency('active_link_to')
|
21
|
-
end
|
22
|
-
|
23
|
-
Jeweler::RubyforgeTasks.new do |rubyforge|
|
24
|
-
rubyforge.doc_task = "rdoc"
|
16
|
+
gem.email = 'oleg@theworkinggroup.ca'
|
17
|
+
gem.homepage = 'http://github.com/theworkinggroup/comfortable-mexican-sofa'
|
18
|
+
gem.authors = ['Oleg Khabarov', 'The Working Group Inc']
|
19
|
+
gem.add_dependency('rails', '>=3.0.0')
|
20
|
+
gem.add_dependency('active_link_to', '>=0.0.6')
|
21
|
+
gem.add_dependency('paperclip', '>=2.3.3')
|
25
22
|
end
|
26
|
-
|
27
23
|
Jeweler::GemcutterTasks.new
|
28
24
|
rescue LoadError
|
29
|
-
puts "Jeweler (or a dependency) not available. Install it with:
|
25
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
30
26
|
end
|
31
27
|
|
32
28
|
require 'rake/testtask'
|
33
29
|
Rake::TestTask.new(:test) do |test|
|
34
30
|
test.libs << 'lib' << 'test'
|
35
|
-
test.pattern = 'test
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
36
32
|
test.verbose = true
|
37
33
|
end
|
38
34
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
'test/rails_root/public/javascripts/cms',
|
46
|
-
'test/rails_root/public/images/cms',
|
47
|
-
'test/rails_root/tmp/',
|
48
|
-
'test/rails_root/public/blank_iframe.html',
|
49
|
-
'test/rails_root/public/images/calendar_date_select',
|
50
|
-
'test/rails_root/public/javascripts/calendar_date_select/',
|
51
|
-
'test/rails_root/public/stylesheets/calendar_date_select/',
|
52
|
-
'test/rails_root/public/stylesheets/cms_master.css',
|
53
|
-
'test/rails_root/config/initializers/cms.rb',
|
54
|
-
'test/rails_root/public/system/files/'
|
55
|
-
]
|
56
|
-
files.each do |file|
|
57
|
-
FileUtils.rm_rf(file)
|
58
|
-
end
|
35
|
+
begin
|
36
|
+
require 'rcov/rcovtask'
|
37
|
+
Rcov::RcovTask.new do |test|
|
38
|
+
test.libs << 'test'
|
39
|
+
test.pattern = 'test/**/test_*.rb'
|
40
|
+
test.verbose = true
|
59
41
|
end
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
plugin_root = File.expand_path(File.dirname(__FILE__))
|
64
|
-
system("ln -s #{plugin_root} test/rails_root/vendor/plugins/comfortable_mexican_sofa")
|
65
|
-
system "cd test/rails_root && ./script/generate cms && rake db:migrate db:test:prepare"
|
42
|
+
rescue LoadError
|
43
|
+
task :rcov do
|
44
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
66
45
|
end
|
67
46
|
end
|
68
47
|
|
69
|
-
desc "Run the test suite"
|
70
|
-
task :default => ['generator:cleanup', 'generator:prepare', :test]
|
71
48
|
task :test => :check_dependencies
|
72
|
-
task :
|
49
|
+
task :default => :test
|
73
50
|
|
74
51
|
require 'rake/rdoctask'
|
75
52
|
Rake::RDocTask.new do |rdoc|
|
76
|
-
|
77
|
-
version = File.read('VERSION')
|
78
|
-
else
|
79
|
-
version = ""
|
80
|
-
end
|
53
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
81
54
|
|
82
55
|
rdoc.rdoc_dir = 'rdoc'
|
83
|
-
rdoc.title = "
|
56
|
+
rdoc.title = "gem #{version}"
|
84
57
|
rdoc.rdoc_files.include('README*')
|
85
58
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
86
|
-
end
|
87
|
-
|
88
|
-
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
59
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
1.0.0
|
@@ -1,25 +1,5 @@
|
|
1
1
|
class CmsAdmin::BaseController < ApplicationController
|
2
2
|
|
3
|
-
before_filter :authenticate
|
4
|
-
|
5
3
|
layout 'cms_admin'
|
6
|
-
|
7
|
-
def manage_session_array(name, action, value)
|
8
|
-
session[name] = case action
|
9
|
-
when :add
|
10
|
-
(session[name] || []) + [value]
|
11
|
-
when :remove
|
12
|
-
(session[name] || []) - [value]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
protected
|
17
4
|
|
18
|
-
|
19
|
-
authenticate_or_request_with_http_basic do |username, password|
|
20
|
-
username == ComfortableMexicanSofa::Config.http_auth_username &&
|
21
|
-
password == ComfortableMexicanSofa::Config.http_auth_password
|
22
|
-
end if ComfortableMexicanSofa::Config.http_auth_enabled
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
5
|
+
end
|
@@ -1,71 +1,56 @@
|
|
1
1
|
class CmsAdmin::LayoutsController < CmsAdmin::BaseController
|
2
2
|
|
3
|
-
before_filter :
|
3
|
+
before_filter :build_cms_layout, :only => [:new, :create]
|
4
|
+
before_filter :load_cms_layout, :only => [:edit, :update, :destroy]
|
4
5
|
|
5
6
|
def index
|
6
|
-
@
|
7
|
-
end
|
8
|
-
|
9
|
-
def children
|
10
|
-
manage_session_array(:cms_layout_tree, (params[:state] == 'open' ? :remove : :add), params[:id])
|
7
|
+
@cms_layouts = CmsLayout.roots
|
11
8
|
end
|
12
9
|
|
13
10
|
def new
|
14
|
-
|
11
|
+
render
|
15
12
|
end
|
16
13
|
|
17
14
|
def edit
|
18
|
-
|
15
|
+
render
|
19
16
|
end
|
20
17
|
|
21
18
|
def create
|
22
|
-
@
|
23
|
-
@layout.save!
|
24
|
-
|
19
|
+
@cms_layout.save!
|
25
20
|
flash[:notice] = 'Layout created'
|
26
|
-
|
27
|
-
redirect_to :action => :edit, :id => @layout
|
28
|
-
|
21
|
+
redirect_to :action => :edit, :id => @cms_layout
|
29
22
|
rescue ActiveRecord::RecordInvalid
|
23
|
+
flash.now[:error] = 'Failed to create layout'
|
30
24
|
render :action => :new
|
31
25
|
end
|
32
26
|
|
33
27
|
def update
|
34
|
-
@
|
35
|
-
|
28
|
+
@cms_layout.update_attributes!(params[:cms_layout])
|
36
29
|
flash[:notice] = 'Layout updated'
|
37
|
-
redirect_to :action => :edit, :id => @
|
38
|
-
|
30
|
+
redirect_to :action => :edit, :id => @cms_layout
|
39
31
|
rescue ActiveRecord::RecordInvalid
|
32
|
+
flash.now[:error] = 'Failed to update layout'
|
40
33
|
render :action => :edit
|
41
34
|
end
|
42
35
|
|
43
36
|
def destroy
|
44
|
-
@
|
45
|
-
|
46
|
-
flash[:notice] = 'Layout removed'
|
37
|
+
@cms_layout.destroy
|
38
|
+
flash[:notice] = 'Layout deleted'
|
47
39
|
redirect_to :action => :index
|
48
40
|
end
|
49
41
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
layout_id = 0
|
56
|
-
find_scope = CmsLayout
|
57
|
-
end
|
58
|
-
|
59
|
-
params["layout_#{layout_id}_branch"].each_with_index do |id, position|
|
60
|
-
find_scope.find(id).update_attribute(:position, position)
|
61
|
-
end
|
62
|
-
render :nothing => true
|
42
|
+
protected
|
43
|
+
|
44
|
+
def build_cms_layout
|
45
|
+
@cms_layout = CmsLayout.new(params[:cms_layout])
|
46
|
+
@cms_layout.parent ||= CmsLayout.find_by_id(params[:parent_id])
|
63
47
|
end
|
64
48
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
49
|
+
def load_cms_layout
|
50
|
+
@cms_layout = CmsLayout.find(params[:id])
|
51
|
+
rescue ActiveRecord::RecordNotFound
|
52
|
+
flash[:error] = 'Layout not found'
|
53
|
+
redirect_to :action => :index
|
69
54
|
end
|
70
55
|
|
71
56
|
end
|
@@ -1,79 +1,63 @@
|
|
1
1
|
class CmsAdmin::PagesController < CmsAdmin::BaseController
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
before_filter :load_page, :only => [:children, :edit, :update, :destroy, :reorder]
|
3
|
+
before_filter :build_cms_page, :only => [:new, :create]
|
4
|
+
before_filter :load_cms_page, :only => [:edit, :update, :destroy]
|
6
5
|
|
7
6
|
def index
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
def children
|
12
|
-
manage_session_array(:cms_page_tree, (params[:state] == 'open' ? :remove : :add), params[:id])
|
7
|
+
@cms_pages = [CmsPage.root].compact
|
13
8
|
end
|
14
9
|
|
15
10
|
def new
|
16
|
-
|
17
|
-
@cms_page.published_at = Time.now.utc
|
18
|
-
@cms_page.cms_layout = @cms_page.parent.cms_layout if @cms_page.parent
|
11
|
+
render
|
19
12
|
end
|
20
13
|
|
21
14
|
def edit
|
22
|
-
|
15
|
+
render
|
23
16
|
end
|
24
17
|
|
25
18
|
def create
|
26
|
-
@cms_page = CmsPage.new(params[:cms_page])
|
27
|
-
|
28
|
-
return render_page if !params[:preview].blank? && @cms_page.valid?
|
29
|
-
|
30
19
|
@cms_page.save!
|
31
|
-
|
32
|
-
flash[:notice] = 'Page created'
|
33
|
-
manage_session_array(:cms_page_tree, :add, @cms_page.parent_id.to_s)
|
20
|
+
flash[:notice] = 'Page saved'
|
34
21
|
redirect_to :action => :edit, :id => @cms_page
|
35
|
-
|
36
22
|
rescue ActiveRecord::RecordInvalid
|
23
|
+
flash.now[:error] = 'Failed to create page'
|
37
24
|
render :action => :new
|
38
25
|
end
|
39
26
|
|
40
27
|
def update
|
41
|
-
@cms_page.
|
42
|
-
|
43
|
-
return render_page if !params[:preview].blank? && @cms_page.valid?
|
44
|
-
|
45
|
-
@cms_page.save!
|
46
|
-
|
28
|
+
@cms_page.update_attributes!(params[:cms_page])
|
47
29
|
flash[:notice] = 'Page updated'
|
48
30
|
redirect_to :action => :edit, :id => @cms_page
|
49
|
-
|
50
31
|
rescue ActiveRecord::RecordInvalid
|
32
|
+
flash.now[:error] = 'Failed to update page'
|
51
33
|
render :action => :edit
|
52
34
|
end
|
53
35
|
|
54
36
|
def destroy
|
55
37
|
@cms_page.destroy
|
56
|
-
|
57
|
-
flash[:notice] = 'Page removed'
|
38
|
+
flash[:notice] = 'Page deleted'
|
58
39
|
redirect_to :action => :index
|
59
40
|
end
|
60
41
|
|
61
42
|
def form_blocks
|
62
|
-
@cms_page = CmsPage.find_by_id(params[:id])
|
63
|
-
@
|
43
|
+
@cms_page = CmsPage.find_by_id(params[:id]) || CmsPage.new
|
44
|
+
@cms_page.cms_layout = CmsLayout.find_by_id(params[:layout_id])
|
64
45
|
end
|
65
46
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
47
|
+
protected
|
48
|
+
|
49
|
+
def build_cms_page
|
50
|
+
@cms_page = CmsPage.new(params[:cms_page])
|
51
|
+
@cms_page.parent ||= (CmsPage.find_by_id(params[:parent_id]) || CmsPage.root)
|
52
|
+
@cms_page.cms_layout ||= (@cms_page.parent && @cms_page.parent.cms_layout || CmsLayout.first)
|
71
53
|
end
|
72
54
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
55
|
+
def load_cms_page
|
56
|
+
@cms_page = CmsPage.find(params[:id])
|
57
|
+
@cms_page.cms_layout ||= (@cms_page.parent && @cms_page.parent.cms_layout || CmsLayout.first)
|
58
|
+
rescue ActiveRecord::RecordNotFound
|
59
|
+
flash[:error] = 'Page not found'
|
60
|
+
redirect_to :action => :index
|
77
61
|
end
|
78
62
|
|
79
63
|
end
|