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 +4 -4
- data/app/models/caboose/page.rb +36 -25
- data/app/views/caboose/pages/admin_duplicate_form.html.erb +1 -0
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4d98086ca3a0c8138bbc8e6d05e741c5e583eee
|
4
|
+
data.tar.gz: 94ea06669bf9ffa4ddb80718858a9f96bdd91965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172ae4c4a6e18388c7469e3a78f805aa7bdcb58ffac2b58c0f18c2d999474d2f15693df5f9d20d77ef3251eae864f19d5d9a47f1f1129516b81638993e6eb3af
|
7
|
+
data.tar.gz: 038676696d6bd3dbfa7de7de2e516979a24fb74059d20c40a5540fa91e2f7a1bfcfe035abe284f5b4fdeffcc061d54158d730b15a871b317543d07625a901e81
|
data/app/models/caboose/page.rb
CHANGED
@@ -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
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
:
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
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 %>
|
data/lib/caboose/version.rb
CHANGED