8000 chore: Move from script tags containing dom elements to template tags… · django-cms/django-cms@99bf94a · GitHub
[go: up one dir, main page]

Skip to content

Commit 99bf94a

Browse files
fsbraunGithub Release Action
andcommitted
chore: Move from script tags containing dom elements to template tags (#8233)
* [5.1.0dev1 release process] Bumped version to 5.1.0dev1 * [5.1.0dev1 release process] compilemessages * [5.1.0dev1 release process] compiling new static files * [5.1.0dev1 release process] updating latest docs * Prepare new main branch * Fix typos * fix: No changes to changelog * fix: Remove unnecessary change to migration * Remove circular import * Fix import order * Re-introduce dummy `PlaceholderField` for legacy migrations * fix: Do not assume page url cache to be filled * fix: Structure board update sometimes failed to add all interactive elements (#8227) * fix: Scan plugin data after structure mode Xhr load * Fix test * fix js linting issues * fix: Update assets * fix: Empty plugin selectors in all but first placeholder * chore: Move from script tags containing dom elements to template tags * Update cms/models/fields.py * Update cms/models/fields.py --------- Co-authored-by: Github Release Action <info@django-cms.org>
1 parent c4ec1a1 commit 99bf94a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cms/plugin_rendering.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,9 @@ def _preload_placeholders_for_page(self, page, slots=None, inherit=False):
764764
class StructureRenderer(BaseRenderer):
765765
load_structure = True
766766
placeholder_edit_template = """
767-
<script data-cms id="cms-plugin-child-classes-{placeholder_id}" type="text/cms-template">
767+
<template data-cms id="cms-plugin-child-classes-{placeholder_id}" type="text/cms-template">
768768
{plugin_menu_js}
769-
</script>
769+
</template>
770770
{plugin_js}{placeholder_js}
771771
"""
772772

@@ -853,9 +853,9 @@ class LegacyRenderer(ContentRenderer):
853853
placeholder_edit_template = """
854854
{content}
855855
<div class="cms-placeholder cms-placeholder-{placeholder_id}"></div>
856-
<script data-cms id="cms-plugin-child-classes-{placeholder_id}" type="text/cms-template">
856+
<template data-cms id="cms-plugin-child-classes-{placeholder_id}" type="text/cms-template">
857857
{plugin_menu_js}
858-
</script>
858+
</template>
859859
{plugin_js}{placeholder_js}
860860
"""
861861

cms/tests/frontend/unit/fixtures/plugin_child_classes.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script id="cms-plugin-child-classes-1" type="text/cms-template">
1+
<template id="cms-plugin-child-classes-1" type="text/cms-template">
22
<div class="cms-submenu-item cms-submenu-item-title"><span>Accordion</span></div>
33
<div class="cms-submenu-item"><a data-rel="add" href="Bootstrap3AccordionItemCMSPlugin">Accordion item</a></div>
44
<div class="cms-submenu-item cms-submenu-item-title"><span>Bootstrap3</span></div>
@@ -81,4 +81,4 @@
8181
<div class="cms-submenu-item"><a data-rel="add" href="NewsBlogTagsPlugin">Tags</a></div>
8282
<div class="cms-submenu-item cms-submenu-item-title"><span>People</span></div>
8383
<div class="cms-submenu-item"><a data-rel="add" href="PeoplePlugin">People list</a></div>
84-
</script>
84+
</template>

cms/tests/test_placeholder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ def test_sets_source_when_external_object_is_rendered(self):
10231023
for placeholder in declared_placeholders:
10241024
self.assertContains(
10251025
response,
1026-
'<script data-cms id="cms-plugin-child-classes-%s" type="text/cms-template">'
1026+
'<template data-cms id="cms-plugin-child-classes-%s" type="text/cms-template">'
10271027
% placeholders.get(slot=placeholder.slot).pk,
10281028
)
10291029

@@ -1046,7 +1046,7 @@ def test_sets_source_when_external_object_is_rendered(self):
10461046
for placeholder in declared_placeholders:
10471047
self.assertContains(
10481048
response,
1049-
'<script data-cms id="cms-plugin-child-classes-%s" type="text/cms-template">'
1049+
'<template data-cms id="cms-plugin-child-classes-%s" type="text/cms-template">'
10501050
% placeholders.get(slot=placeholder.slot).pk,
10511051
)
10521052

0 commit comments

Comments
 (0)
0