# HG changeset patch # User Thierry Florac # Date 1499860073 -7200 # Node ID 03aae24b8ea6a007a647766feeabc41fd02607e7 # Parent 4945c9b1202e55cdbf9d5ef661b78b30f9ee3d10 Added toolbar action item viewlet diff -r 4945c9b1202e -r 03aae24b8ea6 src/pyams_skin/viewlet/toolbar/__init__.py --- a/src/pyams_skin/viewlet/toolbar/__init__.py Wed Jul 12 13:47:25 2017 +0200 +++ b/src/pyams_skin/viewlet/toolbar/__init__.py Wed Jul 12 13:47:53 2017 +0200 @@ -18,7 +18,7 @@ # import interfaces from pyams_skin.interfaces.container import ITableWithActions from pyams_skin.interfaces.viewlet import IToolbarViewletManager, IToolbarAction, IToolbarMenu, IToolbarMenuItem, \ - IContextActions, IToolbarAddingMenu, ITableItemColumnActionsMenu, IWidgetTitleViewletManager + IContextActions, IToolbarAddingMenu, ITableItemColumnActionsMenu, IWidgetTitleViewletManager, IToolbarActionItem from pyams_skin.layer import IPyAMSLayer from pyams_utils.interfaces.tales import ITALESExtension from zope.contentprovider.interfaces import IContentProvider @@ -110,10 +110,10 @@ css_class = 'btn btn-xs btn-info dropdown-toggle' -@template_config(template='menu-item.pt', layer=IPyAMSLayer) -@implementer(IToolbarMenuItem) -class ToolbarMenuItem(Viewlet): - """Toolbar menu item class""" +@template_config(template='toolbar-item.pt', layer=IPyAMSLayer) +@implementer(IToolbarActionItem) +class ToolbarActionItem(Viewlet): + """Toolbar action item class""" label = FieldProperty(IToolbarMenuItem['label']) label_css_class = FieldProperty(IToolbarMenuItem['label_css_class']) @@ -127,6 +127,12 @@ return absolute_url(self.context, self.request, self.url) +@template_config(template='menu-item.pt', layer=IPyAMSLayer) +@implementer(IToolbarMenuItem) +class ToolbarMenuItem(ToolbarActionItem): + """Toolbar menu item class""" + + class JsToolbarMenuItem(ToolbarMenuItem): """Javascript call toolbar menu item""" @@ -151,6 +157,7 @@ """Context actions viewlet manager""" label = _("Other actions...") + label_css_class = '' css_class = FieldProperty(IContextActions['css_class']) diff -r 4945c9b1202e -r 03aae24b8ea6 src/pyams_skin/viewlet/toolbar/action.pt --- a/src/pyams_skin/viewlet/toolbar/action.pt Wed Jul 12 13:47:25 2017 +0200 +++ b/src/pyams_skin/viewlet/toolbar/action.pt Wed Jul 12 13:47:53 2017 +0200 @@ -1,9 +1,8 @@
-
\ No newline at end of file + diff -r 4945c9b1202e -r 03aae24b8ea6 src/pyams_skin/viewlet/toolbar/menu.pt --- a/src/pyams_skin/viewlet/toolbar/menu.pt Wed Jul 12 13:47:25 2017 +0200 +++ b/src/pyams_skin/viewlet/toolbar/menu.pt Wed Jul 12 13:47:53 2017 +0200 @@ -1,11 +1,12 @@
-
\ No newline at end of file + diff -r 4945c9b1202e -r 03aae24b8ea6 src/pyams_skin/viewlet/toolbar/toolbar-item.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_skin/viewlet/toolbar/toolbar-item.pt Wed Jul 12 13:47:53 2017 +0200 @@ -0,0 +1,11 @@ + + +