caboose-cms 0.8.23 → 0.8.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04babeb3481e1edadccc8c132eb1c7409c2f368a
4
- data.tar.gz: 113cfbb71e45cc6b767f41c041cc4b9058b4108a
3
+ metadata.gz: c4d98086ca3a0c8138bbc8e6d05e741c5e583eee
4
+ data.tar.gz: 94ea06669bf9ffa4ddb80718858a9f96bdd91965
5
5
  SHA512:
6
- metadata.gz: f37dd6e8abf32c8b9d958127e20c2640d70fc0a25a3016c9761b23cf6b40881cd994692a83ea38e4f1a445b288efa3dd3ffb99b523ed6a2660bc7290f55109cb
7
- data.tar.gz: 57eec1e4319bf58e2ffaf0b9e812c05cd69c3b75051e97f513907b2fa81dc3e7ebd88a9ff49f9ebd4084989d11a6fb67c4f9857f606e39ff15c3824cd6688bf1
6
+ metadata.gz: 172ae4c4a6e18388c7469e3a78f805aa7bdcb58ffac2b58c0f18c2d999474d2f15693df5f9d20d77ef3251eae864f19d5d9a47f1f1129516b81638993e6eb3af
7
+ data.tar.gz: 038676696d6bd3dbfa7de7de2e516979a24fb74059d20c40a5540fa91e2f7a1bfcfe035abe284f5b4fdeffcc061d54158d730b15a871b317543d07625a901e81
@@ -394,31 +394,42 @@ class Caboose::Page < ActiveRecord::Base
394
394
  end
395
395
 
396
396
  def duplicate(site_id, parent_id, duplicate_children = false, block_type_id = nil, child_block_type_id = nil)
397
- p = Caboose::Page.create(
398
- :site_id => site_id ,
399
- :parent_id => parent_id ,
400
- :title => self.title ,
401
- :menu_title => self.menu_title ,
402
- :slug => self.slug ,
403
- :alias => self.alias ,
404
- :uri => self.uri ,
405
- :redirect_url => self.redirect_url ,
406
- :hide => self.hide ,
407
- :content_format => self.content_format ,
408
- :custom_css => self.custom_css ,
409
- :custom_js => self.custom_js ,
410
- :linked_resources => self.linked_resources ,
411
- :layout => self.layout ,
412
- :sort_order => self.sort_order ,
413
- :custom_sort_children => self.custom_sort_children ,
414
- :seo_title => self.seo_title ,
415
- :meta_keywords => self.meta_keywords ,
416
- :meta_description => self.meta_description ,
417
- :meta_robots => self.meta_robots ,
418
- :canonical_url => self.canonical_url ,
419
- :fb_description => self.fb_description ,
420
- :gp_description => self.gp_description
421
- )
397
+
398
+ if parent_id.to_i == -1
399
+ p = Caboose::Page.index_page(site_id)
400
+ p.children.destroy_all
401
+ #if self.site_id != site_id
402
+ # self.page_tags.destroy_all
403
+ # self.page_custom_field_values.destroy_all
404
+ # self.page_permissions.destroy_all
405
+ # self.block.destroy
406
+ #end
407
+ else
408
+ p = Caboose::Page.create(:site_id => site_id, :parent_id => parent_id)
409
+ end
410
+
411
+ p.title = self.title
412
+ p.menu_title = self.menu_title
413
+ p.slug = self.slug
414
+ p.alias = self.alias
415
+ p.uri = self.uri
416
+ p.redirect_url = self.redirect_url
417
+ p.hide = self.hide
418
+ p.content_format = self.content_format
419
+ p.custom_css = self.custom_css
420
+ p.custom_js = self.custom_js
421
+ p.linked_resources = self.linked_resources
422
+ p.layout = self.layout
423
+ p.sort_order = self.sort_order
424
+ p.custom_sort_children = self.custom_sort_children
425
+ p.seo_title = self.seo_title
426
+ p.meta_keywords = self.meta_keywords
427
+ p.meta_description = self.meta_description
428
+ p.meta_robots = self.meta_robots
429
+ p.canonical_url = self.canonical_url
430
+ p.fb_description = self.fb_description
431
+ p.gp_description = self.gp_description
432
+ p.save
422
433
 
423
434
  self.page_tags.each{ |tag| Caboose::PageTag.create(:page_id => p.id, :tag => tag.tag) }
424
435
 
@@ -58,6 +58,7 @@ function duplicate_page(site, parent, block_type, duplicate_children, child_bloc
58
58
  duplicate_page(site, { id: so.val(), title: so.html() });
59
59
  });
60
60
  select.append($('<option/>').html("-- Select a parent page --"));
61
+ select.append($('<option/>').val('-1').html("-- Set as new home page --"));
61
62
  $.each(pages, function(i, p) { select.append($('<option/>').val(p.value).html(p.text)); });
62
63
  $('#message').empty().append($('<p/>').addClass('note')
63
64
  <% if @logged_in_user.is_super_admin? %>.append("You are duplicating this page into the \"" + site.name + "\" site.<br />")<% end %>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.23'
2
+ VERSION = '0.8.24'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.23
4
+ version: 0.8.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry