Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed plugin-in-plugin

  • Loading branch information...
commit d00230d7dab670e979d9ab526854d16273f0aec3 1 parent 77282c8
Angelo Dini FinalAngel authored
30 cms/templates/cms/toolbar/draggable.html
View
@@ -1,31 +1,3 @@
-{% load cms_tags i18n %}
-
{% for plugin in plugins %}
-<li id="cms_draggable-{{ plugin.pk }}" class="cms_draggable{% if not plugin.child_plugins_instances %} cms_draggable-disabled{% endif %}">
- <div class="cms_dragitem cms_dragitem-handler{% if plugin.child_plugins_instances %} cms_dragitem-collapsable{% endif %}">
- <div class="cms_dragmenu">
- <div class="cms_dragmenu-dropdown">
- <span>{% trans "Settings" %}</span>
- <a rel="modal" href="{% url admin:cms_page_edit_plugin plugin.pk %}" data-name="{{ plugin.get_plugin_name }}" data-type="{{ plugin.plugin_type }}">{% trans "Edit" %}</a>
- <!--<a rel="dialogue" data-text="Are you sure you want to copy this plugin?" href="#">{% trans "Copy" %}</a>-->
- <a rel="sideframe" href="{% url admin:cms_page_delete_plugin plugin.pk %}">{% trans "Delete" %}</a>
- {% plugin_child_classes plugin %}
- </div>
- </div>
-
- <strong>{{ plugin.get_plugin_name }}</strong> {{ plugin.get_short_description }}
- </div>
-
- {% if plugin.get_plugin_class.allow_children %}<ul class="cms_draggables">{% endif %}
- {% if plugin.get_plugin_class.allow_children and not plugin.child_plugins_instances.0 %}
- <!--<div class="cms_reset cms_light cms_draggable cms_draggable-empty"><div class="cms_dragitem">{% trans "Drop a plugin here" %}</div></div>-->
- {% endif %}
- {% if plugin.child_plugins_instances %}
- {% for child in plugin.child_plugins_instances %}
- {# workaround because include tag does not allow recursive includes #}
- {% with template_name="cms/toolbar/draggable.html" %}{% include template_name with plugin=child %}{% endwith %}
- {% endfor %}
- {% endif %}
- {% if plugin.get_plugin_class.allow_children %}</ul>{% endif %}
-</li>
+ {% include "cms/toolbar/draggable_item.html" with plugin=plugin %}
{% endfor %}
29 cms/templates/cms/toolbar/draggable_item.html
View
@@ -0,0 +1,29 @@
+{% load cms_tags i18n %}
+
+<li id="cms_draggable-{{ plugin.pk }}" class="cms_draggable{% if not plugin.child_plugins_instances %} cms_draggable-disabled{% endif %}">
+ <div class="cms_dragitem cms_dragitem-handler{% if plugin.child_plugins_instances %} cms_dragitem-collapsable{% endif %}">
+ <div class="cms_dragmenu">
+ <div class="cms_dragmenu-dropdown">
+ <span>{% trans "Settings" %}</span>
+ <a rel="modal" href="{% url admin:cms_page_edit_plugin plugin.pk %}" data-name="{{ plugin.get_plugin_name }}" data-type="{{ plugin.plugin_type }}">{% trans "Edit" %}</a>
+ <!--<a rel="dialogue" data-text="Are you sure you want to copy this plugin?" href="#">{% trans "Copy" %}</a>-->
+ <a rel="sideframe" href="{% url admin:cms_page_delete_plugin plugin.pk %}">{% trans "Delete" %}</a>
+ {% plugin_child_classes plugin %}
+ </div>
+ </div>
+
+ <strong>{{ plugin.get_plugin_name }}</strong> {{ plugin.get_short_description }}
+ </div>
+
+ {% if plugin.get_plugin_class.allow_children %}<ul class="cms_draggables">{% endif %}
+ {% if plugin.get_plugin_class.allow_children and not plugin.child_plugins_instances.0 %}
+ <!--<div class="cms_reset cms_light cms_draggable cms_draggable-empty"><div class="cms_dragitem">{% trans "Drop a plugin here" %}</div></div>-->
+ {% endif %}
+ {% if plugin.child_plugins_instances %}
+ {% for child in plugin.child_plugins_instances %}
+ {# workaround because include tag does not allow recursive includes #}
+ {% with template_name="cms/toolbar/draggable_item.html" %}{% include template_name with plugin=child %}{% endwith %}
+ {% endfor %}
+ {% endif %}
+ {% if plugin.get_plugin_class.allow_children %}</ul>{% endif %}
+</li>
Please sign in to comment.
Something went wrong with that request. Please try again.