[gen] Added params Type.swidth and Type.sheight to allow for different sizes for the search widgets.
This commit is contained in:
parent
24089ef674
commit
f6b2afc423
|
@ -415,7 +415,7 @@ class Type:
|
||||||
layouts, move, indexed, searchable, specificReadPermission,
|
layouts, move, indexed, searchable, specificReadPermission,
|
||||||
specificWritePermission, width, height, maxChars, colspan,
|
specificWritePermission, width, height, maxChars, colspan,
|
||||||
master, masterValue, focus, historized, sync, mapping, label,
|
master, masterValue, focus, historized, sync, mapping, label,
|
||||||
sdefault, scolspan):
|
sdefault, scolspan, swidth, sheight):
|
||||||
# The validator restricts which values may be defined. It can be an
|
# The validator restricts which values may be defined. It can be an
|
||||||
# interval (1,None), a list of string values ['choice1', 'choice2'],
|
# interval (1,None), a list of string values ['choice1', 'choice2'],
|
||||||
# a regular expression, a custom function, a Selection instance, etc.
|
# a regular expression, a custom function, a Selection instance, etc.
|
||||||
|
@ -515,6 +515,9 @@ class Type:
|
||||||
self.sdefault = sdefault
|
self.sdefault = sdefault
|
||||||
# Colspan for rendering the search widget corresponding to this field.
|
# Colspan for rendering the search widget corresponding to this field.
|
||||||
self.scolspan = scolspan
|
self.scolspan = scolspan
|
||||||
|
# Width and height for the search widget
|
||||||
|
self.swidth = swidth or width
|
||||||
|
self.sheight = sheight or height
|
||||||
|
|
||||||
def init(self, name, klass, appName):
|
def init(self, name, klass, appName):
|
||||||
'''When the application server starts, this secondary constructor is
|
'''When the application server starts, this secondary constructor is
|
||||||
|
@ -990,15 +993,15 @@ class Integer(Type):
|
||||||
def __init__(self, validator=None, multiplicity=(0,1), default=None,
|
def __init__(self, validator=None, multiplicity=(0,1), default=None,
|
||||||
show=True, page='main', group=None, layouts=None, move=0,
|
show=True, page='main', group=None, layouts=None, move=0,
|
||||||
indexed=False, searchable=False, specificReadPermission=False,
|
indexed=False, searchable=False, specificReadPermission=False,
|
||||||
specificWritePermission=False, width=6, height=None,
|
specificWritePermission=False, width=5, height=None,
|
||||||
maxChars=13, colspan=1, master=None, masterValue=None,
|
maxChars=13, colspan=1, master=None, masterValue=None,
|
||||||
focus=False, historized=False, mapping=None, label=None,
|
focus=False, historized=False, mapping=None, label=None,
|
||||||
sdefault=('',''), scolspan=1):
|
sdefault=('',''), scolspan=1, swidth=None, sheight=None):
|
||||||
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
||||||
layouts, move, indexed, searchable,specificReadPermission,
|
layouts, move, indexed, searchable,specificReadPermission,
|
||||||
specificWritePermission, width, height, maxChars, colspan,
|
specificWritePermission, width, height, maxChars, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.pythonType = long
|
self.pythonType = long
|
||||||
|
|
||||||
def validateValue(self, obj, value):
|
def validateValue(self, obj, value):
|
||||||
|
@ -1020,11 +1023,11 @@ class Float(Type):
|
||||||
def __init__(self, validator=None, multiplicity=(0,1), default=None,
|
def __init__(self, validator=None, multiplicity=(0,1), default=None,
|
||||||
show=True, page='main', group=None, layouts=None, move=0,
|
show=True, page='main', group=None, layouts=None, move=0,
|
||||||
indexed=False, searchable=False, specificReadPermission=False,
|
indexed=False, searchable=False, specificReadPermission=False,
|
||||||
specificWritePermission=False, width=6, height=None,
|
specificWritePermission=False, width=5, height=None,
|
||||||
maxChars=13, colspan=1, master=None, masterValue=None,
|
maxChars=13, colspan=1, master=None, masterValue=None,
|
||||||
focus=False, historized=False, mapping=None, label=None,
|
focus=False, historized=False, mapping=None, label=None,
|
||||||
sdefault=('',''), scolspan=1, precision=None, sep=(',', '.'),
|
sdefault=('',''), scolspan=1, swidth=None, sheight=None,
|
||||||
tsep=' '):
|
precision=None, sep=(',', '.'), tsep=' '):
|
||||||
# The precision is the number of decimal digits. This number is used
|
# The precision is the number of decimal digits. This number is used
|
||||||
# for rendering the float, but the internal float representation is not
|
# for rendering the float, but the internal float representation is not
|
||||||
# rounded.
|
# rounded.
|
||||||
|
@ -1045,7 +1048,7 @@ class Float(Type):
|
||||||
layouts, move, indexed, False, specificReadPermission,
|
layouts, move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, maxChars, colspan,
|
specificWritePermission, width, height, maxChars, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.pythonType = float
|
self.pythonType = float
|
||||||
|
|
||||||
def getFormattedValue(self, obj, value, showChanges=False):
|
def getFormattedValue(self, obj, value, showChanges=False):
|
||||||
|
@ -1176,7 +1179,7 @@ class String(Type):
|
||||||
specificReadPermission=False, specificWritePermission=False,
|
specificReadPermission=False, specificWritePermission=False,
|
||||||
width=None, height=None, maxChars=None, colspan=1, master=None,
|
width=None, height=None, maxChars=None, colspan=1, master=None,
|
||||||
masterValue=None, focus=False, historized=False, mapping=None,
|
masterValue=None, focus=False, historized=False, mapping=None,
|
||||||
label=None, sdefault='', scolspan=1,
|
label=None, sdefault='', scolspan=1, swidth=None, sheight=None,
|
||||||
transform='none', styles=('p','h1','h2','h3','h4'),
|
transform='none', styles=('p','h1','h2','h3','h4'),
|
||||||
allowImageUpload=True, richText=False):
|
allowImageUpload=True, richText=False):
|
||||||
# According to format, the widget will be different: input field,
|
# According to format, the widget will be different: input field,
|
||||||
|
@ -1205,7 +1208,7 @@ class String(Type):
|
||||||
layouts, move, indexed, searchable,specificReadPermission,
|
layouts, move, indexed, searchable,specificReadPermission,
|
||||||
specificWritePermission, width, height, maxChars, colspan,
|
specificWritePermission, width, height, maxChars, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.isSelect = self.isSelection()
|
self.isSelect = self.isSelection()
|
||||||
# If self.isSelect, self.sdefault must be a list of value(s).
|
# If self.isSelect, self.sdefault must be a list of value(s).
|
||||||
if self.isSelect and not sdefault:
|
if self.isSelect and not sdefault:
|
||||||
|
@ -1228,6 +1231,8 @@ class String(Type):
|
||||||
elif format == String.PASSWORD: self.maxChars = 20
|
elif format == String.PASSWORD: self.maxChars = 20
|
||||||
self.filterable = self.indexed and (self.format == String.LINE) and \
|
self.filterable = self.indexed and (self.format == String.LINE) and \
|
||||||
not self.isSelect
|
not self.isSelect
|
||||||
|
self.swidth = self.swidth or self.width
|
||||||
|
self.sheight = self.sheight or self.height
|
||||||
|
|
||||||
def isSelection(self):
|
def isSelection(self):
|
||||||
'''Does the validator of this type definition define a list of values
|
'''Does the validator of this type definition define a list of values
|
||||||
|
@ -1523,12 +1528,12 @@ class Boolean(Type):
|
||||||
specificWritePermission=False, width=None, height=None,
|
specificWritePermission=False, width=None, height=None,
|
||||||
maxChars=None, colspan=1, master=None, masterValue=None,
|
maxChars=None, colspan=1, master=None, masterValue=None,
|
||||||
focus=False, historized=False, mapping=None, label=None,
|
focus=False, historized=False, mapping=None, label=None,
|
||||||
sdefault=False, scolspan=1):
|
sdefault=False, scolspan=1, swidth=None, sheight=None):
|
||||||
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
||||||
layouts, move, indexed, searchable,specificReadPermission,
|
layouts, move, indexed, searchable,specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.pythonType = bool
|
self.pythonType = bool
|
||||||
|
|
||||||
# Layout including a description
|
# Layout including a description
|
||||||
|
@ -1576,7 +1581,7 @@ class Date(Type):
|
||||||
specificWritePermission=False, width=None, height=None,
|
specificWritePermission=False, width=None, height=None,
|
||||||
maxChars=None, colspan=1, master=None, masterValue=None,
|
maxChars=None, colspan=1, master=None, masterValue=None,
|
||||||
focus=False, historized=False, mapping=None, label=None,
|
focus=False, historized=False, mapping=None, label=None,
|
||||||
sdefault=None, scolspan=1):
|
sdefault=None, scolspan=1, swidth=None, sheight=None):
|
||||||
self.format = format
|
self.format = format
|
||||||
self.calendar = calendar
|
self.calendar = calendar
|
||||||
self.startYear = startYear
|
self.startYear = startYear
|
||||||
|
@ -1588,7 +1593,7 @@ class Date(Type):
|
||||||
layouts, move, indexed, searchable,specificReadPermission,
|
layouts, move, indexed, searchable,specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
|
|
||||||
def getCss(self, layoutType, res):
|
def getCss(self, layoutType, res):
|
||||||
# CSS files are only required if the calendar must be shown.
|
# CSS files are only required if the calendar must be shown.
|
||||||
|
@ -1655,13 +1660,14 @@ class File(Type):
|
||||||
specificWritePermission=False, width=None, height=None,
|
specificWritePermission=False, width=None, height=None,
|
||||||
maxChars=None, colspan=1, master=None, masterValue=None,
|
maxChars=None, colspan=1, master=None, masterValue=None,
|
||||||
focus=False, historized=False, mapping=None, label=None,
|
focus=False, historized=False, mapping=None, label=None,
|
||||||
isImage=False, sdefault='', scolspan=1):
|
isImage=False, sdefault='', scolspan=1, swidth=None,
|
||||||
|
sheight=None):
|
||||||
self.isImage = isImage
|
self.isImage = isImage
|
||||||
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
Type.__init__(self, validator, multiplicity, default, show, page, group,
|
||||||
layouts, move, indexed, False, specificReadPermission,
|
layouts, move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getFileObject(filePath, fileName=None, zope=False):
|
def getFileObject(filePath, fileName=None, zope=False):
|
||||||
|
@ -1816,7 +1822,7 @@ class Ref(Type):
|
||||||
masterValue=None, focus=False, historized=False, mapping=None,
|
masterValue=None, focus=False, historized=False, mapping=None,
|
||||||
label=None, queryable=False, queryFields=None, queryNbCols=1,
|
label=None, queryable=False, queryFields=None, queryNbCols=1,
|
||||||
navigable=False, searchSelect=None, changeOrder=True,
|
navigable=False, searchSelect=None, changeOrder=True,
|
||||||
sdefault='', scolspan=1):
|
sdefault='', scolspan=1, swidth=None, sheight=None):
|
||||||
self.klass = klass
|
self.klass = klass
|
||||||
self.attribute = attribute
|
self.attribute = attribute
|
||||||
# May the user add new objects through this ref ?
|
# May the user add new objects through this ref ?
|
||||||
|
@ -1896,7 +1902,7 @@ class Ref(Type):
|
||||||
layouts, move, indexed, False, specificReadPermission,
|
layouts, move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, sync, mapping,
|
master, masterValue, focus, historized, sync, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.validable = self.link
|
self.validable = self.link
|
||||||
|
|
||||||
def getDefaultLayouts(self):
|
def getDefaultLayouts(self):
|
||||||
|
@ -2160,7 +2166,7 @@ class Computed(Type):
|
||||||
maxChars=None, colspan=1, method=None, plainText=True,
|
maxChars=None, colspan=1, method=None, plainText=True,
|
||||||
master=None, masterValue=None, focus=False, historized=False,
|
master=None, masterValue=None, focus=False, historized=False,
|
||||||
sync=True, mapping=None, label=None, sdefault='', scolspan=1,
|
sync=True, mapping=None, label=None, sdefault='', scolspan=1,
|
||||||
context={}):
|
swidth=None, sheight=None, context={}):
|
||||||
# The Python method used for computing the field value
|
# The Python method used for computing the field value
|
||||||
self.method = method
|
self.method = method
|
||||||
# Does field computation produce plain text or XHTML?
|
# Does field computation produce plain text or XHTML?
|
||||||
|
@ -2174,10 +2180,10 @@ class Computed(Type):
|
||||||
# "someKey", it will be available to the macro as "options/someKey".
|
# "someKey", it will be available to the macro as "options/someKey".
|
||||||
self.context = context
|
self.context = context
|
||||||
Type.__init__(self, None, multiplicity, default, show, page, group,
|
Type.__init__(self, None, multiplicity, default, show, page, group,
|
||||||
layouts, move, indexed, False, specificReadPermission,
|
layouts, move, indexed, searchable,specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, sync, mapping,
|
master, masterValue, focus, historized, sync, mapping,
|
||||||
label, sdefault, scolspan)
|
label, sdefault, scolspan, swidth, sheight)
|
||||||
self.validable = False
|
self.validable = False
|
||||||
|
|
||||||
def callMacro(self, obj, macroPath):
|
def callMacro(self, obj, macroPath):
|
||||||
|
@ -2247,7 +2253,7 @@ class Action(Type):
|
||||||
move, indexed, False, specificReadPermission,
|
move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, False, mapping,
|
master, masterValue, focus, historized, False, mapping,
|
||||||
label, None, None)
|
label, None, None, None, None)
|
||||||
self.validable = False
|
self.validable = False
|
||||||
|
|
||||||
def getDefaultLayouts(self): return {'view': 'l-f', 'edit': 'lrv-f'}
|
def getDefaultLayouts(self): return {'view': 'l-f', 'edit': 'lrv-f'}
|
||||||
|
@ -2295,7 +2301,7 @@ class Info(Type):
|
||||||
move, indexed, False, specificReadPermission,
|
move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, False, mapping,
|
master, masterValue, focus, historized, False, mapping,
|
||||||
label, None, None)
|
label, None, None, None, None)
|
||||||
self.validable = False
|
self.validable = False
|
||||||
|
|
||||||
class Pod(Type):
|
class Pod(Type):
|
||||||
|
@ -2334,7 +2340,7 @@ class Pod(Type):
|
||||||
move, indexed, searchable, specificReadPermission,
|
move, indexed, searchable, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, False, mapping,
|
master, masterValue, focus, historized, False, mapping,
|
||||||
label, None, None)
|
label, None, None, None, None)
|
||||||
self.validable = False
|
self.validable = False
|
||||||
|
|
||||||
def isFrozen(self, obj):
|
def isFrozen(self, obj):
|
||||||
|
@ -2478,7 +2484,7 @@ class List(Type):
|
||||||
layouts, move, indexed, False, specificReadPermission,
|
layouts, move, indexed, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, historized, True, mapping,
|
master, masterValue, focus, historized, True, mapping,
|
||||||
label, None, None)
|
label, None, None, None, None)
|
||||||
self.validable = True
|
self.validable = True
|
||||||
# Tuples of (names, Type instances) determining the format of every
|
# Tuples of (names, Type instances) determining the format of every
|
||||||
# element in the list.
|
# element in the list.
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Calendar(Type):
|
||||||
layouts, move, False, False, specificReadPermission,
|
layouts, move, False, False, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, False, True, mapping, label,
|
master, masterValue, focus, False, True, mapping, label,
|
||||||
None, None)
|
None, None, None, None)
|
||||||
# eventTypes can be a "static" list or tuple of strings that identify
|
# eventTypes can be a "static" list or tuple of strings that identify
|
||||||
# the types of events that are supported by this calendar. It can also
|
# the types of events that are supported by this calendar. It can also
|
||||||
# be a method that computes such a "dynamic" list or tuple. When
|
# be a method that computes such a "dynamic" list or tuple. When
|
||||||
|
|
|
@ -396,12 +396,11 @@ class ToolMixin(BaseMixin):
|
||||||
res = getattr(self.appy(), toolFieldName)
|
res = getattr(self.appy(), toolFieldName)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def truncateValue(self, value, appyType):
|
def truncateValue(self, value, width=15):
|
||||||
'''Truncates the p_value according to p_appyType width.'''
|
'''Truncates the p_value according to p_width.'''
|
||||||
maxWidth = appyType['width']
|
|
||||||
if isinstance(value, str): value = value.decode('utf-8')
|
if isinstance(value, str): value = value.decode('utf-8')
|
||||||
if len(value) > maxWidth:
|
if len(value) > width:
|
||||||
return value[:maxWidth].encode('utf-8') + '...'
|
return value[:width].encode('utf-8') + '...'
|
||||||
return value.encode('utf-8')
|
return value.encode('utf-8')
|
||||||
|
|
||||||
def truncateText(self, text, width=15):
|
def truncateText(self, text, width=15):
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Ogone(Type):
|
||||||
False, False,specificReadPermission,
|
False, False,specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
master, masterValue, focus, False, True, mapping, label,
|
master, masterValue, focus, False, True, mapping, label,
|
||||||
None, None)
|
None, None, None, None)
|
||||||
# orderMethod must contain a method returning a dict containing info
|
# orderMethod must contain a method returning a dict containing info
|
||||||
# about the order. Following keys are mandatory:
|
# about the order. Following keys are mandatory:
|
||||||
# * orderID An identifier for the order. Don't use the object UID
|
# * orderID An identifier for the order. Don't use the object UID
|
||||||
|
|
|
@ -73,7 +73,7 @@ img { border: 0; vertical-align: middle}
|
||||||
background-color: #d7dee4; border-radius: 2px 2px 2px 2px;
|
background-color: #d7dee4; border-radius: 2px 2px 2px 2px;
|
||||||
box-shadow: 0 2px 4px #A9A9A9 }
|
box-shadow: 0 2px 4px #A9A9A9 }
|
||||||
.focus td { padding: 4px 0px 4px 4px }
|
.focus td { padding: 4px 0px 4px 4px }
|
||||||
.discreet { font-size: 90%; }
|
.discreet { font-size: 90%; color: grey }
|
||||||
.lostPassword a { font-size: 90%; color: white; padding-left: 1em;}
|
.lostPassword a { font-size: 90%; color: white; padding-left: 1em;}
|
||||||
.portlet { width: 150px; border-right: 1px solid #5F7983;
|
.portlet { width: 150px; border-right: 1px solid #5F7983;
|
||||||
background-color: #ededed}
|
background-color: #ededed}
|
||||||
|
@ -127,7 +127,6 @@ img { border: 0; vertical-align: middle}
|
||||||
.history th { font-style: italic; text-align: left; padding: 0 5px 0 5px }
|
.history th { font-style: italic; text-align: left; padding: 0 5px 0 5px }
|
||||||
.topSpace { margin-top: 15px;}
|
.topSpace { margin-top: 15px;}
|
||||||
.bottomSpace { margin-bottom: 15px;}
|
.bottomSpace { margin-bottom: 15px;}
|
||||||
.discreet { color: grey}
|
|
||||||
.pageLink { padding-left: 8px }
|
.pageLink { padding-left: 8px }
|
||||||
.footer { font-size: 95% }
|
.footer { font-size: 95% }
|
||||||
.footer td { background-color: #CBCBC9; border-top: 1px solid grey;
|
.footer td { background-color: #CBCBC9; border-top: 1px solid grey;
|
||||||
|
|
|
@ -23,14 +23,16 @@
|
||||||
<label tal:content="python: _(widget['labelId'])"></label><br>
|
<label tal:content="python: _(widget['labelId'])"></label><br>
|
||||||
<tal:from define="fromName python: '%s*float' % widgetName">
|
<tal:from define="fromName python: '%s*float' % widgetName">
|
||||||
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||||
<input type="text" size="4"
|
<input type="text"
|
||||||
tal:attributes="name fromName; maxlength maxChars;
|
tal:attributes="name fromName; maxlength maxChars;
|
||||||
value python: widget['sdefault'][0]"/>
|
value python: widget['sdefault'][0];
|
||||||
|
size widget/swidth"/>
|
||||||
</tal:from>
|
</tal:from>
|
||||||
<tal:to define="toName python: '%s_to' % name">
|
<tal:to define="toName python: '%s_to' % name">
|
||||||
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||||
<input type="text" size="4"
|
<input type="text"
|
||||||
tal:attributes="name toName; maxlength maxChars;
|
tal:attributes="name toName; maxlength maxChars;
|
||||||
value python: widget['sdefault'][1]"/>
|
value python: widget['sdefault'][1];
|
||||||
|
size widget/swidth"/>
|
||||||
</tal:to><br/>
|
</tal:to><br/>
|
||||||
</metal:search>
|
</metal:search>
|
||||||
|
|
|
@ -23,14 +23,16 @@
|
||||||
<label tal:content="python: _(widget['labelId'])"></label><br>
|
<label tal:content="python: _(widget['labelId'])"></label><br>
|
||||||
<tal:from define="fromName python: '%s*int' % widgetName">
|
<tal:from define="fromName python: '%s*int' % widgetName">
|
||||||
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||||
<input type="text" size="4"
|
<input type="text"
|
||||||
tal:attributes="name fromName; maxlength maxChars;
|
tal:attributes="name fromName; maxlength maxChars;
|
||||||
value python: widget['sdefault'][0]"/>
|
value python: widget['sdefault'][0];
|
||||||
|
size widget/swidth"/>
|
||||||
</tal:from>
|
</tal:from>
|
||||||
<tal:to define="toName python: '%s_to' % name">
|
<tal:to define="toName python: '%s_to' % name">
|
||||||
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||||
<input type="text" size="4"
|
<input type="text"
|
||||||
tal:attributes="name toName; maxlength maxChars;
|
tal:attributes="name toName; maxlength maxChars;
|
||||||
value python: widget['sdefault'][1]"/>
|
value python: widget['sdefault'][1];
|
||||||
|
size widget/swidth"/>
|
||||||
</tal:to><br/>
|
</tal:to><br/>
|
||||||
</metal:search>
|
</metal:search>
|
||||||
|
|
|
@ -158,7 +158,8 @@
|
||||||
<tal:comment replace="nothing">The search icon if field is queryable</tal:comment>
|
<tal:comment replace="nothing">The search icon if field is queryable</tal:comment>
|
||||||
<a tal:condition="python: objs and appyType['queryable']"
|
<a tal:condition="python: objs and appyType['queryable']"
|
||||||
tal:attributes="href python: '%s/ui/search?className=%s&ref=%s:%s' % (tool.absolute_url(), linkedPortalType, contextObj.UID(), appyType['name'])">
|
tal:attributes="href python: '%s/ui/search?className=%s&ref=%s:%s' % (tool.absolute_url(), linkedPortalType, contextObj.UID(), appyType['name'])">
|
||||||
<img src="search.gif" tal:attributes="title python: _('search_title')"/></a>
|
<img tal:attributes="title python: _('search_title');
|
||||||
|
src string: $appUrl/ui/search.gif"/></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<tal:comment replace="nothing">Appy (top) navigation</tal:comment>
|
<tal:comment replace="nothing">Appy (top) navigation</tal:comment>
|
||||||
|
@ -265,12 +266,12 @@
|
||||||
<label tal:attributes="for andName" tal:content="python: _('search_and')"></label><br/>
|
<label tal:attributes="for andName" tal:content="python: _('search_and')"></label><br/>
|
||||||
</tal:operator>
|
</tal:operator>
|
||||||
<tal:comment replace="nothing">The list of values</tal:comment>
|
<tal:comment replace="nothing">The list of values</tal:comment>
|
||||||
<select tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
<select tal:attributes="name widgetName; size widget/sheight" multiple="multiple">
|
||||||
<tal:option repeat="v python: tool.getSearchValues(name, className)">
|
<tal:option repeat="v python: tool.getSearchValues(name, className)">
|
||||||
<option tal:define="uid python: v[0];
|
<option tal:define="uid python: v[0];
|
||||||
title python: tool.getReferenceLabel(name, v[1], className)"
|
title python: tool.getReferenceLabel(name, v[1], className)"
|
||||||
tal:attributes="value uid; title title"
|
tal:attributes="value uid; title title"
|
||||||
tal:content="python: tool.truncateValue(title, widget)">
|
tal:content="python: tool.truncateValue(title, widget['swidth'])">
|
||||||
</option>
|
</option>
|
||||||
</tal:option>
|
</tal:option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
tal:attributes="value python: possibleValue[0];
|
tal:attributes="value python: possibleValue[0];
|
||||||
selected python:contextObj.fieldValueSelected(name, possibleValue[0], rawValue);
|
selected python:contextObj.fieldValueSelected(name, possibleValue[0], rawValue);
|
||||||
title python: possibleValue[1]"
|
title python: possibleValue[1]"
|
||||||
tal:content="python:tool.truncateValue(possibleValue[1], widget)"></option>
|
tal:content="python:tool.truncateValue(possibleValue[1], widget['width'])"></option>
|
||||||
</select>
|
</select>
|
||||||
</tal:choice>
|
</tal:choice>
|
||||||
<tal:line condition="python: isOneLine and not isSelect">
|
<tal:line condition="python: isOneLine and not isSelect">
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<tal:simpleSearch condition="not: widget/isSelect">
|
<tal:simpleSearch condition="not: widget/isSelect">
|
||||||
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
||||||
tal:attributes="name python: '%s*string-%s' % (widgetName, widget['transform']);
|
tal:attributes="name python: '%s*string-%s' % (widgetName, widget['transform']);
|
||||||
maxlength maxChars; size widget/width;
|
maxlength maxChars; size widget/swidth;
|
||||||
style python: 'text-transform:%s' % widget['transform'];
|
style python: 'text-transform:%s' % widget['transform'];
|
||||||
value widget/sdefault"/>
|
value widget/sdefault"/>
|
||||||
</tal:simpleSearch>
|
</tal:simpleSearch>
|
||||||
|
@ -113,11 +113,11 @@
|
||||||
</tal:operator>
|
</tal:operator>
|
||||||
<tal:comment replace="nothing">The list of values</tal:comment>
|
<tal:comment replace="nothing">The list of values</tal:comment>
|
||||||
<select tal:define="preSelected widget/sdefault"
|
<select tal:define="preSelected widget/sdefault"
|
||||||
tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
tal:attributes="name widgetName; size widget/sheight" multiple="multiple">
|
||||||
<option tal:repeat="v python:tool.getPossibleValues(name, withTranslations=True, withBlankValue=False, className=className)"
|
<option tal:repeat="v python:tool.getPossibleValues(name, withTranslations=True, withBlankValue=False, className=className)"
|
||||||
tal:attributes="value python:v[0]; title python: v[1];
|
tal:attributes="value python:v[0]; title python: v[1];
|
||||||
selected python: v[0] in preSelected"
|
selected python: v[0] in preSelected"
|
||||||
tal:content="python: tool.truncateValue(v[1], widget)">
|
tal:content="python: tool.truncateValue(v[1], widget['swidth'])">
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</tal:selectSearch><br/>
|
</tal:selectSearch><br/>
|
||||||
|
|
Loading…
Reference in a new issue