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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTU4MjVlNzQyYTQyM2RkY2NkZjY5YTljYWY0YjVjOTNiYTMzMjMwNw==
4
+ NDI3Y2JhNzJiNjFmODc0MjE1NTFhZjczZTgyNjFjYzZlZmE2N2M3ZQ==
5
5
  data.tar.gz: !binary |-
6
- NzE3MmM0MjZhYTdkMzdiNzBiMmQwYmRmMzI2OGRkNGQ5MDJkNWE2OQ==
6
+ ZTU5YmViMTViMDRiYTMwOTQxMTMwMTAwMmMzNWRkNGYyYTY2Yzc3Ng==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NzQwNmE0YTUzMzYwZmQzMGQ5Y2I5MmY3YjMxY2YxN2M5YTZhNjFmY2ZhNmY3
10
- YWMwNzBjZmMzZDdlZWQ2NTVmNDUzMjRiYzc2ODIwZWQ2MDNkYWYxNTY4NWNj
11
- YWQ2ZDkxYWJiY2I0N2M3ODFkMGI0MmNiNmI4YzgxY2ZmNTVjODI=
9
+ YjU4ZmFiMzk2YThkYWJlYjdlOWM4MTU4NTk0YzExZmI0ZTQ4MDQ3ODcwYjdl
10
+ N2Y2YmNmYTAzZmE1N2Q5MzA5Nzg1M2MxMmQyMzQ3NGUzNTFmYzY5ZDEwYTFi
11
+ NjY1MjExNzczYjc2NThiZDVjN2U1YjVlZjJlYTUyZGY3YTY5NDA=
12
12
  data.tar.gz: !binary |-
13
- N2ZhMzJhNGE4N2JhNmRmZDM3NjE3NjkzNTVkOWUzMDk1M2ZmZGZiODhmOGU1
14
- MzZkYmEyMDE0ZWZkZjc1OThiZmJiN2RiNmMzY2ZkYTNmYjUzYjQ0NjU4NDE0
15
- Y2FkODY5MDNhM2QzNzMyNTY1MTVhODc2ZTRkOWQ0MWU2M2Y5Y2Y=
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&nbsp;<a href="http://www.bozemanchamber.com/business/index.asp">Business Services</a>&nbsp;Page. For general information about Bozeman and the surrounding communities, please visit our&nbsp;<a href="http://www.bozemancvb.com/" target="_blank">Convention and Visitor Bureau</a>&nbsp;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&hellip;</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.block_type_id = 34)
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
@@ -10,6 +10,7 @@ class Caboose::BlockType < ActiveRecord::Base
10
10
  :parent_id,
11
11
  :name,
12
12
  :description,
13
+ :is_global,
13
14
  :block_type_category_id,
14
15
  :use_render_function,
15
16
  :use_render_function_for_layout,
@@ -21,13 +21,14 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
21
21
  'children' => []
22
22
  }
23
23
 
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')
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
 
@@ -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
- # :content, # Changed from column in pages to blocks
16
- :blocks,
17
- :slug,
18
- :alias,
19
- :uri,
20
- :redirect_url,
21
- :hide,
22
- :content_format,
23
- :custom_css,
24
- :custom_js,
25
- :linked_resources,
26
- :layout,
27
- :seo_title, # 70 chars
28
- :meta_keywords,
29
- :meta_description, # 156 chars
30
- :meta_robots, # Multi-select options: none, noindex, nofollow, nosnippet, noodp, noarchive
31
- :canonical_url,
32
- :facebook_description, # defaults to meta_description
33
- :googleplus_description # defaults to meta_description
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('div').children.each do |node|
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
 
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.66'
2
+ VERSION = '0.4.67'
3
3
  end
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.66
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-03 00:00:00.000000000 Z
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