diff -r c9f708af6069 -r 5f40601f9cb0 src/pyams_content/features/redirect/zmi/container.py --- a/src/pyams_content/features/redirect/zmi/container.py Fri Jul 20 01:02:27 2018 +0200 +++ b/src/pyams_content/features/redirect/zmi/container.py Fri Jul 20 12:39:19 2018 +0200 @@ -37,7 +37,7 @@ from pyams_skin.help import ContentHelp from pyams_skin.page import DefaultPageHeaderAdapter from pyams_skin.skin import apply_skin -from pyams_skin.table import BaseTable, SorterColumn, VisibilitySwitcherColumn, TrashColumn, I18nColumn +from pyams_skin.table import BaseTable, SorterColumn, TrashColumn, I18nColumn, AttributeSwitcherColumn from pyams_skin.viewlet.menu import MenuItem from pyams_skin.viewlet.toolbar import ToolbarAction from pyams_template.template import template_config @@ -150,16 +150,16 @@ @adapter_config(name='enable-disable', context=(IRedirectionManagerTarget, IPyAMSLayer, RedirectionsContainerTable), provides=IColumn) -class RedirectionsContainerShowHideColumn(VisibilitySwitcherColumn): - """Redirections container activity switcher column""" +class RedirectionsContainerEnablerColumn(AttributeSwitcherColumn): + """Redirections container enabler switcher column""" switch_attribute = 'active' - visible_icon_class = 'fa fa-fw fa-check-square-o' - hidden_icon_class = 'fa fa-fw fa-square-o txt-color-silver opacity-75' + + on_icon_class = 'fa fa-fw fa-check-square-o' + off_icon_class = 'fa fa-fw fa-square-o txt-color-silver opacity-75' icon_hint = _("Enable/disable rule") - url = 'MyAMS.container.switchElementAttribute' weight = 6 @@ -177,16 +177,16 @@ @adapter_config(name='chain-unchain', context=(IRedirectionManagerTarget, IPyAMSLayer, RedirectionsContainerTable), provides=IColumn) -class RedirectionsContainerChainedColumn(VisibilitySwitcherColumn): +class RedirectionsContainerChainedColumn(AttributeSwitcherColumn): """Redirections container chained switcher column""" switch_attribute = 'chained' - visible_icon_class = 'fa fa-fw fa-chain' - hidden_icon_class = 'fa fa-fw fa-chain txt-color-silver opacity-50' + + on_icon_class = 'fa fa-fw fa-chain' + off_icon_class = 'fa fa-fw fa-chain txt-color-silver opacity-50' icon_hint = _("Chain/unchain rule") - url = 'MyAMS.container.switchElementAttribute' weight = 7 @@ -199,7 +199,7 @@ if rule is None: raise NotFound() rule.chained = not rule.chained - return {'on': rule.chained} + return {'chained': rule.chained} @adapter_config(name='name', context=(IRedirectionManagerTarget, IPyAMSLayer, RedirectionsContainerTable),