comfortable_mexican_sofa 1.0.34 → 1.0.35

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '>=3.0.1'
3
+ gem 'rails', '>=3.0.3'
4
4
  gem 'sqlite3-ruby', :require => 'sqlite3'
5
5
  gem 'active_link_to', '>=0.0.6'
6
6
  gem 'paperclip', '>=2.3.5'
@@ -2,52 +2,50 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  abstract (1.0.0)
5
- actionmailer (3.0.1)
6
- actionpack (= 3.0.1)
7
- mail (~> 2.2.5)
8
- actionpack (3.0.1)
9
- activemodel (= 3.0.1)
10
- activesupport (= 3.0.1)
5
+ actionmailer (3.0.3)
6
+ actionpack (= 3.0.3)
7
+ mail (~> 2.2.9)
8
+ actionpack (3.0.3)
9
+ activemodel (= 3.0.3)
10
+ activesupport (= 3.0.3)
11
11
  builder (~> 2.1.2)
12
12
  erubis (~> 2.6.6)
13
- i18n (~> 0.4.1)
13
+ i18n (~> 0.4)
14
14
  rack (~> 1.2.1)
15
- rack-mount (~> 0.6.12)
16
- rack-test (~> 0.5.4)
15
+ rack-mount (~> 0.6.13)
16
+ rack-test (~> 0.5.6)
17
17
  tzinfo (~> 0.3.23)
18
18
  active_link_to (0.0.6)
19
- activemodel (3.0.1)
20
- activesupport (= 3.0.1)
19
+ activemodel (3.0.3)
20
+ activesupport (= 3.0.3)
21
21
  builder (~> 2.1.2)
22
- i18n (~> 0.4.1)
23
- activerecord (3.0.1)
24
- activemodel (= 3.0.1)
25
- activesupport (= 3.0.1)
26
- arel (~> 1.0.0)
22
+ i18n (~> 0.4)
23
+ activerecord (3.0.3)
24
+ activemodel (= 3.0.3)
25
+ activesupport (= 3.0.3)
26
+ arel (~> 2.0.2)
27
27
  tzinfo (~> 0.3.23)
28
- activeresource (3.0.1)
29
- activemodel (= 3.0.1)
30
- activesupport (= 3.0.1)
31
- activesupport (3.0.1)
32
- arel (1.0.1)
33
- activesupport (~> 3.0.0)
28
+ activeresource (3.0.3)
29
+ activemodel (= 3.0.3)
30
+ activesupport (= 3.0.3)
31
+ activesupport (3.0.3)
32
+ arel (2.0.6)
34
33
  builder (2.1.2)
35
34
  erubis (2.6.6)
36
35
  abstract (>= 1.0.0)
37
- gemcutter (0.6.1)
38
36
  git (1.2.5)
39
- i18n (0.4.1)
40
- jeweler (1.4.0)
41
- gemcutter (>= 0.1.0)
37
+ i18n (0.5.0)
38
+ jeweler (1.5.1)
39
+ bundler (~> 1.0.0)
42
40
  git (>= 1.2.5)
43
- rubyforge (>= 2.0.0)
44
- json_pure (1.4.6)
45
- mail (2.2.7)
41
+ rake
42
+ mail (2.2.12)
46
43
  activesupport (>= 2.3.6)
47
- mime-types
48
- treetop (>= 1.4.5)
44
+ i18n (>= 0.4.0)
45
+ mime-types (~> 1.16)
46
+ treetop (~> 1.4.8)
49
47
  mime-types (1.16)
50
- paperclip (2.3.5)
48
+ paperclip (2.3.8)
51
49
  activerecord
52
50
  activesupport
53
51
  polyglot (0.3.1)
@@ -56,25 +54,23 @@ GEM
56
54
  rack (>= 1.0.0)
57
55
  rack-test (0.5.6)
58
56
  rack (>= 1.0)
59
- rails (3.0.1)
60
- actionmailer (= 3.0.1)
61
- actionpack (= 3.0.1)
62
- activerecord (= 3.0.1)
63
- activeresource (= 3.0.1)
64
- activesupport (= 3.0.1)
65
- bundler (~> 1.0.0)
66
- railties (= 3.0.1)
67
- railties (3.0.1)
68
- actionpack (= 3.0.1)
69
- activesupport (= 3.0.1)
70
- rake (>= 0.8.4)
71
- thor (~> 0.14.0)
57
+ rails (3.0.3)
58
+ actionmailer (= 3.0.3)
59
+ actionpack (= 3.0.3)
60
+ activerecord (= 3.0.3)
61
+ activeresource (= 3.0.3)
62
+ activesupport (= 3.0.3)
63
+ bundler (~> 1.0)
64
+ railties (= 3.0.3)
65
+ railties (3.0.3)
66
+ actionpack (= 3.0.3)
67
+ activesupport (= 3.0.3)
68
+ rake (>= 0.8.7)
69
+ thor (~> 0.14.4)
72
70
  rake (0.8.7)
73
- rubyforge (2.0.4)
74
- json_pure (>= 1.1.7)
75
- sqlite3-ruby (1.3.1)
76
- thor (0.14.3)
77
- treetop (1.4.8)
71
+ sqlite3-ruby (1.3.2)
72
+ thor (0.14.6)
73
+ treetop (1.4.9)
78
74
  polyglot (>= 0.3.1)
79
75
  tzinfo (0.3.23)
80
76
 
@@ -86,5 +82,5 @@ DEPENDENCIES
86
82
  jeweler (>= 1.4.0)
87
83
  mime-types
88
84
  paperclip (>= 2.3.5)
89
- rails (>= 3.0.1)
85
+ rails (>= 3.0.3)
90
86
  sqlite3-ruby
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ begin
16
16
  gem.email = 'oleg@theworkinggroup.ca'
17
17
  gem.homepage = 'http://github.com/twg/comfortable-mexican-sofa'
18
18
  gem.authors = ['Oleg Khabarov', 'The Working Group Inc']
