# HG changeset patch # User tflorac@dagon.home # Date 1522962071 -7200 # Node ID b1d1dd23df305c16089de12224cd8b65ce3684f5 # Parent 101f3a658b8ab5071081b09bc6813740ade028c1 Added inner table base class diff -r 101f3a658b8a -r b1d1dd23df30 src/pyams_zmi/zmi/table.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_zmi/zmi/table.py Thu Apr 05 23:01:11 2018 +0200 @@ -0,0 +1,42 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_zmi.layer import IAdminLayer + +# import packages +from pyams_template.template import template_config +from pyams_zmi.form import InnerAdminDisplayForm +from z3c.form import field +from zope.interface import Interface + + +@template_config(template='templates/inner-table.pt', layer=IAdminLayer) +class InnerTableView(InnerAdminDisplayForm): + """Inner table view""" + + fields = field.Fields(Interface) + table_factory = None + + def __init__(self, context, request, view): + super(InnerTableView, self).__init__(context, request, view) + self.table = self.table_factory(context, request) + self.table.view = self + + def update(self): + super(InnerTableView, self).update() + self.table.update() diff -r 101f3a658b8a -r b1d1dd23df30 src/pyams_zmi/zmi/templates/inner-table.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_zmi/zmi/templates/inner-table.pt Thu Apr 05 23:01:11 2018 +0200 @@ -0,0 +1,14 @@ +
+
+ + View title + +
+ +
+
+ +
+