diff --git a/gen/__init__.py b/gen/__init__.py index 0d4f829..2a967a0 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -968,16 +968,17 @@ class Type: try: return method(obj, self) except Exception, e: + obj.log(tb, type='error') if raiseOnError: # Raise the initial error. raise te else: - obj.log(tb, type='error') return str(te) except Exception, e: - if raiseOnError: raise e + obj.log(Traceback.get(), type='error') + if raiseOnError: + raise e else: - obj.log(Traceback.get(), type='error') return str(e) def process(self, obj): @@ -1209,8 +1210,11 @@ class String(Type): self.isSelect = self.isSelection() # Default width, height and maxChars vary according to String format if width == None: - if format == String.TEXT: self.width = 60 - else: self.width = 30 + if format == String.TEXT: self.width = 60 + # This width corresponds to the standard width of an Appy page, + # minus the portlet. + if format == String.XHTML: self.width = 750 + else: self.width = 30 if height == None: if format == String.TEXT: self.height = 5 elif self.isSelect: self.height = 4 diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index a3824f8..b556ee7 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -1576,13 +1576,16 @@ class BaseMixin: # this field. field = self.getAppyType(name) ckAttrs = {'toolbar': field.richText and 'AppyRich' or 'Appy', - 'format_tags': '%s' % ';'.join(field.styles)} + 'format_tags': '%s' % ';'.join(field.styles), + 'width': field.width} if field.allowImageUpload: ckAttrs['filebrowserUploadUrl'] = '%s/upload' % self.absolute_url() - ck = '' + ck = [] for k, v in ckAttrs.iteritems(): - ck += "%s: '%s'," % (k, v) - res = "CKEDITOR.replace('%s', {%s})" % (name, ck) + if isinstance(v, int): sv = str(v) + else: sv = '"%s"' % v + ck.append('%s: %s' % (k, sv)) + res = 'CKEDITOR.replace("%s", {%s})' % (name, ', '.join(ck)) return res def getCalendarInit(self, name, years): diff --git a/gen/ui/widgets/string.pt b/gen/ui/widgets/string.pt index f249953..70f2020 100644 --- a/gen/ui/widgets/string.pt +++ b/gen/ui/widgets/string.pt @@ -64,7 +64,7 @@ class python: (fmt==2) and ('rich_%s' % name) or ''" tal:content="python: test(inRequest, requestValue, value)"> -