Skip to content

Commit 55675e3

Browse files
author
Angelo Dini
committed
add basic cut_plugin mechanisms
1 parent fa0a128 commit 55675e3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cms/static/cms/js/plugins/cms.placeholders.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ $(document).ready(function () {
351351
'add_plugin': '',
352352
'edit_plugin': '',
353353
'move_plugin': '',
354-
'copy_plugin': ''
354+
'copy_plugin': '',
355+
'cut_plugin': ''
355356
}
356357
},
357358

@@ -558,7 +559,7 @@ $(document).ready(function () {
558559
$('.cms_btn-publish').addClass('cms_btn-publish-active').parent().show();
559560
},
560561

561-
copyPlugin: function () {
562+
copyPlugin: function (cut) {
562563
var that = this;
563564
var data = {
564565
'source_placeholder_id': this.options.placeholder_id,
@@ -569,9 +570,12 @@ $(document).ready(function () {
569570
'csrfmiddlewaretoken': this.csrf
570571
};
571572

573+
// determine if we are using copy or cut
574+
var url = (cut) ? this.options.urls.cut_plugin : this.options.urls.copy_plugin;
575+
572576
$.ajax({
573577
'type': 'POST',
574-
'url': this.options.urls.copy_plugin,
578+
'url': url,
575579
'data': data,
576580
'success': function () {
577581
// refresh browser after success

cms/templates/cms/toolbar/plugin.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'edit_plugin': '{% url "admin:cms_page_edit_plugin" instance.pk %}',
2222
'move_plugin': '{% url "admin:cms_page_move_plugin" %}',
2323
'copy_plugin': '{% url "admin:cms_page_copy_plugins" %}',
24+
{% comment %}'cut_plugin': '{% url "admin:cms_page_cut_plugins" %}',{% endcomment %}
2425
'stack_plugin': ''
2526
}
2627
});

0 commit comments

Comments
 (0)