19
- gem.add_dependency('rails', '>=3.0.1')
19
+ gem.add_dependency('rails', '>=3.0.3')
20
20
  gem.add_dependency('active_link_to', '>=0.0.6')
21
21
  gem.add_dependency('paperclip', '>=2.3.5')
22
22
  end
@@ -45,7 +45,6 @@ rescue LoadError
45
45
  end
46
46
  end
47
47
 
48
- task :test => :check_dependencies
49
48
  task :default => :test
50
49
 
51
50
  require 'rake/rdoctask'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.34
1
+ 1.0.35
@@ -28,11 +28,11 @@ protected
28
28
  end
29
29
 
30
30
  def load_cms_page
31
- @cms_page = CmsPage.load_for_full_path!(@cms_site, "/#{params[:cms_path]}")
31
+ @cms_page = CmsPage.published.load_for_full_path!(@cms_site, "/#{params[:cms_path]}")
32
32
  return redirect_to(@cms_page.target_page.full_path) if @cms_page.target_page
33
33
 
34
34
  rescue ActiveRecord::RecordNotFound
35
- if @cms_page = CmsPage.load_for_full_path(@cms_site, '/404')
35
+ if @cms_page = CmsPage.published.load_for_full_path(@cms_site, '/404')
36
36
  render_html(404)
37
37
  else
38
38
  render :text => 'Page Not Found', :status => 404
@@ -36,6 +36,9 @@ class CmsPage < ActiveRecord::Base
36
36
  :uniqueness => { :scope => :cms_site_id }
37
37
  validate :validate_target_page
38
38
 
39
+ # -- Scopes ---------------------------------------------------------------
40
+ scope :published, where(:is_published => true)
41
+
39
42
  # -- Class Methods --------------------------------------------------------
40
43
  # Tree-like structure for pages
41
44
  def self.options_for_select(cms_site, cms_page = nil, current_page = nil, depth = 0, exclude_self = true, spacer = '. . ')
@@ -1,4 +1,11 @@
1
1
  <% content_for :right_column do %>
2
+ <div id='page_save' class='box'>
3
+ <label>
4
+ <input type='checkbox'/>
5
+ Published
6
+ </label>
7
+ <button></button>
8
+ </div>
2
9
  <%= render :partial => 'cms_admin/uploads/index' %>
3
10
  <% end %>
4
11
 
@@ -20,4 +27,6 @@
20
27
  <%= cms_hook :page_form, :object => form %>
21
28
  </div>
22
29
 
23
- <%= render :partial => 'form_blocks' %>
30
+ <%= render :partial => 'form_blocks' %>
31
+
32
+ <%= form.check_box :is_published, :label => 'Published' %>
@@ -1,5 +1,3 @@
1
- <h2>File Uploads</h2>
2
-
3
1
  <div id='file_uploads' class='box'>
4
2
  <button id="uploader_button" href="#">Select Files to Upload</button>
5
3
  <div id='uploaded_files'>
@@ -1,262 +1,260 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{comfortable_mexican_sofa}
8
- s.version = "1.0.34"
8
+ s.version = "1.0.35"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Oleg Khabarov", "The Working Group Inc"]
12
- s.date = %q{2010-12-06}
12
+ s.date = %q{2010-12-16}
13
13
  s.description = %q{}
14
14
  s.email = %q{oleg@theworkinggroup.ca}
15
15
  s.extra_rdoc_files = [
16
16
  "README.md"
17
17
  ]
