comfortable_mexican_sofa 1.0.47 → 1.0.48
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/cms_admin/base_controller.rb +4 -3
- data/app/controllers/cms_content_controller.rb +1 -1
- data/app/models/cms_page.rb +1 -0
- data/app/models/cms_upload.rb +1 -1
- data/app/views/cms_admin/pages/_form.html.erb +1 -1
- data/app/views/layouts/cms_admin.html.erb +1 -0
- data/comfortable_mexican_sofa.gemspec +2 -2
- data/config/initializers/comfortable_mexican_sofa.rb +12 -0
- data/lib/comfortable_mexican_sofa/configuration.rb +9 -1
- data/lib/comfortable_mexican_sofa/view_methods.rb +5 -2
- data/lib/tasks/comfortable_mexican_sofa.rake +3 -2
- data/public/javascripts/comfortable_mexican_sofa/cms.js +4 -4
- data/public/stylesheets/comfortable_mexican_sofa/structure.css +3 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.48
|
@@ -13,16 +13,17 @@ class CmsAdmin::BaseController < ActionController::Base
|
|
13
13
|
protected
|
14
14
|
|
15
15
|
def load_admin_cms_site
|
16
|
-
|
16
|
+
hostname = ComfortableMexicanSofa.config.override_host || request.host.downcase
|
17
|
+
@cms_site = CmsSite.find_by_hostname!(hostname)
|
17
18
|
|
18
19
|
rescue ActiveRecord::RecordNotFound
|
19
20
|
|
20
21
|
if ComfortableMexicanSofa.config.auto_manage_sites
|
21
22
|
if CmsSite.count == 0
|
22
|
-
@cms_site = CmsSite.create!(:label => 'Default Site', :hostname =>
|
23
|
+
@cms_site = CmsSite.create!(:label => 'Default Site', :hostname => hostname)
|
23
24
|
elsif CmsSite.count == 1
|
24
25
|
@cms_site = CmsSite.first
|
25
|
-
@cms_site.update_attribute(:hostname,
|
26
|
+
@cms_site.update_attribute(:hostname, hostname)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
@@ -22,7 +22,7 @@ class CmsContentController < ApplicationController
|
|
22
22
|
protected
|
23
23
|
|
24
24
|
def load_cms_site
|
25
|
-
@cms_site = CmsSite.find_by_hostname!(request.host.downcase)
|
25
|
+
@cms_site = CmsSite.find_by_hostname!(ComfortableMexicanSofa.config.override_host || request.host.downcase)
|
26
26
|
rescue ActiveRecord::RecordNotFound
|
27
27
|
render :text => 'Site Not Found', :status => 404
|
28
28
|
end
|
data/app/models/cms_page.rb
CHANGED
@@ -63,6 +63,7 @@ class CmsPage < ActiveRecord::Base
|
|
63
63
|
attributes[:cms_layout] = CmsLayout.load_from_file(site, attributes[:cms_layout])
|
64
64
|
attributes[:parent] = CmsPage.load_from_file(site, attributes[:parent])
|
65
65
|
attributes[:cms_site] = site
|
66
|
+
attributes[:target_page]= CmsPage.load_from_file(site, attributes[:target_page])
|
66
67
|
new(attributes)
|
67
68
|
rescue
|
68
69
|
raise "Failed to load from #{file_path}"
|
data/app/models/cms_upload.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class CmsUpload < ActiveRecord::Base
|
2
2
|
|
3
3
|
# -- AR Extensions --------------------------------------------------------
|
4
|
-
has_attached_file :file
|
4
|
+
has_attached_file :file, ComfortableMexicanSofa.config.upload_file_options
|
5
5
|
|
6
6
|
# -- Relationships --------------------------------------------------------
|
7
7
|
belongs_to :cms_site
|
@@ -6,6 +6,7 @@
|
|
6
6
|
<%= csrf_meta_tag %>
|
7
7
|
<%= stylesheet_link_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %>
|
8
8
|
<%= javascript_include_tag :cms, :cache => ('_cms' if ComfortableMexicanSofa.config.enable_caching) %>
|
9
|
+
<%= javascript_include_tag :tiny_mce %>
|
9
10
|
<%= yield :head %>
|
10
11
|
<%= cms_hook :html_head %>
|
11
12
|
</head>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{comfortable_mexican_sofa}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.48"
|
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{2011-03-
|
12
|
+
s.date = %q{2011-03-22}
|
13
13
|
s.description = %q{}
|
14
14
|
s.email = %q{oleg@theworkinggroup.ca}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,6 +32,18 @@ ComfortableMexicanSofa.configure do |config|
|
|
32
32
|
# to an environment with read-only filesystem (like Heroku) turn this setting off.
|
33
33
|
# config.enable_caching = true
|
34
34
|
|
35
|
+
# File uploads use Paperclip and can support filesystem or s3 uploads. Override
|
36
|
+
# the upload method and appropriate settings based on Paperclip. For S3 see:
|
37
|
+
# http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for
|
38
|
+
# filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3
|
39
|
+
# config.upload_file_options = {:storage => :filesystem}
|
40
|
+
|
41
|
+
# Override the host used to look up the active CmsSite. If you are not
|
42
|
+
# planning on using the site features, I recommend you set this override to
|
43
|
+
# limit unexpected "Site not found" errors when you try to hit app01.example.com
|
44
|
+
# instead of www.example.com.
|
45
|
+
# config.override_host = "www.example.com"
|
46
|
+
|
35
47
|
end
|
36
48
|
|
37
49
|
# Default credentials for ComfortableMexicanSofa::HttpAuth
|
@@ -27,6 +27,12 @@ class ComfortableMexicanSofa::Configuration
|
|
27
27
|
# Caching for css/js. For admin layout and ones for cms content. Enabled by default.
|
28
28
|
attr_accessor :enable_caching
|
29
29
|
|
30
|
+
# Upload settings
|
31
|
+
attr_accessor :upload_file_options
|
32
|
+
|
33
|
+
# Override the hostname when looking up which site to use
|
34
|
+
attr_accessor :override_host
|
35
|
+
|
30
36
|
# Configuration defaults
|
31
37
|
def initialize
|
32
38
|
@cms_title = 'ComfortableMexicanSofa MicroCMS'
|
@@ -37,6 +43,8 @@ class ComfortableMexicanSofa::Configuration
|
|
37
43
|
@auto_manage_sites = true
|
38
44
|
@disable_irb = true
|
39
45
|
@enable_caching = true
|
46
|
+
@upload_file_options = {}
|
47
|
+
@override_host = nil
|
40
48
|
end
|
41
49
|
|
42
|
-
end
|
50
|
+
end
|
@@ -44,13 +44,16 @@ ActionView::Helpers::AssetTagHelper.register_javascript_expansion :cms => [
|
|
44
44
|
'comfortable_mexican_sofa/jquery',
|
45
45
|
'comfortable_mexican_sofa/jquery-ui/jquery-ui',
|
46
46
|
'comfortable_mexican_sofa/rails',
|
47
|
-
'comfortable_mexican_sofa/tiny_mce/tiny_mce',
|
48
|
-
'comfortable_mexican_sofa/tiny_mce/jquery.tinymce',
|
49
47
|
'comfortable_mexican_sofa/plupload/plupload.min',
|
50
48
|
'comfortable_mexican_sofa/plupload/plupload.html5.min',
|
51
49
|
'comfortable_mexican_sofa/codemirror/codemirror.js',
|
52
50
|
'comfortable_mexican_sofa/cms'
|
53
51
|
]
|
52
|
+
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :tiny_mce => [
|
53
|
+
'comfortable_mexican_sofa/tiny_mce/tiny_mce',
|
54
|
+
'comfortable_mexican_sofa/tiny_mce/jquery.tinymce'
|
55
|
+
]
|
56
|
+
|
54
57
|
ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :cms => [
|
55
58
|
'comfortable_mexican_sofa/reset',
|
56
59
|
'comfortable_mexican_sofa/structure',
|
@@ -238,7 +238,8 @@ namespace :comfortable_mexican_sofa do
|
|
238
238
|
end
|
239
239
|
if should_write
|
240
240
|
|
241
|
-
attributes = page.attributes.slice('label', 'slug', 'full_path')
|
241
|
+
attributes = page.attributes.slice('label', 'slug', 'full_path', 'is_published')
|
242
|
+
attributes['targe_page'] = page.target_page.full_path if page.target_page
|
242
243
|
attributes['parent'] = page.parent.full_path if page.parent
|
243
244
|
attributes['cms_layout'] = page.cms_layout.slug
|
244
245
|
attributes['cms_blocks_attributes'] = page.cms_blocks_attributes.collect{|b| b.delete(:id) && b.stringify_keys}
|
@@ -280,4 +281,4 @@ namespace :comfortable_mexican_sofa do
|
|
280
281
|
task :all => [:layouts, :pages, :snippets]
|
281
282
|
|
282
283
|
end
|
283
|
-
end
|
284
|
+
end
|
@@ -145,15 +145,15 @@ $.CMS = function(){
|
|
145
145
|
|
146
146
|
enable_page_save_widget : function(){
|
147
147
|
$('#page_save input').attr('checked', $('input#cms_page_is_published').is(':checked'));
|
148
|
-
$('#page_save
|
148
|
+
$('#page_save button').html($('input#cms_page_submit').val());
|
149
149
|
|
150
|
-
$('#page_save
|
150
|
+
$('#page_save input').bind('click', function(){
|
151
151
|
$('input#cms_page_is_published').attr('checked', $(this).is(':checked'));
|
152
152
|
})
|
153
153
|
$('input#cms_page_is_published').bind('click', function(){
|
154
|
-
$('#page_save
|
154
|
+
$('#page_save input').attr('checked', $(this).is(':checked'));
|
155
155
|
})
|
156
|
-
$('#page_save
|
156
|
+
$('#page_save button').bind('click', function(){
|
157
157
|
$('input#cms_page_submit').click();
|
158
158
|
})
|
159
159
|
},
|
@@ -80,6 +80,7 @@ html, body {
|
|
80
80
|
|
81
81
|
/* -- Buttons ------------------------------------------------------------ */
|
82
82
|
a.button,
|
83
|
+
button,
|
83
84
|
input[type='button'],
|
84
85
|
input[type='submit'],
|
85
86
|
input[type='reset'],
|
@@ -100,6 +101,7 @@ table.formatted td.action_links a {
|
|
100
101
|
text-shadow: #f5f5f5 1px 1px;
|
101
102
|
}
|
102
103
|
a.button:hover,
|
104
|
+
button:hover,
|
103
105
|
input[type='button']:hover,
|
104
106
|
input[type='submit']:hover,
|
105
107
|
input[type='reset']:hover,
|
@@ -112,6 +114,7 @@ table.formatted td.action_links a:hover {
|
|
112
114
|
border-color: #484848;
|
113
115
|
}
|
114
116
|
a.button.big,
|
117
|
+
button,
|
115
118
|
input[type='button'],
|
116
119
|
input[type='submit'],
|
117
120
|
input[type='reset'],
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 48
|
9
|
+
version: 1.0.48
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Oleg Khabarov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-22 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -384,7 +384,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
384
384
|
requirements:
|
385
385
|
- - ">="
|
386
386
|
- !ruby/object:Gem::Version
|
387
|
-
hash:
|
387
|
+
hash: -3244962332587742397
|
388
388
|
segments:
|
389
389
|
- 0
|
390
390
|
version: "0"
|