caboose-cms 0.4.66 → 0.4.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/#Untitled-1# +6 -0
- data/app/assets/javascripts/caboose/admin_page_edit_content.js +4 -4
- data/app/controllers/caboose/blocks_controller.rb +3 -3
- data/app/controllers/caboose/pages_controller.rb +2 -2
- data/app/models/caboose/block_type.rb +1 -0
- data/app/models/caboose/core_plugin.rb +8 -7
- data/app/models/caboose/page.rb +24 -24
- data/app/models/caboose/rich_text_block_parser.rb +4 -2
- data/app/models/caboose/schema.rb +1 -0
- data/app/views/caboose/pages/admin_edit_content.html.erb +6 -6
- data/lib/caboose/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDI3Y2JhNzJiNjFmODc0MjE1NTFhZjczZTgyNjFjYzZlZmE2N2M3ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTU5YmViMTViMDRiYTMwOTQxMTMwMTAwMmMzNWRkNGYyYTY2Yzc3Ng==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjU4ZmFiMzk2YThkYWJlYjdlOWM4MTU4NTk0YzExZmI0ZTQ4MDQ3ODcwYjdl
|
10
|
+
N2Y2YmNmYTAzZmE1N2Q5MzA5Nzg1M2MxMmQyMzQ3NGUzNTFmYzY5ZDEwYTFi
|
11
|
+
NjY1MjExNzczYjc2NThiZDVjN2U1YjVlZjJlYTUyZGY3YTY5NDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmYwOGU2YzgwM2NmNjk5OWM5MTI3OTViMjg0OGUxOWQyMmQ5NDMwZTFhZThm
|
14
|
+
MGRjY2IxNTU3MmFlZmI0MDFjYjZkYTE0MWM2YmMxNDJhM2UwMGY5YjY5ZjM4
|
15
|
+
MDU4N2I3MDM3M2NhY2M2NTBmMGJjZTc1OWI2MGFlZmZhYTMzZDM=
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<h1>RELOCATING TO BOZEMAN</h1>
|
2
|
+
<p>Relocating to Bozeman? Moving a Business? The Chamber is here to answer all of your questions to make your move as successful and painless as possible. Business owners considering moving or starting a business in Bozeman will find many helpful resources on our <a href="http://www.bozemanchamber.com/business/index.asp">Business Services</a> Page. For general information about Bozeman and the surrounding communities, please visit our <a href="http://www.bozemancvb.com/" target="_blank">Convention and Visitor Bureau</a> site.<br /><br />Bozeman's economy is largely supported by agriculture but tourism and the high tech industry are making a big splash in the area. One in every 10 new businesses formed in Montana was formed in Gallatin County which makes this area 2nd in business growth in the state. Bozeman is also home to Montana State University which was established in 1893. Because of these two things, Bozeman and the Gallatin Valley remains a strong community for large and small business alike. We also have a wide diversity of the different types of businesses we support from retail and tourism to manufacturing and agriculture.</p>
|
3
|
+
<div id="relocationGuide">
|
4
|
+
<p><a title="Download 2014 Relocation Guide" href="http://www.bozemanchamber.com/images/mc_temp/2014-bacc-relocation-guide.pdf"><img src="http://www.bozemanchamber.com/images/mc_temp/relocation-guide-web-badge.png" alt="Download PDF version of 2014 Bozeman Relocation Guide" /></a></p>
|
5
|
+
<h3>Read the 2014 Bozeman Relocation Guide Online…</h3>
|
6
|
+
</div>
|
@@ -196,12 +196,12 @@ PageContentController.prototype = {
|
|
196
196
|
|
197
197
|
var show_mouseover = true;
|
198
198
|
if (b.children && b.children.length > 0)
|
199
|
-
{
|
200
|
-
$.each(b.children, function(i, b2) {
|
201
|
-
if (b2.
|
199
|
+
{
|
200
|
+
$.each(b.children, function(i, b2) {
|
201
|
+
if (b2.field_type == 'block')
|
202
202
|
show_mouseover = false;
|
203
203
|
that.set_clickable_helper(b2, b.id, b.allow_child_blocks);
|
204
|
-
});
|
204
|
+
});
|
205
205
|
}
|
206
206
|
if (b.allow_child_blocks)
|
207
207
|
{
|
@@ -57,10 +57,10 @@ module Caboose
|
|
57
57
|
blocks = []
|
58
58
|
if params[:id]
|
59
59
|
b = Block.find(params[:id])
|
60
|
-
blocks << { 'id' => b.id, 'children' => admin_tree_helper(b) }
|
60
|
+
blocks << { 'id' => b.id, 'children' => admin_tree_helper(b), 'field_type' => b.block_type.field_type }
|
61
61
|
else
|
62
62
|
Block.where("parent_id is null and page_id = ?", params[:page_id]).reorder(:sort_order).all.each do |b|
|
63
|
-
blocks << { 'id' => b.id, 'allow_child_blocks' => b.block_type.allow_child_blocks, 'children' => admin_tree_helper(b) }
|
63
|
+
blocks << { 'id' => b.id, 'allow_child_blocks' => b.block_type.allow_child_blocks, 'children' => admin_tree_helper(b), 'field_type' => b.block_type.field_type }
|
64
64
|
end
|
65
65
|
end
|
66
66
|
render :json => blocks
|
@@ -69,7 +69,7 @@ module Caboose
|
|
69
69
|
def admin_tree_helper(b)
|
70
70
|
arr = []
|
71
71
|
b.children.each do |b2|
|
72
|
-
arr << { 'id' => b2.id, 'allow_child_blocks' => b2.block_type.allow_child_blocks, 'children' => admin_tree_helper(b2) }
|
72
|
+
arr << { 'id' => b2.id, 'allow_child_blocks' => b2.block_type.allow_child_blocks, 'children' => admin_tree_helper(b2), 'field_type' => b2.block_type.field_type }
|
73
73
|
end
|
74
74
|
return arr
|
75
75
|
end
|
@@ -20,7 +20,7 @@ module Caboose
|
|
20
20
|
end
|
21
21
|
|
22
22
|
user = logged_in_user
|
23
|
-
if !user.is_allowed(page, 'view')
|
23
|
+
if !user.is_allowed(page, 'view')
|
24
24
|
if user.id == User::LOGGED_OUT_USER_ID
|
25
25
|
redirect_to "/modal/login?return_url=" + URI.encode(request.fullpath)
|
26
26
|
return
|
@@ -35,7 +35,7 @@ module Caboose
|
|
35
35
|
return
|
36
36
|
end
|
37
37
|
|
38
|
-
page = Caboose.plugin_hook('page_content', page)
|
38
|
+
page = Caboose.plugin_hook('page_content', page)
|
39
39
|
@page = page
|
40
40
|
@user = user
|
41
41
|
@editmode = !params['edit'].nil? && user.is_allowed('pages', 'edit') ? true : false
|
@@ -21,13 +21,14 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
|
|
21
21
|
'children' => []
|
22
22
|
}
|
23
23
|
|
24
|
-
item['children'] << { 'id' => 'users' , 'text' => 'Users'
|
25
|
-
item['children'] << { 'id' => 'roles' , 'text' => 'Roles'
|
26
|
-
item['children'] << { 'id' => 'permissions' , 'text' => 'Permissions'
|
27
|
-
item['children'] << { 'id' => 'sites' , 'text' => 'Sites'
|
28
|
-
item['children'] << { 'id' => 'blocktypes' , 'text' => 'AB Test Variants'
|
29
|
-
item['children'] << { 'id' => 'variables' , 'text' => 'Variables'
|
30
|
-
item['children'] << { 'id' => 'blocktypes' , 'text' => 'Block Types'
|
24
|
+
item['children'] << { 'id' => 'users' , 'text' => 'Users' , 'href' => '/admin/users' , 'modal' => false } if user.is_allowed('users' , 'view')
|
25
|
+
item['children'] << { 'id' => 'roles' , 'text' => 'Roles' , 'href' => '/admin/roles' , 'modal' => false } if user.is_allowed('roles' , 'view')
|
26
|
+
item['children'] << { 'id' => 'permissions' , 'text' => 'Permissions' , 'href' => '/admin/permissions' , 'modal' => false } if user.is_allowed('permissions' , 'view')
|
27
|
+
item['children'] << { 'id' => 'sites' , 'text' => 'Sites' , 'href' => '/admin/sites' , 'modal' => false } if user.is_allowed('sites' , 'view')
|
28
|
+
item['children'] << { 'id' => 'blocktypes' , 'text' => 'AB Test Variants' , 'href' => '/admin/ab-variants' , 'modal' => false } if user.is_allowed('abvariants' , 'view')
|
29
|
+
item['children'] << { 'id' => 'variables' , 'text' => 'Variables' , 'href' => '/admin/settings' , 'modal' => false } if user.is_allowed('settings' , 'view')
|
30
|
+
item['children'] << { 'id' => 'blocktypes' , 'text' => 'Block Types' , 'href' => '/admin/block-types' , 'modal' => false } if user.is_allowed('blocktypes' , 'view')
|
31
|
+
item['children'] << { 'id' => 'redirects' , 'text' => 'Permanent Redirects' , 'href' => '/admin/redirects' , 'modal' => false } if user.is_allowed('redirects' , 'view')
|
31
32
|
|
32
33
|
nav << item if item['children'].count > 0
|
33
34
|
|
data/app/models/caboose/page.rb
CHANGED
@@ -7,30 +7,30 @@ class Caboose::Page < ActiveRecord::Base
|
|
7
7
|
has_many :children, :class_name => 'Caboose::Page', :foreign_key => 'parent_id', :order => 'sort_order, title'
|
8
8
|
has_many :page_permissions
|
9
9
|
has_many :blocks, :order => 'sort_order'
|
10
|
-
attr_accessible :id,
|
11
|
-
:site_id,
|
12
|
-
:parent_id,
|
13
|
-
:title,
|
14
|
-
:menu_title,
|
15
|
-
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:seo_title,
|
28
|
-
:meta_keywords,
|
29
|
-
:meta_description,
|
30
|
-
:meta_robots,
|
31
|
-
:canonical_url,
|
32
|
-
:
|
33
|
-
:
|
10
|
+
attr_accessible :id ,
|
11
|
+
:site_id ,
|
12
|
+
:parent_id ,
|
13
|
+
:title ,
|
14
|
+
:menu_title ,
|
15
|
+
:slug ,
|
16
|
+
:alias ,
|
17
|
+
:uri ,
|
18
|
+
:redirect_url ,
|
19
|
+
:hide ,
|
20
|
+
:content_format ,
|
21
|
+
:custom_css ,
|
22
|
+
:custom_js ,
|
23
|
+
:linked_resources ,
|
24
|
+
:layout ,
|
25
|
+
:sort_order ,
|
26
|
+
:custom_sort_children ,
|
27
|
+
:seo_title ,
|
28
|
+
:meta_keywords ,
|
29
|
+
:meta_description ,
|
30
|
+
:meta_robots ,
|
31
|
+
:canonical_url ,
|
32
|
+
:fb_description ,
|
33
|
+
:gp_description
|
34
34
|
|
35
35
|
CONTENT_FORMAT_HTML = 1
|
36
36
|
CONTENT_FORMAT_TEXT = 2
|
@@ -4,8 +4,9 @@ module Caboose
|
|
4
4
|
|
5
5
|
def self.parse(block, html, domain)
|
6
6
|
|
7
|
+
random_string = (0...10).map { ('a'..'z').to_a[rand(26)] }.join
|
7
8
|
html = html.strip
|
8
|
-
page = Nokogiri::HTML("<div>#{html}</div>")
|
9
|
+
page = Nokogiri::HTML("<div class='#{random_string}'>#{html}</div>")
|
9
10
|
if page.css('div').children.count == 1
|
10
11
|
block.value = html
|
11
12
|
block.save
|
@@ -13,7 +14,8 @@ module Caboose
|
|
13
14
|
end
|
14
15
|
|
15
16
|
nodes = []
|
16
|
-
page.css(
|
17
|
+
page.css("div.#{random_string}").children.each do |node|
|
18
|
+
#Caboose.log(node.to_s)
|
17
19
|
case node.name.downcase
|
18
20
|
when 'h1' then nodes << node
|
19
21
|
when 'h2' then nodes << node
|
@@ -84,6 +84,7 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
84
84
|
[ :parent_id , :integer ],
|
85
85
|
[ :name , :string ],
|
86
86
|
[ :description , :string ],
|
87
|
+
[ :is_global , :boolean , { :default => false }],
|
87
88
|
[ :block_type_category_id , :integer , { :default => 2 }],
|
88
89
|
[ :render_function , :text ],
|
89
90
|
[ :use_render_function , :boolean , { :default => false }],
|
@@ -24,12 +24,12 @@
|
|
24
24
|
.select_handle { display: none; }
|
25
25
|
.sort_handle { display: none; }
|
26
26
|
.delete_handle { display: none; }
|
27
|
-
.block_over .select_handle { display: block; position: relative; }
|
28
|
-
.block_over .sort_handle { display: block; position: relative; }
|
29
|
-
.block_over .delete_handle { display: block; position: relative; }
|
30
|
-
.block_over .select_handle span { position: absolute; top: 0; right: 36px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
31
|
-
.block_over .sort_handle span { position: absolute; top: 0; right: 18px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
32
|
-
.block_over .delete_handle span { position: absolute; top: 0; right: 0px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
27
|
+
.block_over > .select_handle { display: block; position: relative; }
|
28
|
+
.block_over > .sort_handle { display: block; position: relative; }
|
29
|
+
.block_over > .delete_handle { display: block; position: relative; }
|
30
|
+
.block_over > .select_handle span { position: absolute; top: 0; right: 36px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
31
|
+
.block_over > .sort_handle span { position: absolute; top: 0; right: 18px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
32
|
+
.block_over > .delete_handle span { position: absolute; top: 0; right: 0px; width: 18px; height: 18px; background-color: #fff; border: #ccc 1px solid; }
|
33
33
|
|
34
34
|
.selected { background: #fff799; }
|
35
35
|
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -188,6 +188,7 @@ files:
|
|
188
188
|
- app/assets/images/caboose/modal_overlay.png
|
189
189
|
- app/assets/images/caboose/password_image.png
|
190
190
|
- app/assets/images/caboose/search.png
|
191
|
+
- app/assets/javascripts/caboose/#Untitled-1#
|
191
192
|
- app/assets/javascripts/caboose/admin.js
|
192
193
|
- app/assets/javascripts/caboose/admin_block_edit.js
|
193
194
|
- app/assets/javascripts/caboose/admin_page_edit_content.js
|