[gen] [gen] Action field: param confirm can be 'text': in this case, the confirm popup contains a textarea whose content is passed as param to the method speficied in param 'action'. Action fields can now be defined in a new layout 'buttons' (show='buttons') in order to appear, on the view layout, besides the extsting series of buttons (edit, next/previous pages...).

This commit is contained in:
Gaetan Delannay 2014-10-22 22:17:26 +02:00
parent 960a4c6a46
commit ccf7e44eef
6 changed files with 157 additions and 114 deletions

View file

@ -816,13 +816,15 @@ class BaseMixin:
cssJs['js'] = js or ()
return res
def getAppyTypes(self, layoutType, pageName):
def getAppyTypes(self, layoutType, pageName, type=None):
'''Returns the list of fields that belong to a given page (p_pageName)
for a given p_layoutType. If p_pageName is None, fields of all pages
are returned.'''
are returned. If p_type is defined, only fields of this p_type are
returned. '''
res = []
for field in self.getAllAppyTypes():
if pageName and (field.page.name != pageName): continue
if type and (field.type != type): continue
if not field.isShowable(self, layoutType): continue
res.append(field)
return res