18
18
  s.files = [
19
- ".gitignore",
20
- "Gemfile",
21
- "Gemfile.lock",
22
- "README.md",
23
- "Rakefile",
24
- "VERSION",
25
- "app/controllers/application_controller.rb",
26
- "app/controllers/cms_admin/base_controller.rb",
27
- "app/controllers/cms_admin/layouts_controller.rb",
28
- "app/controllers/cms_admin/pages_controller.rb",
29
- "app/controllers/cms_admin/sites_controller.rb",
30
- "app/controllers/cms_admin/snippets_controller.rb",
31
- "app/controllers/cms_admin/uploads_controller.rb",
32
- "app/controllers/cms_content_controller.rb",
33
- "app/models/cms_block.rb",
34
- "app/models/cms_layout.rb",
35
- "app/models/cms_page.rb",
36
- "app/models/cms_site.rb",
37
- "app/models/cms_snippet.rb",
38
- "app/models/cms_upload.rb",
39
- "app/views/cms_admin/layouts/_form.html.erb",
40
- "app/views/cms_admin/layouts/_index_branch.html.erb",
41
- "app/views/cms_admin/layouts/edit.html.erb",
42
- "app/views/cms_admin/layouts/index.html.erb",
43
- "app/views/cms_admin/layouts/new.html.erb",
44
- "app/views/cms_admin/pages/_form.html.erb",
45
- "app/views/cms_admin/pages/_form_blocks.html.erb",
46
- "app/views/cms_admin/pages/_index_branch.html.erb",
47
- "app/views/cms_admin/pages/edit.html.erb",
48
- "app/views/cms_admin/pages/form_blocks.js.erb",
49
- "app/views/cms_admin/pages/index.html.erb",
50
- "app/views/cms_admin/pages/new.html.erb",
51
- "app/views/cms_admin/sites/_form.html.erb",
52
- "app/views/cms_admin/sites/edit.html.erb",
53
- "app/views/cms_admin/sites/index.html.erb",
54
- "app/views/cms_admin/sites/new.html.erb",
55
- "app/views/cms_admin/snippets/_form.html.erb",
56
- "app/views/cms_admin/snippets/edit.html.erb",
57
- "app/views/cms_admin/snippets/index.html.erb",
58
- "app/views/cms_admin/snippets/new.html.erb",
59
- "app/views/cms_admin/uploads/_file.html.erb",
60
- "app/views/cms_admin/uploads/_index.html.erb",
61
- "app/views/cms_admin/uploads/destroy.js.erb",
62
- "app/views/layouts/cms_admin.html.erb",
63
- "comfortable_mexican_sofa.gemspec",
64
- "config.ru",
65
- "config/application.rb",
66
- "config/boot.rb",
67
- "config/database.yml",
68
- "config/environment.rb",
69
- "config/environments/development.rb",
70
- "config/environments/production.rb",
71
- "config/environments/test.rb",
72
- "config/initializers/comfortable_mexican_sofa.rb",
73
- "config/initializers/mime_types.rb",
74
- "config/initializers/paperclip.rb",
75
- "config/locales/en.yml",
76
- "config/routes.rb",
77
- "db/migrate/01_create_cms.rb",
78
- "db/seeds.rb",
79
- "doc/README_FOR_APP",
80
- "lib/comfortable_mexican_sofa.rb",
81
- "lib/comfortable_mexican_sofa/acts_as_tree.rb",
82
- "lib/comfortable_mexican_sofa/cms_tag.rb",
83
- "lib/comfortable_mexican_sofa/cms_tag/field_datetime.rb",
84
- "lib/comfortable_mexican_sofa/cms_tag/field_integer.rb",
85
- "lib/comfortable_mexican_sofa/cms_tag/field_string.rb",
86
- "lib/comfortable_mexican_sofa/cms_tag/field_text.rb",
87
- "lib/comfortable_mexican_sofa/cms_tag/helper.rb",
88
- "lib/comfortable_mexican_sofa/cms_tag/page_datetime.rb",
89
- "lib/comfortable_mexican_sofa/cms_tag/page_integer.rb",
90
- "lib/comfortable_mexican_sofa/cms_tag/page_rich_text.rb",
91
- "lib/comfortable_mexican_sofa/cms_tag/page_string.rb",
92
- "lib/comfortable_mexican_sofa/cms_tag/page_text.rb",
93
- "lib/comfortable_mexican_sofa/cms_tag/partial.rb",
94
- "lib/comfortable_mexican_sofa/cms_tag/snippet.rb",
95
- "lib/comfortable_mexican_sofa/configuration.rb",
96
- "lib/comfortable_mexican_sofa/controller_methods.rb",
97
- "lib/comfortable_mexican_sofa/engine.rb",
98
- "lib/comfortable_mexican_sofa/form_builder.rb",
99
- "lib/comfortable_mexican_sofa/http_auth.rb",
100
- "lib/comfortable_mexican_sofa/rails_extensions.rb",
101
- "lib/comfortable_mexican_sofa/view_hooks.rb",
102
- "lib/comfortable_mexican_sofa/view_methods.rb",
103
- "lib/generators/README",
104
- "lib/generators/cms_generator.rb",
105
- "lib/tasks/comfortable_mexican_sofa.rake",
106
- "public/404.html",
107
- "public/422.html",
108
- "public/500.html",
109
- "public/favicon.ico",
110
- "public/images/comfortable_mexican_sofa/body_bg.jpg",
111
- "public/images/comfortable_mexican_sofa/icon_regular.gif",
112
- "public/javascripts/comfortable_mexican_sofa/cms.js",
113
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png",
114
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png",
115
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png",
116
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png",
117
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png",
118
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png",
119
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png",
120
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png",
121
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_222222_256x240.png",
122
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_2e83ff_256x240.png",
123
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_454545_256x240.png",
124
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_888888_256x240.png",
125
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_cd0a0a_256x240.png",
126
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/jquery-ui.css",
127
- "public/javascripts/comfortable_mexican_sofa/jquery-ui/jquery-ui.js",
128
- "public/javascripts/comfortable_mexican_sofa/jquery.js",
129
- "public/javascripts/comfortable_mexican_sofa/plupload/plupload.full.min.js",
130
- "public/javascripts/comfortable_mexican_sofa/plupload/plupload.html5.min.js",
131
- "public/javascripts/comfortable_mexican_sofa/plupload/plupload.min.js",
132
- "public/javascripts/comfortable_mexican_sofa/rails.js",
133
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/jquery.tinymce.js",
134
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/langs/en.js",
135
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/about.htm",
136
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/anchor.htm",
137
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/charmap.htm",
138
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/color_picker.htm",
139
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/editor_template.js",
140
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/image.htm",
141
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/img/colorpicker.jpg",
142
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/img/icons.gif",
143
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/about.js",
144
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/anchor.js",
145
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/charmap.js",
146
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/color_picker.js",
147
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/image.js",
148
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/link.js",
149
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/source_editor.js",
150
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/langs/en.js",
151
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/langs/en_dlg.js",
152
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/link.htm",
153
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/content.css",
154
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/dialog.css",
155
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/buttons.png",
156
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/items.gif",
157
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif",
158
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/menu_check.gif",
159
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/progress.gif",
160
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/tabs.gif",
161
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/ui.css",
162
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/source_editor.htm",
163
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/tiny_mce.js",
164
- "public/javascripts/comfortable_mexican_sofa/tiny_mce/tiny_mce_popup.js",
165
- "public/robots.txt",
166
- "public/stylesheets/comfortable_mexican_sofa/reset.css",
167
- "public/stylesheets/comfortable_mexican_sofa/structure.css",
168
- "public/stylesheets/comfortable_mexican_sofa/typography.css",
169
- "script/rails",
170
- "test/cms_seeds/test.host/layouts/default.yml",
171
- "test/cms_seeds/test.host/layouts/nested.yml",
172
- "test/cms_seeds/test.host/pages/child.yml",
173
- "test/cms_seeds/test.host/pages/child/subchild.yml",
174
- "test/cms_seeds/test.host/pages/index.yml",
175
- "test/cms_seeds/test.host/snippets/default.yml",
176
- "test/fixtures/cms_blocks.yml",
177
- "test/fixtures/cms_layouts.yml",
178
- "test/fixtures/cms_pages.yml",
179
- "test/fixtures/cms_sites.yml",
180
- "test/fixtures/cms_snippets.yml",
181
- "test/fixtures/cms_uploads.yml",
182
- "test/fixtures/files/invalid_file.gif",
183
- "test/fixtures/files/valid_image.jpg",
184
- "test/fixtures/views/_nav_hook.html.erb",
185
- "test/functional/cms_admin/layouts_controller_test.rb",
186
- "test/functional/cms_admin/pages_controller_test.rb",
187
- "test/functional/cms_admin/sites_controller_test.rb",
188
- "test/functional/cms_admin/snippets_controller_test.rb",
189
- "test/functional/cms_admin/uploads_controller_test.rb",
190
- "test/functional/cms_content_controller_test.rb",
191
- "test/integration/authentication_test.rb",
192
- "test/integration/rake_tasks_test.rb",
193
- "test/integration/render_cms_seed_test.rb",
194
- "test/integration/render_cms_test.rb",
195
- "test/integration/sites_test.rb",
196
- "test/integration/view_hooks_test.rb",
197
- "test/test_helper.rb",
198
- "test/unit/cms_block_test.rb",
199
- "test/unit/cms_configuration_test.rb",
200
- "test/unit/cms_layout_test.rb",
201
- "test/unit/cms_page_test.rb",
202
- "test/unit/cms_site_test.rb",
203
- "test/unit/cms_snippet_test.rb",
204
- "test/unit/cms_tag_test.rb",
205
- "test/unit/cms_tags/field_datetime_test.rb",
206
- "test/unit/cms_tags/field_integer_test.rb",
207
- "test/unit/cms_tags/field_string_test.rb",
208
- "test/unit/cms_tags/field_text_test.rb",
209
- "test/unit/cms_tags/helper_test.rb",
210
- "test/unit/cms_tags/page_datetime_test.rb",
211
- "test/unit/cms_tags/page_integer_test.rb",
212
- "test/unit/cms_tags/page_rich_text.rb",
213
- "test/unit/cms_tags/page_string_test.rb",
214
- "test/unit/cms_tags/page_text_test.rb",
215
- "test/unit/cms_tags/partial_test.rb",
216
- "test/unit/cms_tags/snippet_test.rb",
217
- "test/unit/cms_upload_test.rb",
218
- "test/unit/view_methods_test.rb"
19
+ "Gemfile",
20
+ "Gemfile.lock",
21
+ "README.md",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "app/controllers/application_controller.rb",
25
+ "app/controllers/cms_admin/base_controller.rb",
26
+ "app/controllers/cms_admin/layouts_controller.rb",
27
+ "app/controllers/cms_admin/pages_controller.rb",
28
+ "app/controllers/cms_admin/sites_controller.rb",
29
+ "app/controllers/cms_admin/snippets_controller.rb",
30
+ "app/controllers/cms_admin/uploads_controller.rb",
31
+ "app/controllers/cms_content_controller.rb",
32
+ "app/models/cms_block.rb",
33
+ "app/models/cms_layout.rb",
34
+ "app/models/cms_page.rb",
35
+ "app/models/cms_site.rb",
36
+ "app/models/cms_snippet.rb",
37
+ "app/models/cms_upload.rb",
38
+ "app/views/cms_admin/layouts/_form.html.erb",
39
+ "app/views/cms_admin/layouts/_index_branch.html.erb",
40
+ "app/views/cms_admin/layouts/edit.html.erb",
41
+ "app/views/cms_admin/layouts/index.html.erb",
42
+ "app/views/cms_admin/layouts/new.html.erb",
43
+ "app/views/cms_admin/pages/_form.html.erb",
44
+ "app/views/cms_admin/pages/_form_blocks.html.erb",
45
+ "app/views/cms_admin/pages/_index_branch.html.erb",
46
+ "app/views/cms_admin/pages/edit.html.erb",
47
+ "app/views/cms_admin/pages/form_blocks.js.erb",
48
+ "app/views/cms_admin/pages/index.html.erb",
49
+ "app/views/cms_admin/pages/new.html.erb",
50
+ "app/views/cms_admin/sites/_form.html.erb",
51
+ "app/views/cms_admin/sites/edit.html.erb",
52
+ "app/views/cms_admin/sites/index.html.erb",
53
+ "app/views/cms_admin/sites/new.html.erb",
54
+ "app/views/cms_admin/snippets/_form.html.erb",
55
+ "app/views/cms_admin/snippets/edit.html.erb",
56
+ "app/views/cms_admin/snippets/index.html.erb",
57
+ "app/views/cms_admin/snippets/new.html.erb",
58
+ "app/views/cms_admin/uploads/_file.html.erb",
59
+ "app/views/cms_admin/uploads/_index.html.erb",
60
+ "app/views/cms_admin/uploads/destroy.js.erb",
61
+ "app/views/layouts/cms_admin.html.erb",
62
+ "comfortable_mexican_sofa.gemspec",
63
+ "config.ru",
64
+ "config/application.rb",
65
+ "config/boot.rb",
66
+ "config/database.yml",
67
+ "config/environment.rb",
68
+ "config/environments/development.rb",
69
+ "config/environments/production.rb",
70
+ "config/environments/test.rb",
71
+ "config/initializers/comfortable_mexican_sofa.rb",
72
+ "config/initializers/mime_types.rb",
73
+ "config/initializers/paperclip.rb",
74
+ "config/locales/en.yml",
75
+ "config/routes.rb",
76
+ "db/migrate/01_create_cms.rb",
77
+ "db/seeds.rb",
78
+ "doc/README_FOR_APP",
79
+ "lib/comfortable_mexican_sofa.rb",
80
+ "lib/comfortable_mexican_sofa/acts_as_tree.rb",
81
+ "lib/comfortable_mexican_sofa/cms_tag.rb",
82
+ "lib/comfortable_mexican_sofa/cms_tag/field_datetime.rb",
83
+ "lib/comfortable_mexican_sofa/cms_tag/field_integer.rb",
84
+ "lib/comfortable_mexican_sofa/cms_tag/field_string.rb",
85
+ "lib/comfortable_mexican_sofa/cms_tag/field_text.rb",
86
+ "lib/comfortable_mexican_sofa/cms_tag/helper.rb",
87
+ "lib/comfortable_mexican_sofa/cms_tag/page_datetime.rb",
88
+ "lib/comfortable_mexican_sofa/cms_tag/page_integer.rb",
89
+ "lib/comfortable_mexican_sofa/cms_tag/page_rich_text.rb",
90
+ "lib/comfortable_mexican_sofa/cms_tag/page_string.rb",
91
+ "lib/comfortable_mexican_sofa/cms_tag/page_text.rb",
92
+ "lib/comfortable_mexican_sofa/cms_tag/partial.rb",
93
+ "lib/comfortable_mexican_sofa/cms_tag/snippet.rb",
94
+ "lib/comfortable_mexican_sofa/configuration.rb",
95
+ "lib/comfortable_mexican_sofa/controller_methods.rb",
96
+ "lib/comfortable_mexican_sofa/engine.rb",
97
+ "lib/comfortable_mexican_sofa/form_builder.rb",
98
+ "lib/comfortable_mexican_sofa/http_auth.rb",
99
+ "lib/comfortable_mexican_sofa/rails_extensions.rb",
100
+ "lib/comfortable_mexican_sofa/view_hooks.rb",
101
+ "lib/comfortable_mexican_sofa/view_methods.rb",
102
+ "lib/generators/README",
103
+ "lib/generators/cms_generator.rb",
104
+ "lib/tasks/comfortable_mexican_sofa.rake",
105
+ "public/404.html",
106
+ "public/422.html",
107
+ "public/500.html",
108
+ "public/favicon.ico",
109
+ "public/images/comfortable_mexican_sofa/body_bg.jpg",
110
+ "public/images/comfortable_mexican_sofa/icon_regular.gif",
111
+ "public/javascripts/comfortable_mexican_sofa/cms.js",
112
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png",
113
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png",
114
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png",
115
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png",
116
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png",
117
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png",
118
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png",
119
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png",
120
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_222222_256x240.png",
121
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_2e83ff_256x240.png",
122
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_454545_256x240.png",
123
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_888888_256x240.png",
124
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/images/ui-icons_cd0a0a_256x240.png",
125
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/jquery-ui.css",
126
+ "public/javascripts/comfortable_mexican_sofa/jquery-ui/jquery-ui.js",
127
+ "public/javascripts/comfortable_mexican_sofa/jquery.js",
128
+ "public/javascripts/comfortable_mexican_sofa/plupload/plupload.full.min.js",
129
+ "public/javascripts/comfortable_mexican_sofa/plupload/plupload.html5.min.js",
130
+ "public/javascripts/comfortable_mexican_sofa/plupload/plupload.min.js",
131
+ "public/javascripts/comfortable_mexican_sofa/rails.js",
132
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/jquery.tinymce.js",
133
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/langs/en.js",
134
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/about.htm",
135
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/anchor.htm",
136
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/charmap.htm",
137
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/color_picker.htm",
138
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/editor_template.js",
139
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/image.htm",
140
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/img/colorpicker.jpg",
141
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/img/icons.gif",
142
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/about.js",
143
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/anchor.js",
144
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/charmap.js",
145
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/color_picker.js",
146
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/image.js",
147
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/link.js",
148
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/js/source_editor.js",
149
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/langs/en.js",
150
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/langs/en_dlg.js",
151
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/link.htm",
152
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/content.css",
153
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/dialog.css",
154
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/buttons.png",
155
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/items.gif",
156
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif",
157
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/menu_check.gif",
158
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/progress.gif",
159
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/img/tabs.gif",
160
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/skins/default/ui.css",
161
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/themes/advanced/source_editor.htm",
162
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/tiny_mce.js",
163
+ "public/javascripts/comfortable_mexican_sofa/tiny_mce/tiny_mce_popup.js",
164
+ "public/robots.txt",
165
+ "public/stylesheets/comfortable_mexican_sofa/reset.css",
166
+ "public/stylesheets/comfortable_mexican_sofa/structure.css",
167
+ "public/stylesheets/comfortable_mexican_sofa/typography.css",
168
+ "script/rails",
169
+ "test/cms_seeds/test.host/layouts/default.yml",
170
+ "test/cms_seeds/test.host/layouts/nested.yml",
171
+ "test/cms_seeds/test.host/pages/child.yml",
172
+ "test/cms_seeds/test.host/pages/child/subchild.yml",
173
+ "test/cms_seeds/test.host/pages/index.yml",
174
+ "test/cms_seeds/test.host/snippets/default.yml",
175
+ "test/fixtures/cms_blocks.yml",
176
+ "test/fixtures/cms_layouts.yml",
177
+ "test/fixtures/cms_pages.yml",
178
+ "test/fixtures/cms_sites.yml",
179
+ "test/fixtures/cms_snippets.yml",
180
+ "test/fixtures/cms_uploads.yml",
181
+ "test/fixtures/files/invalid_file.gif",
182
+ "test/fixtures/files/valid_image.jpg",
183
+ "test/fixtures/views/_nav_hook.html.erb",
184
+ "test/functional/cms_admin/layouts_controller_test.rb",
185
+ "test/functional/cms_admin/pages_controller_test.rb",
186
+ "test/functional/cms_admin/sites_controller_test.rb",
187
+ "test/functional/cms_admin/snippets_controller_test.rb",
188
+ "test/functional/cms_admin/uploads_controller_test.rb",
189
+ "test/functional/cms_content_controller_test.rb",
190
+ "test/integration/authentication_test.rb",
191
+ "test/integration/rake_tasks_test.rb",
192
+ "test/integration/render_cms_seed_test.rb",
193
+ "test/integration/render_cms_test.rb",
194
+ "test/integration/sites_test.rb",
195
+ "test/integration/view_hooks_test.rb",
196
+ "test/test_helper.rb",
197
+ "test/unit/cms_block_test.rb",
198
+ "test/unit/cms_configuration_test.rb",
199
+ "test/unit/cms_layout_test.rb",
200
+ "test/unit/cms_page_test.rb",
201
+ "test/unit/cms_site_test.rb",
202
+ "test/unit/cms_snippet_test.rb",
203
+ "test/unit/cms_tag_test.rb",
204
+ "test/unit/cms_tags/field_datetime_test.rb",
205
+ "test/unit/cms_tags/field_integer_test.rb",
206
+ "test/unit/cms_tags/field_string_test.rb",
207
+ "test/unit/cms_tags/field_text_test.rb",
208
+ "test/unit/cms_tags/helper_test.rb",
209
+ "test/unit/cms_tags/page_datetime_test.rb",
210
+ "test/unit/cms_tags/page_integer_test.rb",
211
+ "test/unit/cms_tags/page_rich_text.rb",
212
+ "test/unit/cms_tags/page_string_test.rb",
213
+ "test/unit/cms_tags/page_text_test.rb",
214
+ "test/unit/cms_tags/partial_test.rb",
215
+ "test/unit/cms_tags/snippet_test.rb",
216
+ "test/unit/cms_upload_test.rb",
217
+ "test/unit/view_methods_test.rb"
219
218
  ]
