appy.gen: integrated tinyMCE; appy.gen: Ref.shownInfo can now specify column widths (ie, 'title*70%'); appy.gen: updated default page and field layouts; appy.gen: stop generating label for back references it not needed.

This commit is contained in:
Gaetan Delannay 2011-09-28 21:17:15 +02:00
parent 93619dafe1
commit c9353b46db
267 changed files with 40477 additions and 82 deletions

View file

@ -407,7 +407,8 @@ class ToolMixin(BaseMixin):
on a given p_rootClass. This is done by calling method "maySearch"
on the class. If no such method exists, we return True.'''
# When editign a form, one should avoid annoying the user with this.
if self.REQUEST['ACTUAL_URL'].endswith('/edit'): return
url = self.REQUEST['ACTUAL_URL']
if url.endswith('/edit') or url.endswith('/do'): return
pythonClass = self.getAppyClass(rootClass)
if 'maySearch' in pythonClass.__dict__:
return pythonClass.maySearch(self.appy())

View file

@ -597,10 +597,8 @@ class BaseMixin:
if fjs not in js: js.append(fjs)
return {'css':css, 'js':js}
def getAppyTypesFromNames(self, fieldNames, asDict=True, addTitle=True):
'''Gets the Appy types named p_fieldNames. If 'title' is not among
p_fieldNames and p_addTitle is True, field 'title' is prepended to
the result.'''
def getAppyTypesFromNames(self, fieldNames, asDict=True):
'''Gets the Appy types named p_fieldNames.'''
res = []
for name in fieldNames:
if name == 'state':
@ -612,10 +610,8 @@ class BaseMixin:
appyType = self.getAppyType(name, asDict)
if appyType: res.append(appyType)
else:
self.appy().log('Field "%s", used as shownInfo in a Ref, ' \
'was not found.' % name, type='warning')
if addTitle and ('title' not in fieldNames):
res.insert(0, self.getAppyType('title', asDict))
self.log('Field "%s", used as shownInfo in a Ref, ' \
'was not found.' % name, type='warning')
return res
def getAppyStates(self, phase, currentOnly=False):
@ -1306,4 +1302,10 @@ class BaseMixin:
if (role in roles) and (id in ids): return True
# Check then in the global roles.
if role in userGlobalRoles: return True
def getEditorInit(self, name):
'''Gets the Javascrit init code for displaying a rich editor for
field p_name.'''
return 'tinyMCE.init({\nmode : "textareas",\ntheme : "simple",\n' \
'elements : "%s",\neditor_selector : "rich_%s"\n});'% (name,name)
# ------------------------------------------------------------------------------