diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..d6dc195 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,5 @@ +0.3.0 (2015-02-03) +================== + +* multi-boilerplate support + new requirement: aldryn-boilerplates (needs configuration) diff --git a/MANIFEST.in b/MANIFEST.in index 22b96e2..37198ae 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ include README.rst include CHANGELOG -recursive-include aldryn_accordion/templates * -recursive-include aldryn_accordion/static * +recursive-include aldryn_accordion/boilerplates * diff --git a/README.rst b/README.rst index 299eebc..b5215e5 100644 --- a/README.rst +++ b/README.rst @@ -18,13 +18,17 @@ Redeploy the site. Manuall Installation -------------------- -Run ``pip install aldryn-accordion``. +:: -Add below apps to ``INSTALLED_APPS``: :: + pip install aldryn-accordion - INSTALLED_APPS = [ - … +Add ``aldryn_accordion`` to ``INSTALLED_APPS``. - 'aldryn_accordion', - … - ] +Configure ``aldryn-boilerplates`` (https://pypi.python.org/pypi/aldryn-boilerplates/). + +To use the old templates, set ``ALDRYN_BOILERPLATE_NAME='legacy'``. +To use https://github.com/aldryn/aldryn-boilerplate-standard (recommended, will be renamed to +``aldryn-boilerplate-bootstrap3``) set ``ALDRYN_BOILERPLATE_NAME='bootstrap3'``. + +When using the ``legacy`` boilerplate, **jQuery** and +`classjs `_ cl.accordion are required. diff --git a/aldryn_accordion/templates/aldryn_accordion/accordion.html b/aldryn_accordion/boilerplates/bootstrap3/templates/aldryn_accordion/accordion.html similarity index 100% rename from aldryn_accordion/templates/aldryn_accordion/accordion.html rename to aldryn_accordion/boilerplates/bootstrap3/templates/aldryn_accordion/accordion.html diff --git a/aldryn_accordion/templates/aldryn_accordion/accordion_item.html b/aldryn_accordion/boilerplates/bootstrap3/templates/aldryn_accordion/accordion_item.html similarity index 100% rename from aldryn_accordion/templates/aldryn_accordion/accordion_item.html rename to aldryn_accordion/boilerplates/bootstrap3/templates/aldryn_accordion/accordion_item.html diff --git a/aldryn_accordion/boilerplates/legacy/static/js/addons/cl.accordion.min.js b/aldryn_accordion/boilerplates/legacy/static/js/addons/cl.accordion.min.js new file mode 100755 index 0000000..14e8881 --- /dev/null +++ b/aldryn_accordion/boilerplates/legacy/static/js/addons/cl.accordion.min.js @@ -0,0 +1 @@ +var Cl=window.Cl||{};!function(a){"use strict";Cl.Accordion=new Class({options:{index:null,expanded:!1,event:"click",easing:"swing",duration:300,grouping:!0,forceClose:!1,disableAnchors:!0,autoHeight:!1,cls:{expanded:"expanded",collapsed:"collapsed",trigger:".trigger",container:".container",text:".text"},lang:{expanded:"Expanded ",collapsed:"Collapsed "}},initialize:function(b,c){return this.container=a(b),this.options=a.extend(!0,{},this.options,c),this.triggers=this.container.find(this.options.cls.trigger),this.containers=this.container.find(this.options.cls.container),this.index=null,this.callbacks={},this.triggers.length!==this.containers.length?!1:(this._setup(),void 0)},_setup:function(){var a=this;this.options.autoHeight&&this._setHeight(),this.triggers.on(this.options.event,function(b){a.options.disableAnchors&&b.preventDefault(),a.toggle(a.triggers.index(this))}),this.options.disableAnchors&&this.triggers.find("a",function(a){a.preventDefault()}),this.options.expanded||this.container.data("expanded")?this.show(void 0,!0):this.hide(void 0,!0),null!==this.options.index&&this.show(this.options.index,!0);var b=window.location.hash;if(!this.options.expanded&&void 0!==b){var c=this.container.find('a[href="'+b+'"]');c.length&&c.trigger("click")}},toggle:function(a){return this.index===a&&!this.options.forceClose||void 0===this.index?!1:(this.index=a,this.containers.eq(a).is(":visible")?this.hide(a):this.show(a),this._fire("toggle"),void 0)},show:function(a,b){this._setExpanded(a,b),this._fire("show")},hide:function(a,b){this._setCollapsed(a,b),this._fire("hide")},_setExpanded:function(a,b){this.options.grouping&&!b&&this.hide(),void 0===a?(b||this.containers.slideDown(this.options.duration,this.options.easing),b&&this.containers.show(),this.containers.attr("aria-hidden",!1),this.triggers.addClass(this.options.cls.expanded).removeClass(this.options.cls.collapsed).attr("aria-selected",!0).attr("aria-expanded",!0).find(this.options.cls.text).html(this.options.lang.expanded)):(this.containers.eq(a).slideDown(this.options.duration,this.options.easing).attr("aria-hidden",!1),this.triggers.eq(a).addClass(this.options.cls.expanded).removeClass(this.options.cls.collapsed).attr("aria-selected",!0).attr("aria-expanded",!0).find(this.options.cls.text).html(this.options.lang.expanded)),"undefined"!=typeof a&&(this.index=a)},_setCollapsed:function(a,b){void 0===a?(b||this.containers.slideUp(this.options.duration,this.options.easing),b&&this.containers.hide(),this.containers.attr("aria-hidden",!0),this.triggers.addClass(this.options.cls.collapsed).removeClass(this.options.cls.expanded).attr("aria-selected",!1).attr("aria-expanded",!1).find(this.options.cls.text).html(this.options.lang.collapsed)):(this.containers.eq(a).slideUp(this.options.duration,this.options.easing).attr("aria-hidden",!0),this.triggers.eq(a).addClass(this.options.cls.collapsed).removeClass(this.options.cls.expanded).attr("aria-selected",!1).attr("aria-expanded",!1).find(this.options.cls.text).html(this.options.lang.collapsed))},_setHeight:function(){this.containers.each(function(b,c){a(c).height(a(c).height())})},_fire:function(a){return void 0===this.callbacks[a]?!1:(this.callbacks[a](this),void 0)}})}(jQuery); \ No newline at end of file diff --git a/aldryn_accordion/boilerplates/legacy/static/js/libs/class.min.js b/aldryn_accordion/boilerplates/legacy/static/js/libs/class.min.js new file mode 100755 index 0000000..1e03e70 --- /dev/null +++ b/aldryn_accordion/boilerplates/legacy/static/js/libs/class.min.js @@ -0,0 +1,6 @@ +/*! + * @author Angelo Dini + * @version 1.0 + * @copyright Distributed under the BSD License. + */ +(function(){var d="1.0";var c=window.Class;var b=window.Class=function(n){n=n||{};var m=function(){return(this.initialize)?this.initialize.apply(this,arguments):j};if(n.implement){var j=window===this?g(m.prototype):this;var l=n.implement;a(n,"implement");n=f(n,e(l))}m.prototype=g(n);m.constructor=m;m._parent=g(n);for(var k=0,h=["extend","implement","getOptions","setOptions"];k + {% for plugin in accordion.child_plugin_instances %} + {% with parentloop=forloop %}{% render_plugin plugin %}{% endwith %} + {% endfor %} + + +{% addtoblock "js" %}{% endaddtoblock %} +{% addtoblock "js" %}{% endaddtoblock %} +{% addtoblock "js" %} + +{% endaddtoblock %} diff --git a/aldryn_accordion/boilerplates/legacy/templates/aldryn_accordion/accordion_item.html b/aldryn_accordion/boilerplates/legacy/templates/aldryn_accordion/accordion_item.html new file mode 100755 index 0000000..87d622e --- /dev/null +++ b/aldryn_accordion/boilerplates/legacy/templates/aldryn_accordion/accordion_item.html @@ -0,0 +1,13 @@ +{% load cms_tags i18n %} + +
+ {{ item.title }} {% trans "Close" %} +
+ +
+
+ {% for plugin in item.child_plugin_instances %} + {% render_plugin plugin %} + {% endfor %} +
+
\ No newline at end of file diff --git a/setup.py b/setup.py index b4064f5..be7c51e 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,9 @@ ).group(1) -REQUIREMENTS = [] +REQUIREMENTS = [ + 'aldryn-boilerplates>=0.6', +] CLASSIFIERS = [