[gen] Bugfixes.

This commit is contained in:
Gaetan Delannay 2014-02-27 12:54:05 +01:00
parent c002b5cb59
commit fe56ee27a0
10 changed files with 19 additions and 18 deletions

View file

@ -42,7 +42,7 @@ class Field:
dLayouts = 'lrv-d-f'
wLayouts = Table('lrv-f')
# Render a field. Optiona vars:
# Render a field. Optional vars:
# * fieldName can be given as different as field.name for fields included
# in List fields: in this case, fieldName includes the row
# index.
@ -409,9 +409,11 @@ class Field:
layouts['view'].addCssClasses('focus')
layouts['edit'].addCssClasses('focus')
# If layouts are the default ones, set width=None instead of width=100%
# for the field if it is not in a group (excepted for rich texts).
# for the field if it is not in a group (excepted for rich texts and
# refs).
if areDefault and not self.group and \
not ((self.type == 'String') and (self.format == self.XHTML)):
not ((self.type == 'String') and (self.format == self.XHTML)) and \
not (self.type == 'Ref'):
for layoutType in layouts.iterkeys():
layouts[layoutType].width = ''
# Remove letters "r" from the layouts if the field is not required.

View file

@ -124,7 +124,7 @@ class Date(Field):
monthToName='%s_to_month' % name;
yearToName='%s_to_year' % name">
<td></td>
<td><label>_('search_to')</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><label>:_('search_to')</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td height="20px">
<select id=":dayToName" name=":dayToName">
<option value="">--</option>
@ -142,10 +142,10 @@ class Date(Field):
value=":value">:value</option>
</select>
<!-- The icon for displaying the calendar popup -->
<x if="widget.calendar">
<x if="field.calendar">
<input type="hidden" id=":toName" name=":toName"/>
<img id=":'%s_img' % toName" src=":url('calendar.gif')"/>
<script type="text/javascript">::field.getJsInit(toName, years)">
<script type="text/javascript">::field.getJsInit(toName, years)
</script>
</x>
</td>

View file

@ -35,7 +35,7 @@ class Pod(Field):
'contact the system administrator.'
DELETE_TEMP_DOC_ERROR = 'A temporary document could not be removed. %s.'
pxView = pxCell = Px('''<x>
pxView = pxCell = Px('''
<!-- Ask action -->
<x if="field.askAction"
var2="doLabel='%s_askaction' % field.labelId;
@ -46,8 +46,7 @@ class Pod(Field):
<img for="fmt in field.getOutputFormats(zobj)" src=":url(fmt)"
onclick=":'generatePodDocument(%s, %s, %s, %s)' % \
(q(zobj.UID()), q(name), q(fmt), q(ztool.getQueryInfo()))"
title=":fmt.capitalize()" class="clickable"/>
</x>''')
title=":fmt.capitalize()" class="clickable"/>''')
pxEdit = pxSearch = ''

View file

@ -173,7 +173,7 @@ class String(Field):
<option for="v in field.getPossibleValues(ztool, withTranslations=True,\
withBlankValue=False, className=className)"
selected=":v[0] in preSelected" value=":v[0]"
title=":v[1]">ztool.truncateValue(v[1], field.swidth)</option>
title=":v[1]">:ztool.truncateValue(v[1], field.swidth)</option>
</select>
</x><br/>
</x>''')