Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from digi604/new_toolbar
New toolbar
- Loading branch information
Showing
8 changed files
with
143 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
<div id="cms_dragholder-{{ plugin.pk }}" class="cms_reset cms_light cms_dragholder cms_dragholder-draggable"> | ||
<div class="cms_dragmenu"></div> | ||
<div class="cms_dragmenu-dropdown"> | ||
<span>{% trans "Settings" %}</span> | ||
<a rel="dialogue" data-text="Are you sure you want to copy this plugin?" href="#">Copy</a> | ||
<a rel="sideframe" href="{{ instance.placeholder.get_remove_url }}{{ instance.pk }}">Delete</a> | ||
{% for class, name in child_plugin_classes %} | ||
{% if forloop.first %}<span>{% trans "Add Plugin" %}</span>{% endif %} | ||
<!-- TODO add correct url instead of only clas --> | ||
<a rel="custom" href="#{{ class }}">{{ name }}</a> | ||
{% endfor %} | ||
</div> | ||
<div class="cms_dragitem"><strong>{{ instance.plugin_type }}</strong> {{ instance.placeholder.slot }}</div> | ||
{% if plugin.get_plugin_class.allow_children and plugin.plugin_children_instances %} | ||
{% for child in plugin.plugin_children_instances %} | ||
{# workaround because include tag does not allow recursive includes #} | ||
{% with template_name="cms/toolbar/items/plugin_drag.html" %}{% include template_name %}{% endwith %} | ||
|
||
{% endfor %} | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,9 @@ | ||
{% load i18n sekizai_tags %} | ||
{% addtoblock "js" %} | ||
<script type="text/javascript"> | ||
CMS.$(document).ready(function () { | ||
new CMS.Placeholder('#cms_placeholder-bar-{{ placeholder.pk }}', { | ||
'type': 'bar', | ||
'placeholder_id': '{{ placeholder.pk }}', | ||
'plugin_language': '{{ language }}', // todo not required should be within backend | ||
'plugin_restriction': ['TextPlugin', 'PicturePlugin'], // empty = false // todo just testing atm | ||
'urls': { | ||
'add_plugin': '{{ placeholder.get_add_url }}', | ||
'edit_plugin': '{{ placeholder.get_changelist_url }}' | ||
} | ||
}); | ||
}); | ||
</script> | ||
{% endaddtoblock %} | ||
<div id="cms_placeholder-bar-{{ placeholder.pk }}" class="cms_reset cms_light cms_placeholder-bar"> | ||
<div class="cms_placeholder-title">{{ placeholder_label }}</div> | ||
<div class="cms_placeholder-btn"> | ||
<a href="#"><span>{% trans "Add Plugin" %}</span></a> | ||
<ul class="cms_placeholder-subnav"> | ||
{% regroup installed_plugins by module as module_list %} | ||
{% for module in module_list %} | ||
<li class="cms_placeholder-subnav-title"><span>{% if module.grouper %}{{ module.grouper|capfirst }}{% else %}{% trans "Add Plugin" %}{% endif %}</span></li> | ||
{% for p in module.list %} | ||
<li><a href="#{{ p.value }}">{{ p.name }}</a></li> | ||
{% endfor %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% if edit %} | ||
{{ toolbar }} | ||
<div> | ||
{{ plugins }} | ||
{{ dragables }} | ||
</div> | ||
<div class="cms_reset cms_light cms_dragholder cms_dragholder-empty cms_dragholder-droppable"><div class="cms_dragitem">Drop a plugin here</div></div> | ||
{% else %} | ||
{{ plugins }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% for plugin in plugins %} | ||
{% include "cms/toolbar/items/plugin_drag.html" with plugin=plugin %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% load i18n sekizai_tags %} | ||
{% addtoblock "js" %} | ||
<script type="text/javascript"> | ||
CMS.$(document).ready(function () { | ||
new CMS.Placeholder('#cms_placeholder-bar-{{ placeholder.pk }}', { | ||
'type': 'bar', | ||
'placeholder_id': '{{ placeholder.pk }}', | ||
'plugin_language': '{{ language }}', // todo not required should be within backend | ||
'plugin_restriction': ['TextPlugin', 'PicturePlugin'], // empty = false // todo just testing atm | ||
'urls': { | ||
'add_plugin': '{{ placeholder.get_add_url }}', | ||
'edit_plugin': '{{ placeholder.get_changelist_url }}' | ||
} | ||
}); | ||
}); | ||
</script> | ||
{% endaddtoblock %} | ||
<div id="cms_placeholder-bar-{{ placeholder.pk }}" class="cms_reset cms_light cms_placeholder-bar"> | ||
<div class="cms_placeholder-title">{{ placeholder_label }}</div> | ||
<div class="cms_placeholder-btn"> | ||
<a href="#"><span>{% trans "Add Plugin" %}</span></a> | ||
<ul class="cms_placeholder-subnav"> | ||
{% regroup installed_plugins by module as module_list %} | ||
{% for module in module_list %} | ||
<li class="cms_placeholder-subnav-title"><span>{% if module.grouper %}{{ module.grouper|capfirst }}{% else %}{% trans "Available plugins" %}{% endif %}</span></li> | ||
{% for p in module.list %} | ||
<li><a href="#{{ p.value }}">{{ p.name }}</a></li> | ||
{% endfor %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="cms_reset cms_light cms_dragholder cms_dragholder-empty cms_dragholder-droppable"><div class="cms_dragitem">Drop a plugin here</div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.