220
219
  s.homepage = %q{http://github.com/twg/comfortable-mexican-sofa}
221
- s.rdoc_options = ["--charset=UTF-8"]
222
220
  s.require_paths = ["lib"]
223
221
  s.rubygems_version = %q{1.3.7}
224
222
  s.summary = %q{ComfortableMexicanSofa is a Rails Engine CMS gem}
225
223
  s.test_files = [
226
224
  "test/functional/cms_admin/layouts_controller_test.rb",
227
- "test/functional/cms_admin/pages_controller_test.rb",
228
- "test/functional/cms_admin/sites_controller_test.rb",
229
- "test/functional/cms_admin/snippets_controller_test.rb",
230
- "test/functional/cms_admin/uploads_controller_test.rb",
231
- "test/functional/cms_content_controller_test.rb",
232
- "test/integration/authentication_test.rb",
233
- "test/integration/rake_tasks_test.rb",
234
- "test/integration/render_cms_seed_test.rb",
235
- "test/integration/render_cms_test.rb",
236
- "test/integration/sites_test.rb",
237
- "test/integration/view_hooks_test.rb",
238
- "test/test_helper.rb",
239
- "test/unit/cms_block_test.rb",
240
- "test/unit/cms_configuration_test.rb",
241
- "test/unit/cms_layout_test.rb",
242
- "test/unit/cms_page_test.rb",
243
- "test/unit/cms_site_test.rb",
244
- "test/unit/cms_snippet_test.rb",
245
- "test/unit/cms_tag_test.rb",
246
- "test/unit/cms_tags/field_datetime_test.rb",
247
- "test/unit/cms_tags/field_integer_test.rb",
248
- "test/unit/cms_tags/field_string_test.rb",
249
- "test/unit/cms_tags/field_text_test.rb",
250
- "test/unit/cms_tags/helper_test.rb",
251
- "test/unit/cms_tags/page_datetime_test.rb",
252
- "test/unit/cms_tags/page_integer_test.rb",
253
- "test/unit/cms_tags/page_rich_text.rb",
254
- "test/unit/cms_tags/page_string_test.rb",
255
- "test/unit/cms_tags/page_text_test.rb",
256
- "test/unit/cms_tags/partial_test.rb",
257
- "test/unit/cms_tags/snippet_test.rb",
258
- "test/unit/cms_upload_test.rb",
259
- "test/unit/view_methods_test.rb"
225
+ "test/functional/cms_admin/pages_controller_test.rb",
226
+ "test/functional/cms_admin/sites_controller_test.rb",
227
+ "test/functional/cms_admin/snippets_controller_test.rb",
228
+ "test/functional/cms_admin/uploads_controller_test.rb",
229
+ "test/functional/cms_content_controller_test.rb",
230
+ "test/integration/authentication_test.rb",
231
+ "test/integration/rake_tasks_test.rb",
232
+ "test/integration/render_cms_seed_test.rb",
233
+ "test/integration/render_cms_test.rb",
234
+ "test/integration/sites_test.rb",
235
+ "test/integration/view_hooks_test.rb",
236
+ "test/test_helper.rb",
237
+ "test/unit/cms_block_test.rb",
238
+ "test/unit/cms_configuration_test.rb",
239
+ "test/unit/cms_layout_test.rb",
240
+ "test/unit/cms_page_test.rb",
241
+ "test/unit/cms_site_test.rb",
242
+ "test/unit/cms_snippet_test.rb",
243
+ "test/unit/cms_tag_test.rb",
244
+ "test/unit/cms_tags/field_datetime_test.rb",
245
+ "test/unit/cms_tags/field_integer_test.rb",
246
+ "test/unit/cms_tags/field_string_test.rb",
247
+ "test/unit/cms_tags/field_text_test.rb",
248
+ "test/unit/cms_tags/helper_test.rb",
249
+ "test/unit/cms_tags/page_datetime_test.rb",
250
+ "test/unit/cms_tags/page_integer_test.rb",
251
+ "test/unit/cms_tags/page_rich_text.rb",
252
+ "test/unit/cms_tags/page_string_test.rb",
253
+ "test/unit/cms_tags/page_text_test.rb",
254
+ "test/unit/cms_tags/partial_test.rb",
255
+ "test/unit/cms_tags/snippet_test.rb",
256
+ "test/unit/cms_upload_test.rb",
257
+ "test/unit/view_methods_test.rb"
260
258
  ]
261
259
 
262
260
  if s.respond_to? :specification_version then
@@ -264,16 +262,31 @@ Gem::Specification.new do |s|
264
262
  s.specification_version = 3
265
263
 
266
264
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
267
- s.add_runtime_dependency(%q<rails>, [">= 3.0.1"])
265
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.3"])
266
+ s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 0"])
267
+ s.add_runtime_dependency(%q<active_link_to>, [">= 0.0.6"])
268
+ s.add_runtime_dependency(%q<paperclip>, [">= 2.3.5"])
269
+ s.add_runtime_dependency(%q<mime-types>, [">= 0"])
270
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.3"])
268
271
  s.add_runtime_dependency(%q<active_link_to>, [">= 0.0.6"])
269
272
  s.add_runtime_dependency(%q<paperclip>, [">= 2.3.5"])
270
273
  else
271
- s.add_dependency(%q<rails>, [">= 3.0.1"])
274
+ s.add_dependency(%q<rails>, [">= 3.0.3"])
275
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
276
+ s.add_dependency(%q<active_link_to>, [">= 0.0.6"])
277
+ s.add_dependency(%q<paperclip>, [">= 2.3.5"])
278
+ s.add_dependency(%q<mime-types>, [">= 0"])
279
+ s.add_dependency(%q<rails>, [">= 3.0.3"])
272
280
  s.add_dependency(%q<active_link_to>, [">= 0.0.6"])
273
281
  s.add_dependency(%q<paperclip>, [">= 2.3.5"])
274
282
  end
275
283
  else
276
- s.add_dependency(%q<rails>, [">= 3.0.1"])
284
+ s.add_dependency(%q<rails>, [">= 3.0.3"])
285
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
286
+ s.add_dependency(%q<active_link_to>, [">= 0.0.6"])
287
+ s.add_dependency(%q<paperclip>, [">= 2.3.5"])
288
+ s.add_dependency(%q<mime-types>, [">= 0"])
289
+ s.add_dependency(%q<rails>, [">= 3.0.3"])
277
290
  s.add_dependency(%q<active_link_to>, [">= 0.0.6"])
278
291
  s.add_dependency(%q<paperclip>, [">= 2.3.5"])
279
292
  end
@@ -36,6 +36,7 @@ class CreateCms < ActiveRecord::Migration
36
36
  t.text :content
37
37
  t.integer :position, :null => false, :default => 0
38
38
  t.integer :children_count, :null => false, :default => 0
39
+ t.boolean :is_published, :null => false, :default => true
39
40
  t.timestamps
40
41
  end
41
42
  add_index :cms_pages, [:cms_site_id, :full_path]
@@ -69,7 +70,6 @@ class CreateCms < ActiveRecord::Migration
69
70
  t.timestamps
70
71
  end
71
72
  add_index :cms_uploads, [:cms_site_id, :file_file_name]
72
-
73
73
  end
74
74
 
75
75
  def self.down
@@ -9,7 +9,8 @@ $.CMS = function(){
9
9
  $.CMS.load_page_blocks();
10
10
  $.CMS.enable_rich_text();
11
11
  $.CMS.enable_date_picker();
12
- if($('#uploader_button').get(0)) $.CMS.enable_uploader();
12
+ if($('#page_save').get(0)) $.CMS.enable_page_save_widget();
13
+ if($('#uploader_button').get(0)) $.CMS.enable_uploader();
13
14
 
14
15
  });
