Skip to content

Commit

Permalink
Merge pull request #5463 from vxsx/bugfix/script-template-tags
Browse files Browse the repository at this point in the history
Moved child-plugin-classes templates out of "js" sekizai block
  • Loading branch information
vxsx committed Jun 29, 2016
2 parents 3481558 + cc2a0e5 commit 04a6aec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
mode.
* Fixed a bug where users with limited permissions could not interact with
page tree dropdowns.
* Fixed a bug where Django Compressor could not be used on the sekizai ``js``
block.


=== 3.3.0 (2016-05-26) ===
Expand Down
8 changes: 5 additions & 3 deletions cms/templates/cms/toolbar/placeholder.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
{% load i18n l10n sekizai_tags %}

<div class="cms-placeholder cms-placeholder-{{ placeholder.pk|unlocalize }}"></div>
{% language request.toolbar.toolbar_language %}
<script id="cms-plugin-child-classes-{{ placeholder.pk|unlocalize }}" type="text/cms-template">
{% include request.toolbar.drag_item_menu_template %}
</script>
{% endlanguage %}

{% endspaceless %}{% addtoblock "js" %}
{% language request.toolbar.toolbar_language %}
Expand All @@ -20,8 +25,5 @@
}
}]);
</script>
<script id="cms-plugin-child-classes-{{ placeholder.pk|unlocalize }}" type="text/cms-template">
{% include request.toolbar.drag_item_menu_template %}
</script>
{% endlanguage %}
{% endaddtoblock %}
13 changes: 9 additions & 4 deletions cms/tests/test_toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,15 @@ def test_edit_render_placeholder(self):
response = detail_view(request, ex1.pk, template_string=template_text)
self.assertContains(
response,
'<h1><div class="cms-placeholder cms-placeholder-{0}"></div>\n'
'<div class="cms-plugin cms-plugin-{1}">{2}</div></h1>'.format(ex1.placeholder.pk,
plugin.pk, render_placeholder_body)
)
'<h1><div class="cms-placeholder cms-placeholder-{0}"></div>'.format(ex1.placeholder.pk))

self.assertContains(
response,
'<script id="cms-plugin-child-classes-{0}" type="text/cms-template">'.format(ex1.placeholder.pk))

self.assertContains(
response,
'<div class="cms-plugin cms-plugin-{0}">{1}</div></h1>'.format(plugin.pk, render_placeholder_body))

self.assertContains(
response,
Expand Down

0 comments on commit 04a6aec

Please sign in to comment.