Removed "size" column for menu entries
authorThierry Florac <thierry.florac@onf.fr>
Fri, 13 Jul 2018 08:51:55 +0200
changeset 843 11e06690bc32
parent 842 7f0d72e427b1
child 844 36af332b6dd0
Removed "size" column for menu entries
src/pyams_content/features/menu/zmi/__init__.py
--- a/src/pyams_content/features/menu/zmi/__init__.py	Thu Jul 12 18:18:15 2018 +0200
+++ b/src/pyams_content/features/menu/zmi/__init__.py	Fri Jul 13 08:51:55 2018 +0200
@@ -41,7 +41,7 @@
 from pyams_skin.table import BaseTable, SorterColumn, VisibilitySwitcherColumn, I18nColumn, TrashColumn, NameColumn, \
     get_table_id
 from pyams_skin.viewlet.toolbar import ToolbarAction
-from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextAdapter
+from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter, ContextAdapter, NullAdapter
 from pyams_utils.traversing import get_parent
 from pyams_utils.url import absolute_url
 from pyams_viewlet.viewlet import viewlet_config
@@ -487,3 +487,13 @@
     """Menu external link properties edit form"""
 
     edit_permission = None  # managed by IFormContextPermissionChecker adapter
+
+
+#
+# Custom adapters
+#
+
+@adapter_config(name='size', context=(IMenu, IPyAMSLayer, MenuLinksTable), provides=IColumn)
+@adapter_config(name='size', context=(IMenuLinksContainerTarget, IPyAMSLayer, LinksTable), provides=IColumn)
+class MenuLinksTableSizeColumn(NullAdapter):
+    """Menu links table size column"""