15
16
 
@@ -49,7 +50,7 @@ $.CMS = function(){
49
50
  },
50
51
 
51
52
  enable_rich_text: function(){
52
- $('.form_element.cms_tag_page_rich_text textarea').tinymce({
53
+ $('.form_element.cms_tag_page_rich_text textarea, textarea.rich_text').tinymce({
53
54
  theme : "advanced",
54
55
  plugins: "",
55
56
  theme_advanced_buttons1 : "formatselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,link,unlink,anchor,image,|,code",
@@ -87,6 +88,21 @@ $.CMS = function(){
87
88
  });
88
89
  },
89
90
 
91
+ enable_page_save_widget : function(){
92
+ $('#page_save input').attr('checked', $('input#cms_page_is_published').is(':checked'));
93
+ $('#page_save button').html($('input#cms_page_submit').val());
94
+
95
+ $('#page_save input').bind('click', function(){
96
+ $('input#cms_page_is_published').attr('checked', $(this).is(':checked'));
97
+ })
98
+ $('input#cms_page_is_published').bind('click', function(){
99
+ $('#page_save input').attr('checked', $(this).is(':checked'));
100
+ })
101
+ $('#page_save button').bind('click', function(){
102
+ $('input#cms_page_submit').click();
103
+ })
104
+ },
105
+
90
106
  enable_uploader : function(){
91
107
  auth_token = $("meta[name=csrf-token]").attr('content');
92
108
  var uploader = new plupload.Uploader({
@@ -54,17 +54,25 @@ html, body {
54
54
  opacity: 1;
55
55
  }
56
56
  /* -- Right Column ------------------------------------------------------- */
57
- .right_column_content h2 {
58
- font: 15px/25px Georgia, serif;
59
- color: #fff;
60
- margin-bottom: 10px;
61
- }
62
57
  .right_column_content .box {
63
58
  background-color: #ececec;
64
59
  padding: 5px;
65
60
  border-radius: 3px;
66
61
  -moz-border-radius: 3px;
62
+ margin-bottom: 25px;
63
+ overflow: hidden;
67
64
  }
65
+ #page_save button {
66
+ float: right;
67
+ }
68
+ #page_save label {
69
+ line-height: 20px;
70
+ padding-left: 5px;
71
+ }
72
+ #page_save input {
73
+ margin-right: 5px;
74
+ }
75
+
68
76
  #file_uploads button {
69
77
  width: 100%;
70
78
  margin-bottom: 10px;
@@ -8,6 +8,7 @@ default:
8
8
  full_path: '/'
9
9
  children_count: 1
10
10
  position: 0
11
+ is_published: true
11
12
  content: |-
12
13
 
13
14
  layout_content_a
@@ -28,6 +29,7 @@ child:
28
29
  full_path: '/child-page'
29
30
  children_count: 0
30
31
  position: 0
32
+ is_published: true
31
33
  content: |-
32
34
 
33
35
  layout_content_a
@@ -32,17 +32,20 @@ class CmsContentControllerTest < ActionController::TestCase
32
32
  end
33
33
 
34
34
  def test_render_page_not_found_with_custom_404
35
- cms_sites(:default).cms_pages.create!(
35
+ page = cms_sites(:default).cms_pages.create!(
36
36
  :label => '404',
37
37
  :slug => '404',
38
38
  :parent_id => cms_pages(:default).id,
39
39
  :cms_layout_id => cms_layouts(:default).id,
40
+ :is_published => '1',
40
41
  :cms_blocks_attributes => [
41
42
  { :label => 'default_page_text',
42
43
  :type => 'CmsTag::PageText',
43
44
  :content => 'custom 404 page content' }
44
45
  ]
45
46
  )
47
+ assert_equal '/404', page.full_path
48
+ assert page.is_published?
46
49
  get :render_html, :cms_path => 'doesnotexist'
47
50
  assert_response 404
48
51
  assert assigns(:cms_page)
@@ -57,6 +60,13 @@ class CmsContentControllerTest < ActionController::TestCase
57
60
  assert_redirected_to '/'
58
61
  end
59
62
 
63
+ def test_render_page_unpublished
64
+ page = cms_pages(:default)
65
+ page.update_attribute(:is_published, false)
66
+ get :render_html, :cms_path => ''
67
+ assert_response 404
68
+ end
69
+
60
70
  def test_render_css
61
71
  get :render_css, :id => cms_layouts(:default).slug
62
72
  assert_response :success
@@ -44,6 +44,22 @@ class CmsPageTest < ActiveSupport::TestCase
44
44
  assert_has_errors_on page, :target_page_id
45
45
  end
46
46
 
47
+ def test_creation
48
+ assert_difference ['CmsPage.count', 'CmsBlock.count'] do
49
+ page = cms_sites(:default).cms_pages.create!(
50
+ :label => 'test',
51
+ :slug => 'test',
52
+ :parent_id => cms_pages(:default).id,
53
+ :cms_layout_id => cms_layouts(:default).id,
54
+ :cms_blocks_attributes => [
55
+ { :label => 'test',
56
+ :content => 'test' }
57
+ ]
58
+ )
59
+ assert page.is_published?
60
+ end
61
+ end
62
+
47
63
  def test_initialization_of_full_path
48
64
  page = CmsPage.new(new_params)
49
65
  assert page.invalid?
@@ -201,6 +217,12 @@ class CmsPageTest < ActiveSupport::TestCase
201
217
  assert_not_equal 'changed', page.read_attribute(:content)
202
218
  end
203
219
 
220
+ def test_scope_published
221
+ assert_equal 2, CmsPage.published.count
222
+ cms_pages(:child).update_attribute(:is_published, false)
223
+ assert_equal 1, CmsPage.published.count
224
+ end
225
+
204
226
  protected
205
227
 
206
228
  def new_params(options = {})
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- hash: 83
4
+ hash: 81
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 34
10
- version: 1.0.34
9
+ - 35
10
+ version: 1.0.35
11
11
  platform: ruby
12
12
  authors:
13
13
  - Oleg Khabarov
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-06 00:00:00 -05:00
19
+ date: 2010-12-16 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -25,18 +25,32 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 5
28
+ hash: 1
29
29
  segments:
30
30
  - 3
31
31
  - 0
32
- - 1
33
- version: 3.0.1
32
+ - 3
33
+ version: 3.0.3
34
34
  type: :runtime
35
35
  name: rails
36
36
  prerelease: false
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
39
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ type: :runtime
49
+ name: sqlite3-ruby
50
+ prerelease: false
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ requirement: &id003 !ruby/object:Gem::Requirement
40
54
  none: false
41
55
  requirements:
42
56
  - - ">="
@@ -50,9 +64,9 @@ dependencies:
50
64
  type: :runtime
51
65
  name: active_link_to
52
66
  prerelease: false
53
- version_requirements: *id002
67
+ version_requirements: *id003
54
68
  - !ruby/object:Gem::Dependency
55
- requirement: &id003 !ruby/object:Gem::Requirement
69
+ requirement: &id004 !ruby/object:Gem::Requirement
56
70
  none: false
57
71
  requirements:
58
72
  - - ">="
@@ -66,7 +80,69 @@ dependencies:
66
80
  type: :runtime
67
81
  name: paperclip
68
82
  prerelease: false
69
- version_requirements: *id003
83
+ version_requirements: *id004
84
+ - !ruby/object:Gem::Dependency
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
93
+ version: "0"
94
+ type: :runtime
95
+ name: mime-types
96
+ prerelease: false
97
+ version_requirements: *id005
98
+ - !ruby/object:Gem::Dependency
99
+ requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 1
105
+ segments:
106
+ - 3
107
+ - 0
108
+ - 3
109
+ version: 3.0.3
110
+ type: :runtime
111
+ name: rails
112
+ prerelease: false
113
+ version_requirements: *id006
114
+ - !ruby/object:Gem::Dependency
115
+ requirement: &id007 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ hash: 19
121
+ segments:
122
+ - 0
123
+ - 0
124
+ - 6
125
+ version: 0.0.6
126
+ type: :runtime
127
+ name: active_link_to
128
+ prerelease: false
129
+ version_requirements: *id007
130
+ - !ruby/object:Gem::Dependency
131
+ requirement: &id008 !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ hash: 9
137
+ segments:
138
+ - 2
139
+ - 3
140
+ - 5
141
+ version: 2.3.5
142
+ type: :runtime
143
+ name: paperclip
144
+ prerelease: false
145
+ version_requirements: *id008
70
146
  description: ""
71
147
  email: oleg@theworkinggroup.ca
72
148
  executables: []
@@ -76,7 +152,6 @@ extensions: []
76
152
  extra_rdoc_files:
77
153
  - README.md
78
154
  files:
79
- - .gitignore
80
155
  - Gemfile
81
156
  - Gemfile.lock
82
157
  - README.md
@@ -281,8 +356,8 @@ homepage: http://github.com/twg/comfortable-mexican-sofa
281
356
  licenses: []
282
357
 
283
358
  post_install_message:
284
- rdoc_options:
285
- - --charset=UTF-8
359
+ rdoc_options: []
360
+
286
361
  require_paths:
287
362
  - lib
288
363
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
5
- .DS_Store
6
- db/schema.rb
7
- db/development_structure.sql
8
- public/system/*
9
- pkg
10
- rdoc
11
- /tmp
12
- public/cms-css/
13
- public/cms-js/