# HG changeset patch # User Thierry Florac # Date 1505813110 -7200 # Node ID a9a665e34874f3c942c32e8e1dacae6e6b89cdc9 # Parent 23b9da6acdd847b07c38b231e150f10259449f71 Added base class for admin container view diff -r 23b9da6acdd8 -r a9a665e34874 src/pyams_zmi/templates/container.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_zmi/templates/container.pt Tue Sep 19 11:25:10 2017 +0200 @@ -0,0 +1,13 @@ +
+
+ + +

+ + +
+
+ +
+
diff -r 23b9da6acdd8 -r a9a665e34874 src/pyams_zmi/view.py --- a/src/pyams_zmi/view.py Mon Sep 11 15:10:09 2017 +0200 +++ b/src/pyams_zmi/view.py Tue Sep 19 11:25:10 2017 +0200 @@ -23,7 +23,9 @@ # import packages from pyams_skin.skin import apply_skin +from pyams_template.template import template_config from pyramid.events import subscriber +from z3c.table.table import Table from zope.interface import implementer @@ -39,6 +41,22 @@ """Inner admin view""" +@template_config(template='templates/container.pt', layer=IAdminLayer) +class ContainerAdminView(InnerAdminView): + """Container admin view""" + + table_class = Table + + def __init__(self, context, request): + super(ContainerAdminView, self).__init__(context, request) + self.table = self.table_class(context, request) + self.table.view = self + + def update(self): + super(ContainerAdminView, self).update() + self.table.update() + + @subscriber(IPageletCreatedEvent, context_selector=IAdminView) def handle_admin_view(event): """Set skin for admin views"""