comfortable_mexican_sofa 1.7.1 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/**/*
5
+ .DS_Store
6
+ db/schema.rb
7
+ db/development_structure.sql
8
+ pkg
9
+ rdoc
10
+ /tmp
11
+ public/*
12
+ Gemfile.lock
13
+ .rvmrc
14
+ /.sass-cache
data/Gemfile CHANGED
@@ -12,5 +12,4 @@ gem 'coffee-rails', '>= 3.1.0'
12
12
 
13
13
  group :test do
14
14
  gem 'sqlite3'
15
- gem 'jeweler'
16
15
  end
data/Rakefile CHANGED
@@ -1,23 +1,5 @@
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
1
  require File.expand_path('../config/application', __FILE__)
5
2
  require 'rubygems'
6
3
  require 'rake'
7
4
 
8
- ComfortableMexicanSofa::Application.load_tasks
9
-
10
- begin
11
- require 'jeweler'
12
- Jeweler::Tasks.new do |gem|
13
- gem.name = 'comfortable_mexican_sofa'
14
- gem.summary = 'ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications'
15
- gem.description = ''
16
- gem.email = 'oleg@theworkinggroup.ca'
17
- gem.homepage = 'http://github.com/comfy/comfortable-mexican-sofa'
18
- gem.authors = ['Oleg Khabarov', 'The Working Group Inc']
19
- end
20
- Jeweler::GemcutterTasks.new
21
- rescue LoadError
22
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23
- end
5
+ ComfortableMexicanSofa::Application.load_tasks
@@ -118,7 +118,7 @@ body#comfy
118
118
  height: 60px
119
119
  width: 80px
120
120
  float: left
121
- background: url("/assets/comfortable_mexican_sofa/checkboard.gif")
121
+ background: url("/assets/comfortable_mexican_sofa/checkerboard.gif")
122
122
  .details
123
123
  margin-left: 85px
124
124
  font-size: 11px
@@ -325,4 +325,4 @@ body#comfy
325
325
  border-radius: 3px
326
326
  margin-bottom: 2px
327
327
  a:hover
328
- background-color: #f5f5f5
328
+ background-color: #f5f5f5
@@ -50,7 +50,7 @@ class Cms::Site < ActiveRecord::Base
50
50
  Cms::Site.find_all_by_hostname(real_host_from_aliases(host)).each do |site|
51
51
  if site.path.blank?
52
52
  cms_site = site
53
- elsif "#{path}/".match /^\/#{Regexp.escape(site.path.to_s)}\//
53
+ elsif "#{path.to_s.split('?')[0]}/".match /^\/#{Regexp.escape(site.path.to_s)}\//
54
54
  cms_site = site
55
55
  break
56
56
  end
@@ -2,7 +2,8 @@
2
2
  = form.file_field :file, :multiple => @file.new_record?
3
3
 
4
4
  - unless @file.new_record?
5
- = form.element t('.current_file'), nil do
5
+ = form.element t('.current_file') do
6
+ = image_tag @file.file.url if @file.is_image?
6
7
  = link_to @file.file.url, @file.file.url, :target => '_blank'
7
8
 
8
9
  = form.text_area :description
@@ -9,7 +9,9 @@
9
9
  - @files.each do |file|
10
10
  %tr{:id => dom_id(file)}
11
11
  %td
12
- .icon
12
+ - if file.is_image?
13
+ - icon_style = "background: url('#{file.file.url(:cms_thumb)}') no-repeat center"
14
+ .icon{:style => icon_style}
13
15
  - if !params[:category].present? && @site.files.count > 1
14
16
  .dragger
15
17
  %span &#8645;
@@ -1,325 +1,28 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
5
2
 
6
- Gem::Specification.new do |s|
7
- s.name = "comfortable_mexican_sofa"
8
- s.version = "1.7.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Oleg Khabarov", "The Working Group Inc"]
12
- s.date = "2013-03-02"
13
- s.description = ""
14
- s.email = "oleg@theworkinggroup.ca"
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.md"
18
- ]
19
- s.files = [
20
- ".travis.yml",
21
- "Gemfile",
22
- "LICENSE",
23
- "README.md",
24
- "Rakefile",
25
- "VERSION",
26
- "app/assets/images/comfortable_mexican_sofa/arrow_bottom.gif",
27
- "app/assets/images/comfortable_mexican_sofa/arrow_right.gif",
28
- "app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings-white.png",
29
- "app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings.png",
30
- "app/assets/images/comfortable_mexican_sofa/checkerboard.gif",
31
- "app/assets/images/comfortable_mexican_sofa/icon_draft.gif",
32
- "app/assets/images/comfortable_mexican_sofa/icon_file.gif",
33
- "app/assets/images/comfortable_mexican_sofa/icon_layout.gif",
34
- "app/assets/images/comfortable_mexican_sofa/icon_move.gif",
35
- "app/assets/images/comfortable_mexican_sofa/icon_page.gif",
36
- "app/assets/images/comfortable_mexican_sofa/icon_site.gif",
37
- "app/assets/images/comfortable_mexican_sofa/icon_snippet.gif",
38
- "app/assets/images/comfortable_mexican_sofa/nav_arrow.png",
39
- "app/assets/javascripts/comfortable_mexican_sofa/application.js",
40
- "app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap-datetimepicker.js",
41
- "app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.js",
42
- "app/assets/javascripts/comfortable_mexican_sofa/lib/bootstrap.js",
43
- "app/assets/javascripts/comfortable_mexican_sofa/lib/codemirror.js",
44
- "app/assets/javascripts/comfortable_mexican_sofa/lib/wysihtml5.js",
45
- "app/assets/stylesheets/comfortable_mexican_sofa/application.css.sass",
46
- "app/assets/stylesheets/comfortable_mexican_sofa/base.css.sass",
47
- "app/assets/stylesheets/comfortable_mexican_sofa/base_overrides.css.sass",
48
- "app/assets/stylesheets/comfortable_mexican_sofa/bootstrap_overrides.css.sass",
49
- "app/assets/stylesheets/comfortable_mexican_sofa/codemirror_overrides.css.sass",
50
- "app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap-datetimepicker.css",
51
- "app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap-wysihtml5.css",
52
- "app/assets/stylesheets/comfortable_mexican_sofa/lib/bootstrap.css",
53
- "app/assets/stylesheets/comfortable_mexican_sofa/lib/codemirror.css",
54
- "app/assets/stylesheets/comfortable_mexican_sofa/wysihtml5_overrides.css.sass",
55
- "app/controllers/application_controller.rb",
56
- "app/controllers/cms_admin/base_controller.rb",
57
- "app/controllers/cms_admin/categories_controller.rb",
58
- "app/controllers/cms_admin/files_controller.rb",
59
- "app/controllers/cms_admin/layouts_controller.rb",
60
- "app/controllers/cms_admin/pages_controller.rb",
61
- "app/controllers/cms_admin/revisions_controller.rb",
62
- "app/controllers/cms_admin/sites_controller.rb",
63
- "app/controllers/cms_admin/snippets_controller.rb",
64
- "app/controllers/cms_content_controller.rb",
65
- "app/models/cms/block.rb",
66
- "app/models/cms/categorization.rb",
67
- "app/models/cms/category.rb",
68
- "app/models/cms/file.rb",
69
- "app/models/cms/layout.rb",
70
- "app/models/cms/page.rb",
71
- "app/models/cms/revision.rb",
72
- "app/models/cms/site.rb",
73
- "app/models/cms/snippet.rb",
74
- "app/views/cms_admin/categories/_categories.html.haml",
75
- "app/views/cms_admin/categories/_edit.html.haml",
76
- "app/views/cms_admin/categories/_form.html.haml",
77
- "app/views/cms_admin/categories/_index.html.haml",
78
- "app/views/cms_admin/categories/_show.html.haml",
79
- "app/views/cms_admin/categories/create.js.erb",
80
- "app/views/cms_admin/categories/destroy.js.erb",
81
- "app/views/cms_admin/categories/edit.js.erb",
82
- "app/views/cms_admin/categories/update.js.erb",
83
- "app/views/cms_admin/files/_file.html.haml",
84
- "app/views/cms_admin/files/_form.html.haml",
85
- "app/views/cms_admin/files/_index.html.haml",
86
- "app/views/cms_admin/files/_page_form.html.haml",
87
- "app/views/cms_admin/files/create.js.erb",
88
- "app/views/cms_admin/files/destroy.js.erb",
89
- "app/views/cms_admin/files/edit.html.haml",
90
- "app/views/cms_admin/files/index.html.haml",
91
- "app/views/cms_admin/files/new.html.haml",
92
- "app/views/cms_admin/layouts/_form.html.haml",
93
- "app/views/cms_admin/layouts/_index_branch.html.haml",
94
- "app/views/cms_admin/layouts/edit.html.haml",
95
- "app/views/cms_admin/layouts/index.html.haml",
96
- "app/views/cms_admin/layouts/new.html.haml",
97
- "app/views/cms_admin/pages/_form.html.haml",
98
- "app/views/cms_admin/pages/_form_blocks.html.haml",
99
- "app/views/cms_admin/pages/_index_branch.html.haml",
100
- "app/views/cms_admin/pages/edit.html.haml",
101
- "app/views/cms_admin/pages/form_blocks.js.erb",
102
- "app/views/cms_admin/pages/index.html.haml",
103
- "app/views/cms_admin/pages/new.html.haml",
104
- "app/views/cms_admin/pages/toggle_branch.js.erb",
105
- "app/views/cms_admin/revisions/show.html.haml",
106
- "app/views/cms_admin/sites/_form.html.haml",
107
- "app/views/cms_admin/sites/_mirrors.html.haml",
108
- "app/views/cms_admin/sites/edit.html.haml",
109
- "app/views/cms_admin/sites/index.html.haml",
110
- "app/views/cms_admin/sites/new.html.haml",
111
- "app/views/cms_admin/snippets/_form.html.haml",
112
- "app/views/cms_admin/snippets/edit.html.haml",
113
- "app/views/cms_admin/snippets/index.html.haml",
114
- "app/views/cms_admin/snippets/new.html.haml",
115
- "app/views/cms_content/render_sitemap.xml.builder",
116
- "app/views/layouts/cms_admin.html.haml",
117
- "app/views/layouts/cms_admin/_body.html.haml",
118
- "app/views/layouts/cms_admin/_center.html.haml",
119
- "app/views/layouts/cms_admin/_head.html.haml",
120
- "app/views/layouts/cms_admin/_left.html.haml",
121
- "app/views/layouts/cms_admin/_right.html.haml",
122
- "comfortable_mexican_sofa.gemspec",
123
- "config.ru",
124
- "config/application.rb",
125
- "config/boot.rb",
126
- "config/database.yml",
127
- "config/environment.rb",
128
- "config/environments/development.rb",
129
- "config/environments/production.rb",
130
- "config/environments/test.rb",
131
- "config/initializers/comfortable_mexican_sofa.rb",
132
- "config/initializers/paperclip.rb",
133
- "config/locales/de.yml",
134
- "config/locales/en.yml",
135
- "config/locales/es.yml",
136
- "config/locales/fr.yml",
137
- "config/locales/ja.yml",
138
- "config/locales/pl.yml",
139
- "config/locales/pt-BR.yml",
140
- "config/locales/ru.yml",
141
- "config/locales/sv.yml",
142
- "config/locales/zh-CN.yml",
143
- "config/routes.rb",
144
- "db/cms_fixtures/sample-site/layouts/default/_default.yml",
145
- "db/cms_fixtures/sample-site/layouts/default/content.html",
146
- "db/cms_fixtures/sample-site/layouts/default/css.css",
147
- "db/cms_fixtures/sample-site/layouts/default/js.js",
148
- "db/cms_fixtures/sample-site/layouts/default/nested/_nested.yml",
149
- "db/cms_fixtures/sample-site/layouts/default/nested/content.html",
150
- "db/cms_fixtures/sample-site/layouts/default/nested/css.css",
151
- "db/cms_fixtures/sample-site/layouts/default/nested/js.js",
152
- "db/cms_fixtures/sample-site/pages/index/_index.yml",
153
- "db/cms_fixtures/sample-site/pages/index/child/_child.yml",
154
- "db/cms_fixtures/sample-site/pages/index/child/left.html",
155
- "db/cms_fixtures/sample-site/pages/index/child/right.html",
156
- "db/cms_fixtures/sample-site/pages/index/content.html",
157
- "db/cms_fixtures/sample-site/snippets/default/_default.yml",
158
- "db/cms_fixtures/sample-site/snippets/default/content.html",
159
- "db/migrate/01_create_cms.rb",
160
- "db/seeds.rb",
161
- "db/upgrade_migrations/02_upgrade_to_1_1_0.rb",
162
- "db/upgrade_migrations/03_upgrade_to_1_2_0.rb",
163
- "db/upgrade_migrations/04_upgrade_to_1_3_0.rb",
164
- "db/upgrade_migrations/05_upgrade_to_1_4_0.rb",
165
- "db/upgrade_migrations/06_upgrade_to_1_5_0.rb",
166
- "db/upgrade_migrations/07_upgrade_to_1_6_0.rb",
167
- "doc/preview.png",
168
- "doc/sofa.png",
169
- "lib/comfortable_mexican_sofa.rb",
170
- "lib/comfortable_mexican_sofa/authentication/dummy_auth.rb",
171
- "lib/comfortable_mexican_sofa/authentication/http_auth.rb",
172
- "lib/comfortable_mexican_sofa/configuration.rb",
173
- "lib/comfortable_mexican_sofa/engine.rb",
174
- "lib/comfortable_mexican_sofa/error.rb",
175
- "lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb",
176
- "lib/comfortable_mexican_sofa/extensions/has_revisions.rb",
177
- "lib/comfortable_mexican_sofa/extensions/is_categorized.rb",
178
- "lib/comfortable_mexican_sofa/extensions/is_mirrored.rb",
179
- "lib/comfortable_mexican_sofa/extensions/rails.rb",
180
- "lib/comfortable_mexican_sofa/fixtures.rb",
181
- "lib/comfortable_mexican_sofa/form_builder.rb",
182
- "lib/comfortable_mexican_sofa/render_methods.rb",
183
- "lib/comfortable_mexican_sofa/sitemap.rb",
184
- "lib/comfortable_mexican_sofa/tag.rb",
185
- "lib/comfortable_mexican_sofa/tags/asset.rb",
186
- "lib/comfortable_mexican_sofa/tags/collection.rb",
187
- "lib/comfortable_mexican_sofa/tags/field_datetime.rb",
188
- "lib/comfortable_mexican_sofa/tags/field_integer.rb",
189
- "lib/comfortable_mexican_sofa/tags/field_rich_text.rb",
190
- "lib/comfortable_mexican_sofa/tags/field_string.rb",
191
- "lib/comfortable_mexican_sofa/tags/field_text.rb",
192
- "lib/comfortable_mexican_sofa/tags/file.rb",
193
- "lib/comfortable_mexican_sofa/tags/helper.rb",
194
- "lib/comfortable_mexican_sofa/tags/page_datetime.rb",
195
- "lib/comfortable_mexican_sofa/tags/page_file.rb",
196
- "lib/comfortable_mexican_sofa/tags/page_files.rb",
197
- "lib/comfortable_mexican_sofa/tags/page_integer.rb",
198
- "lib/comfortable_mexican_sofa/tags/page_markdown.rb",
199
- "lib/comfortable_mexican_sofa/tags/page_rich_text.rb",
200
- "lib/comfortable_mexican_sofa/tags/page_string.rb",
201
- "lib/comfortable_mexican_sofa/tags/page_text.rb",
202
- "lib/comfortable_mexican_sofa/tags/partial.rb",
203
- "lib/comfortable_mexican_sofa/tags/snippet.rb",
204
- "lib/comfortable_mexican_sofa/version.rb",
205
- "lib/comfortable_mexican_sofa/view_hooks.rb",
206
- "lib/comfortable_mexican_sofa/view_methods.rb",
207
- "lib/generators/comfy/cms/README",
208
- "lib/generators/comfy/cms/cms_generator.rb",
209
- "lib/tasks/comfortable_mexican_sofa.rake",
210
- "script/rails",
211
- "test/fixtures/cms/blocks.yml",
212
- "test/fixtures/cms/categories.yml",
213
- "test/fixtures/cms/categorizations.yml",
214
- "test/fixtures/cms/files.yml",
215
- "test/fixtures/cms/layouts.yml",
216
- "test/fixtures/cms/pages.yml",
217
- "test/fixtures/cms/revisions.yml",
218
- "test/fixtures/cms/sites.yml",
219
- "test/fixtures/cms/snippets.yml",
220
- "test/fixtures/files/data.zip",
221
- "test/fixtures/files/document.pdf",
222
- "test/fixtures/files/image.gif",
223
- "test/fixtures/files/image.jpg",
224
- "test/fixtures/views/_nav_hook.html.erb",
225
- "test/fixtures/views/_nav_hook_2.html.erb",
226
- "test/fixtures/views/render_test/_test.html.erb",
227
- "test/fixtures/views/render_test/new.html.erb",
228
- "test/fixtures/views/render_test/render_layout.html.erb",
229
- "test/functional/cms_admin/base_controller_test.rb",
230
- "test/functional/cms_admin/categories_controller_test.rb",
231
- "test/functional/cms_admin/files_controller_test.rb",
232
- "test/functional/cms_admin/layouts_controller_test.rb",
233
- "test/functional/cms_admin/pages_controller_test.rb",
234
- "test/functional/cms_admin/revisions_controller_test.rb",
235
- "test/functional/cms_admin/sites_controller_test.rb",
236
- "test/functional/cms_admin/snippets_controller_test.rb",
237
- "test/functional/cms_content_controller_test.rb",
238
- "test/gemfiles/Gemfile.rails.3.1",
239
- "test/gemfiles/Gemfile.rails.3.2",
240
- "test/gemfiles/Gemfile.rails.4.0",
241
- "test/integration/authentication_test.rb",
242
- "test/integration/fixtures_test.rb",
243
- "test/integration/mirrors_test.rb",
244
- "test/integration/render_cms_test.rb",
245
- "test/integration/routing_extensions_test.rb",
246
- "test/integration/sites_test.rb",
247
- "test/integration/view_hooks_test.rb",
248
- "test/test_helper.rb",
249
- "test/unit/configuration_test.rb",
250
- "test/unit/fixtures_test.rb",
251
- "test/unit/mirrors_test.rb",
252
- "test/unit/models/block_test.rb",
253
- "test/unit/models/categorization_test.rb",
254
- "test/unit/models/category_test.rb",
255
- "test/unit/models/file_test.rb",
256
- "test/unit/models/layout_test.rb",
257
- "test/unit/models/page_test.rb",
258
- "test/unit/models/site_test.rb",
259
- "test/unit/models/snippet_test.rb",
260
- "test/unit/revisions_test.rb",
261
- "test/unit/sitemap_test.rb",
262
- "test/unit/tag_test.rb",
263
- "test/unit/tags/asset_test.rb",
264
- "test/unit/tags/collection_test.rb",
265
- "test/unit/tags/field_datetime_test.rb",
266
- "test/unit/tags/field_integer_test.rb",
267
- "test/unit/tags/field_rich_text_test.rb",
268
- "test/unit/tags/field_string_test.rb",
269
- "test/unit/tags/field_text_test.rb",
270
- "test/unit/tags/file_test.rb",
271
- "test/unit/tags/helper_test.rb",
272
- "test/unit/tags/page_datetime_test.rb",
273
- "test/unit/tags/page_file_test.rb",
274
- "test/unit/tags/page_files_test.rb",
275
- "test/unit/tags/page_integer_test.rb",
276
- "test/unit/tags/page_markdown_test.rb",
277
- "test/unit/tags/page_rich_text_test.rb",
278
- "test/unit/tags/page_string_test.rb",
279
- "test/unit/tags/page_text_test.rb",
280
- "test/unit/tags/partial_test.rb",
281
- "test/unit/tags/snippet_test.rb",
282
- "test/unit/view_methods_test.rb"
283
- ]
284
- s.homepage = "http://github.com/comfy/comfortable-mexican-sofa"
285
- s.require_paths = ["lib"]
286
- s.rubygems_version = "1.8.23"
287
- s.summary = "ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications"
288
-
289
- if s.respond_to? :specification_version then
290
- s.specification_version = 3
3
+ $:.unshift File.expand_path('../lib', __FILE__)
4
+ require 'comfortable_mexican_sofa/version'
291
5
 
292
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
293
- s.add_runtime_dependency(%q<rails>, [">= 3.1.0"])
294
- s.add_runtime_dependency(%q<formatted_form>, [">= 2.1.0"])
295
- s.add_runtime_dependency(%q<active_link_to>, [">= 1.0.0"])
296
- s.add_runtime_dependency(%q<paperclip>, [">= 3.4.0"])
297
- s.add_runtime_dependency(%q<redcarpet>, [">= 2.2.0"])
298
- s.add_runtime_dependency(%q<jquery-rails>, [">= 2.2.0"])
299
- s.add_runtime_dependency(%q<haml-rails>, [">= 0.3.0"])
300
- s.add_runtime_dependency(%q<sass-rails>, [">= 3.1.0"])
301
- s.add_runtime_dependency(%q<coffee-rails>, [">= 3.1.0"])
302
- else
303
- s.add_dependency(%q<rails>, [">= 3.1.0"])
304
- s.add_dependency(%q<formatted_form>, [">= 2.1.0"])
305
- s.add_dependency(%q<active_link_to>, [">= 1.0.0"])
306
- s.add_dependency(%q<paperclip>, [">= 3.4.0"])
307
- s.add_dependency(%q<redcarpet>, [">= 2.2.0"])
308
- s.add_dependency(%q<jquery-rails>, [">= 2.2.0"])
309
- s.add_dependency(%q<haml-rails>, [">= 0.3.0"])
310
- s.add_dependency(%q<sass-rails>, [">= 3.1.0"])
311
- s.add_dependency(%q<coffee-rails>, [">= 3.1.0"])
312
- end
313
- else
314
- s.add_dependency(%q<rails>, [">= 3.1.0"])
315
- s.add_dependency(%q<formatted_form>, [">= 2.1.0"])
316
- s.add_dependency(%q<active_link_to>, [">= 1.0.0"])
317
- s.add_dependency(%q<paperclip>, [">= 3.4.0"])
318
- s.add_dependency(%q<redcarpet>, [">= 2.2.0"])
319
- s.add_dependency(%q<jquery-rails>, [">= 2.2.0"])
320
- s.add_dependency(%q<haml-rails>, [">= 0.3.0"])
321
- s.add_dependency(%q<sass-rails>, [">= 3.1.0"])
322
- s.add_dependency(%q<coffee-rails>, [">= 3.1.0"])
323
- end
6
+ Gem::Specification.new do |s|
7
+ s.name = "comfortable_mexican_sofa"
8
+ s.version = ComfortableMexicanSofa::VERSION
9
+ s.authors = ["Oleg Khabarov", "The Working Group Inc"]
10
+ s.email = ["oleg@khabarov.ca"]
11
+ s.homepage = "http://github.com/comfy/comfortable-mexican-sofa"
12
+ s.summary = "CMS Engine for Rails 3 apps"
13
+ s.description = "ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications"
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.platform = Gem::Platform::RUBY
17
+ s.require_paths = ['lib']
18
+
19
+ s.add_dependency 'rails', '>= 3.1.0'
20
+ s.add_dependency 'formatted_form', '>= 2.1.0'
21
+ s.add_dependency 'active_link_to', '>= 1.0.0'
22
+ s.add_dependency 'paperclip', '>= 3.4.0'
23
+ s.add_dependency 'redcarpet', '>= 2.2.0'
24
+ s.add_dependency 'jquery-rails', '>= 2.2.0'
25
+ s.add_dependency 'haml-rails', '>= 0.3.0'
26
+ s.add_dependency 'sass-rails', '>= 3.1.0'
27
+ s.add_dependency 'coffee-rails', '>= 3.1.0'
324
28
  end
325
-
@@ -34,6 +34,7 @@ ComfortableMexicanSofa.configure do |config|
34
34
  # the upload method and appropriate settings based on Paperclip. For S3 see:
35
35
  # http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for
36
36
  # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem
37
+ # If you are using S3 and HTTPS, pass :s3_protocol => '' to have URLs that use the protocol of the page
37
38
  # config.upload_file_options = {:url => '/system/:class/:id/:attachment/:style/:filename'}
38
39
 
39
40
  # Sofa allows you to setup entire site from files. Database is updated with each
@@ -1,9 +1,9 @@
1
1
  module ComfortableMexicanSofa::Fixtures
2
2
 
3
- def self.import_all(to_site, from_folder = nil)
4
- import_layouts to_site, from_folder
5
- import_pages to_site, from_folder
6
- import_snippets to_site, from_folder
3
+ def self.import_all(to_site, from_folder = nil, force_import = false)
4
+ import_layouts to_site, from_folder, force_import
5
+ import_pages to_site, from_folder, force_import
6
+ import_snippets to_site, from_folder, force_import
7
7
  end
8
8
 
9
9
  def self.export_all(from_site, to_folder = nil)
@@ -12,7 +12,7 @@ module ComfortableMexicanSofa::Fixtures
12
12
  export_snippets from_site, to_folder
13
13
  end
14
14
 
15
- def self.import_layouts(to_site, from_folder = nil, path = nil, root = true, parent = nil, layout_ids = [])
15
+ def self.import_layouts(to_site, from_folder = nil, path = nil, root = true, parent = nil, layout_ids = [], force_import = false)
16
16
  site = Cms::Site.find_or_create_by_identifier(to_site)
17
17
  unless path ||= find_fixtures_path((from_folder || to_site), 'layouts')
18
18
  ComfortableMexicanSofa.logger.warn('Cannot find Layout fixtures')
@@ -25,7 +25,7 @@ module ComfortableMexicanSofa::Fixtures
25
25
 
26
26
  # updating attributes
27
27
  if File.exists?(file_path = File.join(path, "_#{identifier}.yml"))
28
- if layout.new_record? || File.mtime(file_path) > layout.updated_at
28
+ if layout.new_record? || File.mtime(file_path) > layout.updated_at || force_import
29
29
  attributes = YAML.load_file(file_path).try(:symbolize_keys!) || { }
30
30
  layout.label = attributes[:label] || identifier.titleize
31
31
  layout.app_layout = attributes[:app_layout] || parent.try(:app_layout)
@@ -38,17 +38,17 @@ module ComfortableMexicanSofa::Fixtures
38
38
 
39
39
  # updating content
40
40
  if File.exists?(file_path = File.join(path, 'content.html'))
41
- if layout.new_record? || File.mtime(file_path) > layout.updated_at
41
+ if layout.new_record? || File.mtime(file_path) > layout.updated_at || force_import
42
42
  layout.content = File.open(file_path).read
43
43
  end
44
44
  end
45
45
  if File.exists?(file_path = File.join(path, 'css.css'))
46
- if layout.new_record? || File.mtime(file_path) > layout.updated_at
46
+ if layout.new_record? || File.mtime(file_path) > layout.updated_at || force_import
47
47
  layout.css = File.open(file_path).read
48
48
  end
49
49
  end
50
50
  if File.exists?(file_path = File.join(path, 'js.js'))
51
- if layout.new_record? || File.mtime(file_path) > layout.updated_at
51
+ if layout.new_record? || File.mtime(file_path) > layout.updated_at || force_import
52
52
  layout.js = File.open(file_path).read
53
53
  end
54
54
  end
@@ -79,7 +79,7 @@ module ComfortableMexicanSofa::Fixtures
79
79
  layout_ids.uniq
80
80
  end
81
81
 
82
- def self.import_pages(to_site, from_folder = nil, path = nil, root = true, parent = nil, page_ids = [])
82
+ def self.import_pages(to_site, from_folder = nil, path = nil, root = true, parent = nil, page_ids = [], force_import = false)
83
83
  site = Cms::Site.find_or_create_by_identifier(to_site)
84
84
  unless path ||= find_fixtures_path((from_folder || to_site), 'pages')
85
85
  ComfortableMexicanSofa.logger.warn('Cannot find Page fixtures')
@@ -96,12 +96,12 @@ module ComfortableMexicanSofa::Fixtures
96
96
 
97
97
  # updating attributes
98
98
  if File.exists?(file_path = File.join(path, "_#{slug}.yml"))
99
- if page.new_record? || File.mtime(file_path) > page.updated_at
99
+ if page.new_record? || File.mtime(file_path) > page.updated_at || force_import
100
100
  attributes = YAML.load_file(file_path).try(:symbolize_keys!) || { }
101
101
  page.label = attributes[:label] || slug.titleize
102
102
  page.layout = site.layouts.find_by_identifier(attributes[:layout]) || parent.try(:layout)
103
103
  page.target_page = site.pages.find_by_full_path(attributes[:target_page])
104
- page.is_published = attributes[:is_published].present?? attributes[:is_published] : true
104
+ page.is_published = attributes[:is_published].nil?? true : attributes[:is_published]
105
105
  page.position = attributes[:position] if attributes[:position]
106
106
  end
107
107
  elsif page.new_record?
@@ -115,7 +115,7 @@ module ComfortableMexicanSofa::Fixtures
115
115
  Dir.glob("#{path}/*.html").each do |file_path|
116
116
  identifier = file_path.split('/').last.gsub(/\.html$/, '')
117
117
  blocks_to_clear.delete(identifier)
118
- if page.new_record? || File.mtime(file_path) > page.updated_at
118
+ if page.new_record? || File.mtime(file_path) > page.updated_at || force_import
119
119
  blocks_attributes << {
120
120
  :identifier => identifier,
121
121
  :content => File.open(file_path).read
@@ -157,7 +157,7 @@ module ComfortableMexicanSofa::Fixtures
157
157
  page_ids.uniq
158
158
  end
159
159
 
160
- def self.import_snippets(to_site, from_folder = nil)
160
+ def self.import_snippets(to_site, from_folder = nil, force_import = false)
161
161
  site = Cms::Site.find_or_create_by_identifier(to_site)
162
162
  unless path = find_fixtures_path((from_folder || to_site), 'snippets')
163
163
  ComfortableMexicanSofa.logger.warn('Cannot find Snippet fixtures')
@@ -171,7 +171,7 @@ module ComfortableMexicanSofa::Fixtures
171
171
 
172
172
  # updating attributes
173
173
  if File.exists?(file_path = File.join(path, "_#{identifier}.yml"))
174
- if snippet.new_record? || File.mtime(file_path) > snippet.updated_at
174
+ if snippet.new_record? || File.mtime(file_path) > snippet.updated_at || force_import
175
175
  attributes = YAML.load_file(file_path).try(:symbolize_keys!) || { }
176
176
  snippet.label = attributes[:label] || identifier.titleize
177
177
  end
@@ -181,7 +181,7 @@ module ComfortableMexicanSofa::Fixtures
181
181
 
182
182
  # updating content
183
183
  if File.exists?(file_path = File.join(path, 'content.html'))
184
- if snippet.new_record? || File.mtime(file_path) > snippet.updated_at
184
+ if snippet.new_record? || File.mtime(file_path) > snippet.updated_at || force_import
185
185
  snippet.content = File.open(file_path).read
186
186
  end
187
187
  end
@@ -286,4 +286,4 @@ protected
286
286
  File.exists?(path) ? path : nil
287
287
  end
288
288
 
289
- end
289
+ end
@@ -1,7 +1,3 @@
1
1
  module ComfortableMexicanSofa
2
- VERSION = begin
3
- IO.read(File.join(File.dirname(__FILE__), '/../../VERSION')).chomp
4
- rescue
5
- 'UNKNOWN'
6
- end
2
+ VERSION = "1.7.3"
7
3
  end
@@ -15,7 +15,11 @@ module ComfortableMexicanSofa::ViewMethods
15
15
  # Content of a snippet. Example:
16
16
  # cms_snippet_content(:my_snippet)
17
17
  def cms_snippet_content(identifier, cms_site = nil)
18
- return '' unless cms_site ||= (@cms_site || Cms::Site.find_site(request.host.downcase, request.fullpath))
18
+ unless cms_site
19
+ host, path = request.host.downcase, request.fullpath if respond_to?(:request) && request
20
+ cms_site ||= (@cms_site || Cms::Site.find_site(host, path))
21
+ end
22
+ return '' unless cms_site
19
23
  case identifier
20
24
  when Cms::Snippet
21
25
  snippet = identifier
@@ -9,8 +9,10 @@ namespace :comfortable_mexican_sofa do
9
9
  desc 'Import Fixture data into database (options: FROM=folder_name TO=site_identifier)'
10
10
 
11
11
  task :import => :environment do
12
- to = ENV['TO'] || ENV['FROM']
13
- from = ENV['FROM']
12
+ to = ENV['TO'] || ENV['FROM']
13
+ from = ENV['FROM']
14
+ force_reload = ENV['FORCE'].try(:downcase) != 'false'
15
+
14
16
 
15
17
  puts "Importing CMS Fixtures from Folder [#{from}] to Site [#{to}] ..."
16
18
 
@@ -18,7 +20,7 @@ namespace :comfortable_mexican_sofa do
18
20
  logger_org = ComfortableMexicanSofa.logger
19
21
  ComfortableMexicanSofa.logger = Logger.new(STDOUT)
20
22
 
21
- ComfortableMexicanSofa::Fixtures.import_all(to, from)
23
+ ComfortableMexicanSofa::Fixtures.import_all(to, from, force_reload)
22
24
 
23
25
  ComfortableMexicanSofa.logger = logger_org
24
26
  end
@@ -12,5 +12,4 @@ gem 'coffee-rails', '>= 3.1.0'
12
12
 
13
13
  group :test do
14
14
  gem 'sqlite3'
15
- gem 'jeweler'
16
15
  end
@@ -12,5 +12,4 @@ gem 'coffee-rails', '>= 3.1.0'
12
12
 
13
13
  group :test do
14
14
  gem 'sqlite3'
15
- gem 'jeweler'
16
15
  end
@@ -12,5 +12,4 @@ gem 'coffee-rails', '~> 4.0.0.beta1'
12
12
 
13
13
  group :test do
14
14
  gem 'sqlite3'
15
- gem 'jeweler'
16
15
  end
@@ -118,16 +118,21 @@ class CmsSiteTest < ActiveSupport::TestCase
118
118
 
119
119
  assert_equal site_a, Cms::Site.find_site('test.host')
120
120
  assert_equal site_a, Cms::Site.find_site('test.host', '/some/path')
121
+ assert_equal site_a, Cms::Site.find_site('test.host', '/some/path')
121
122
  assert_equal nil, Cms::Site.find_site('test99.host', '/some/path')
122
123
 
123
124
  assert_equal nil, Cms::Site.find_site('test2.host')
124
125
  assert_equal nil, Cms::Site.find_site('test2.host', '/some/path')
125
126
  assert_equal site_b, Cms::Site.find_site('test2.host', '/en')
126
- assert_equal site_b, Cms::Site.find_site('test2.host', '/en/some/path')
127
+ assert_equal site_b, Cms::Site.find_site('test2.host', '/en?a=b')
128
+ assert_equal site_b, Cms::Site.find_site('test2.host', '/en/some/path?a=b')
129
+
127
130
  assert_equal nil, Cms::Site.find_site('test2.host', '/english/some/path')
128
131
 
129
132
  assert_equal site_c, Cms::Site.find_site('test2.host', '/fr')
133
+ assert_equal site_c, Cms::Site.find_site('test2.host', '/fr?a=b')
130
134
  assert_equal site_c, Cms::Site.find_site('test2.host', '/fr/some/path')
135
+ assert_equal site_c, Cms::Site.find_site('test2.host', '/fr/some/path?a=b')
131
136
  end
132
137
 
133
138
  def test_find_site_with_site_alias
@@ -6,20 +6,38 @@ class ViewMethodsTest < ActionView::TestCase
6
6
 
7
7
  class ::HelpersTestController < ActionController::Base
8
8
  helper { def hello; 'hello' end }
9
+
9
10
  def test_cms_snippet_content
10
11
  render :inline => '<%= cms_snippet_content(:default) %>'
11
12
  end
13
+
12
14
  def test_cms_page_content
13
15
  @cms_page = Cms::Page.root
14
16
  render :inline => '<%= cms_page_content(:default_field_text) %>'
15
17
  end
16
18
  end
19
+
20
+ class ::HelperTestMailer < ActionMailer::Base
21
+ def test_cms_snippet_content_in_mailer
22
+ mail(:to => "a@test.com", :subject => "test") do |format|
23
+ format.text { render :inline => '<%= cms_snippet_content(:default) %>' }
24
+ end
25
+ end
26
+ end
17
27
 
18
28
  # Simulating a call and getting resulting output
19
29
  def action_result(action)
20
30
  HelpersTestController.action(action).call(ActionController::TestRequest.new.env).last.body
21
31
  end
22
-
32
+
33
+ def mail_result(mail)
34
+ HelperTestMailer.send(mail).body.to_s
35
+ end
36
+
37
+ def test_cms_snippet_content_in_mailer
38
+ assert_equal 'default_snippet_content', mail_result('test_cms_snippet_content_in_mailer')
39
+ end
40
+
23
41
  def test_cms_snippet_content
24
42
  assert_equal 'default_snippet_content', action_result('test_cms_snippet_content')
25
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-02 00:00:00.000000000 Z
13
+ date: 2013-03-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -156,20 +156,19 @@ dependencies:
156
156
  - - ! '>='
157
157
  - !ruby/object:Gem::Version
158
158
  version: 3.1.0
159
- description: ''
160
- email: oleg@theworkinggroup.ca
159
+ description: ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications
160
+ email:
161
+ - oleg@khabarov.ca
161
162
  executables: []
162
163
  extensions: []
163
- extra_rdoc_files:
164
- - LICENSE
165
- - README.md
164
+ extra_rdoc_files: []
166
165
  files:
166
+ - .gitignore
167
167
  - .travis.yml
168
168
  - Gemfile
169
169
  - LICENSE
170
170
  - README.md
171
171
  - Rakefile
172
- - VERSION
173
172
  - app/assets/images/comfortable_mexican_sofa/arrow_bottom.gif
174
173
  - app/assets/images/comfortable_mexican_sofa/arrow_right.gif
175
174
  - app/assets/images/comfortable_mexican_sofa/bootstrap/glyphicons-halflings-white.png
@@ -439,9 +438,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
439
438
  - - ! '>='
440
439
  - !ruby/object:Gem::Version
441
440
  version: '0'
442
- segments:
443
- - 0
444
- hash: 2694321573607195803
445
441
  required_rubygems_version: !ruby/object:Gem::Requirement
446
442
  none: false
447
443
  requirements:
@@ -453,5 +449,5 @@ rubyforge_project:
453
449
  rubygems_version: 1.8.23
454
450
  signing_key:
455
451
  specification_version: 3
456
- summary: ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications
452
+ summary: CMS Engine for Rails 3 apps
457
453
  test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.7.1