{% load i18n sekizai_tags cms_tags %}{% load url from future %}
{% addtoblock "js" %}
<script type="text/javascript">
(function($) {
// CMS.$ will be passed for $
$(document).ready(function () {
	new CMS.PlaceholderItem('#cms_plugin-{{ instance.pk }}', {
		'type': 'plugin',
		'page_language': '{{ LANGUAGE_CODE }}',
		'placeholder_id': '{{ instance.placeholder.id }}',
		'plugin_type': '{{ instance.plugin_type }}',
		'plugin_name': '{{ instance.get_plugin_name }}',
		'plugin_id': '{{ instance.pk }}',
		'plugin_language': '{{ instance.language }}',
		'plugin_parent': '{{ instance.parent_id }}',
		'plugin_order': '{{ instance.plugin_order }}',
		'plugin_breadcrumb': {{ instance.get_breadcrumb_json }},
		'plugin_restriction': [{% for cls in allowed_child_classes %}"{{ cls }}"{% if not forloop.last %},{% endif %}{% endfor %}],
		'urls': {
			'add_plugin': '{% url "admin:cms_page_add_plugin" %}',
			'edit_plugin': '{% url "admin:cms_page_edit_plugin" instance.pk %}',
			'move_plugin': '{% url "admin:cms_page_move_plugin" %}',
			'copy_plugin': '{% url "admin:cms_page_copy_plugins" %}',
			'stack_plugin': ''
		}
	});
});
})(CMS.$);
</script>
{% endaddtoblock %}

<div id="cms_plugin-{{ instance.pk }}" class="cms_plugin">{{ rendered_content }}</div>